結果
| 問題 | No.791 うし数列 |
| コンテスト | |
| ユーザー |
momoyuu
|
| 提出日時 | 2024-09-30 02:03:06 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 500 bytes |
| 記録 | |
| コンパイル時間 | 889 ms |
| コンパイル使用メモリ | 164,964 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-06 10:33:19 |
| 合計ジャッジ時間 | 2,375 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(){
cin.tie(nullptr);
ios::sync_with_stdio(false);
string s;
cin>>s;
bool fn = true;
int n = s.size();
for(int i = 0;i<n;i++){
if(i==0){
if(s[i]!='1') fn = false;
}else{
if(s[i]!='3') fn = false;
}
}
if(fn){
int m = s.size();
cout<<m-1<<endl;
}else{
cout<<-1<<endl;
}
}
momoyuu