結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-03 16:00:09 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 214 bytes |
| コンパイル時間 | 828 ms |
| コンパイル使用メモリ | 77,568 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-21 02:19:23 |
| 合計ジャッジ時間 | 1,343 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main(){
string n;
cin>>n;
for(int i=0;i<n.size();i++)
if(n[i]!=(i?'3':'1'))
cout<<-1<<endl,exit(0);
cout<<(int)n.size()-1-(n.size()==1)<<endl;
}