結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
kaito_tateyama
|
| 提出日時 | 2019-03-06 14:31:36 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 789 bytes |
| コンパイル時間 | 596 ms |
| コンパイル使用メモリ | 74,008 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 14:34:20 |
| 合計ジャッジ時間 | 1,223 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <stdio.h>
using namespace std;
#define REP(i,n) for(int i = 0; i < (n); ++i)
#define P(x) cout << (x) << "\n"
#define D(x) cerr << (x) << "\n"
#define fcout cout << fixed << setprecision(18)
using i64=long long int; // 10^18
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
string s;cin>>s;
if(s=="1"){
P(-1);
return 0;
}
REP(i,(int)s.size()){
if(i==0){
if((int)s[i] - 48 !=1){
P(-1);
return 0;
}
}else{
if((int)s[i]-48 != 3){
P(-1);
return 0;
}
}
}
P((int)s.size() - 1);
return 0;
}
kaito_tateyama