結果
| 問題 | No.791 うし数列 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-02-06 15:56:57 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 274 bytes | 
| コンパイル時間 | 489 ms | 
| コンパイル使用メモリ | 54,952 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-09-25 06:49:10 | 
| 合計ジャッジ時間 | 1,162 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 15 | 
ソースコード
#include <iostream>
using namespace std;
int main(){
    string e;cin >> e;
    int ans=e.size()-1;
    for(int i=0;i<e.size();i++){
        if((i==0 && e[i]!='1')||(i>0 && e[i]!='3'))ans=0;
    }
    if(!ans)cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}
            
            
            
        