結果

問題 No.627 ランダムウォークの軌跡
ユーザー hiyorihiyori
提出日時 2019-02-10 15:54:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 63,764 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-20 16:11:53
合計ジャッジ時間 1,829 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 WA -
testcase_14 AC 2 ms
4,376 KB
testcase_15 WA -
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 WA -
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 1 ms
4,376 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,376 KB
testcase_29 WA -
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

 #include<iostream>
 #include<stdlib.h>
 using namespace std;

 int main()
 {
    int T,x,sub_x=0,flag=0;
    cin>>T;
    for(int i=0; i<T; i++){
        cin>>x;
            if(x-sub_x==1 || x-sub_x==-1){
                flag=1;
                sub_x = x; continue;
            }
            else { flag=0; }
        sub_x = x;
    }
    cout<<(flag ? "T" : "F")<<endl;
    return EXIT_SUCCESS;
 }
0