結果
問題 |
No.791 うし数列
|
ユーザー |
|
提出日時 | 2019-10-02 09:12:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 416 bytes |
コンパイル時間 | 570 ms |
コンパイル使用メモリ | 63,104 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-03 05:51:26 |
合計ジャッジ時間 | 1,138 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <cstdio> #include <iostream> #include <string> #define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++) typedef long long int ll; int main( void ){ std::string str; std::cin >> str; if (str[ 0 ] != '1' || str.length() < 2){ printf( "-1\n" ); return 0; } rep( i, 1, str.length()){ if (str[ i ] != '3'){ printf( "-1\n" ); return 0; } } printf( "%d\n", str.length() - 1 ); return 0; }