結果
| 問題 | No.791 うし数列 | 
| コンテスト | |
| ユーザー |  @abcde | 
| 提出日時 | 2019-02-22 21:36:16 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 401 bytes | 
| コンパイル時間 | 1,163 ms | 
| コンパイル使用メモリ | 159,460 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-25 06:00:23 | 
| 合計ジャッジ時間 | 1,766 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 13 WA * 2 | 
ソースコード
#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 && l > 1) ans = count3;
    // 3. 出力.
    cout << ans << endl;
    return 0;
    
}
            
            
            
        