結果
| 問題 | No.791 うし数列 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-02-27 17:53:40 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 531µs | |
| コード長 | 554 bytes |
| 記録 | |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 73,472 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-27 15:46:56 |
| 合計ジャッジ時間 | 1,763 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 15 |
ソースコード
#include <iostream>
#include <string>
#include <cstring>
int main()
{
std::string in;
std::cin >> in;
if(*in.begin() != '1')
{
std::cout << -1 << std::endl;
}
else
{
int counter = 0;
for(auto itr = in.begin() + 1; itr != in.end(); ++itr)
{
if(*itr != '3')
{
std::cout << -1 << std::endl;
return 0;
}
counter++;
}
std::cout << (counter == 0 ? -1 : counter) << std::endl;
}
return 0;
}