結果

問題 No.239 にゃんぱすー
ユーザー kikage
提出日時 2020-03-06 20:56:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 527 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 62,560 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-14 03:30:56
合計ジャッジ時間 2,256 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
int main(){
    int N,id=-1;
    cin >> N;
    vector<vector<string>> A(N,vector<string>(N));
    for(int i=0;i<N;i++)for(int j=0;j<N;j++)cin >> A[i][j];
    for(int j=0;j<N;j++){
        int cnt=0;
        for(int i=0;i<N;i++){
            if(!A[i][j].compare("nyanpass"))cnt++;
        }
        if(cnt==N-1){
            if(id==-1)id=j+1;
            else id=N+1;
        }
    }
    if(0<id && id<=N)cout << id << endl;
    else cout << -1 << endl;
    return 0;
}
0