結果

問題 No.239 にゃんぱすー
ユーザー hashi
提出日時 2015-07-14 16:04:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 799 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 55,252 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-08 07:12:49
合計ジャッジ時間 1,541 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main(){
    // FILE* fp_in = freopen("data.txt", "r", stdin);
    int n;
    cin >> n;
    bool founded[n];
    for(int i=0; i<n; i++) founded[i] = true;
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            string s;
            cin >> s;
            if(s.compare("nyanpass") != 0 && s.compare("-") != 0){ 
                founded[j] = false;
            }   
        }   
    }   
    int renchon = 0;
    for(int i=0; i<n; i++){
        if(founded[i]){
            if(renchon > 0){ 
                //  特定できず
                renchon = 0;
                break;
            }   
            renchon = (i+1);
        }   
    }   
    if (renchon > 0) cout << renchon << endl;
    else cout << -1 << endl;

    return 0;
}
0