結果
問題 | No.791 うし数列 |
ユーザー |
![]() |
提出日時 | 2019-02-22 21:34:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 392 bytes |
コンパイル時間 | 1,251 ms |
コンパイル使用メモリ | 158,384 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 05:56:28 |
合計ジャッジ時間 | 1,845 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long LL; int main() { // 1. 入力情報取得. string N; cin >> N; // 2. 何項目目? LL l = N.size(); LL count3 = 0; for(int i = 0; i < l; i++) if(N[i] == '3') count3++; LL ans = -1; if(l - 1 == count3) ans = count3; // 3. 出力. cout << ans << endl; return 0; }