結果
| 問題 | No.3084 Identify f(x) | 
| コンテスト | |
| ユーザー |  gew1fw | 
| 提出日時 | 2025-06-12 15:28:14 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                TLE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 380 bytes | 
| コンパイル時間 | 174 ms | 
| コンパイル使用メモリ | 83,012 KB | 
| 実行使用メモリ | 79,256 KB | 
| 最終ジャッジ日時 | 2025-06-12 15:28:31 | 
| 合計ジャッジ時間 | 6,744 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | TLE * 1 -- * 6 | 
ソースコード
def main():
    import sys
    input = sys.stdin.read().split()
    N = int(input[0])
    A = list(map(int, input[1:N+1]))
    
    current = 0
    for a in A:
        if a == 0:
            current = 0
        elif a == 1:
            current += 1
        else:
            current += 3 + 1*(current//1) if current else 4
    print(current)
if __name__ == "__main__":
    main()
            
            
            
        