結果
| 問題 | No.627 ランダムウォークの軌跡 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2018-01-05 21:45:15 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 13 ms / 2,000 ms | 
| コード長 | 507 bytes | 
| コンパイル時間 | 670 ms | 
| コンパイル使用メモリ | 66,548 KB | 
| 最終ジャッジ日時 | 2025-01-05 07:02:28 | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 33 | 
ソースコード
#include <iostream>
using namespace std;
int t;
int x[110];
int main() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
    
    cin >> t;
    
    int pos;
    
    cin >> pos;
    
    if (abs(pos) != 1) {
        cout << 'F' << endl;
        return 0;
    }
    
    t--;
    
    while (t--) {
        int a;
        cin >> a;
        if (abs(pos - a) > 1 || pos == a) {
            cout << 'F' << endl;
            return 0;
        }
        pos = a;
    }
    
    cout << 'T' << endl;
}
            
            
            
        