結果
| 問題 | No.791 うし数列 | 
| コンテスト | |
| ユーザー |  greentea011 | 
| 提出日時 | 2019-03-14 09:41:54 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 490 bytes | 
| コンパイル時間 | 666 ms | 
| コンパイル使用メモリ | 63,440 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-06-26 03:02:09 | 
| 合計ジャッジ時間 | 1,173 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 15 | 
ソースコード
#include <iostream>
#include <string>
#include <iterator>
int main() {
    std::string s;
    std::cin >> s;
    decltype(s)::iterator ite = s.begin();
    char& c = *ite;
    try {
        if (c != '1') throw -1;
        else if (s.length() == 1) throw -1;
        ite++;
        for (; ite != s.end(); ite++) {
            c = *ite;
            if (c != '3') throw -1;
        }
        throw (int) (s.length()-1);
    }
    catch (int e) {
        std::cout << e << std::endl;
    }
}
            
            
            
        