Codeforces Round #437 (Div. 2)
codeforces 867 A. Between the Offices(水)
题意:已知白天所在地(晚上可能坐飞机飞往异地),问是否从西雅图飞到旧金山次数更多。
题解:只要判断第一天和最后一天状态即可。
1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int N = 101; 6 int n; 7 char s[N]; 8 int main() { 9 scanf("%d %s", &n, s); 10 if(s[0] == 'S' && s[n-1] == 'F') puts("YES"); 11 else puts("NO"); 12 return 0; 13 }