結果

問題 No.239 にゃんぱすー
ユーザー なお
提出日時 2015-12-13 05:14:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 1,342 ms
コンパイル使用メモリ 158,452 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-15 11:04:26
合計ジャッジ時間 3,347 ms
ジャッジサーバーID
(参考情報)
judge2 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n)           for(int(i)=0;(i)<(n);++(i))

bool p[111];

int main(){
    int n;
    cin >> n;
    REP(i,n)REP(j,n){
        string s; cin >> s;
        if(i==j) continue;
        if(s != "nyanpass") p[j] = true;
    }
    int cnt = 0, res;
    REP(j,n){
        if(!p[j]){
            cnt++;
            res = j + 1;
        }
    }
    if(cnt != 1) res = -1;
    cout << res << endl;
}
0