結果
問題 |
No.627 ランダムウォークの軌跡
|
ユーザー |
|
提出日時 | 2019-05-06 15:43:18 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 336 bytes |
コンパイル時間 | 395 ms |
コンパイル使用メモリ | 54,136 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-27 16:19:52 |
合計ジャッジ時間 | 1,443 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
ソースコード
#include <iostream> using namespace std; int main(){ int Num,x,before=0; cin>>Num; int* point=new int[Num]; for (x=0;x<Num;x++){ cin>>point[x]; } for (x=0;x<Num;x++){ if((point[x]-before==1)||(point[x]-before==-1)){ before=point[x]; }else{ x=-1; break; } } if(x==-1){ cout<<"F"<<endl; }else{ cout<<"T"<<endl; } return 0; }