結果

問題 No.627 ランダムウォークの軌跡
ユーザー Eclair1015Eclair1015
提出日時 2018-07-09 06:35:14
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 60,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 00:45:14
合計ジャッジ時間 1,660 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include<string>

using namespace std;
int main() {
	int t,point=0;
	int patx, paty;
	bool flag = false;
	cin >> t;
	vector<int>x(t);
	for (int i = 0; i < t; i++) cin >> x[i];

	for (int i = 0; i < t; i++) {
		patx = point + 1;
		paty = point - 1;
		if (patx == x[i]) {
			point = patx;
		}else if(paty==x[i]){
			point = paty;
		}else{
			flag = true;
			break;
		}
	}
	if (flag)cout << "F\n";
	else cout << "T\n";
}

0