結果

問題 No.239 にゃんぱすー
ユーザー sqrt_3
提出日時 2017-03-02 18:08:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 654 ms
コンパイル使用メモリ 59,052 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-13 01:29:52
合計ジャッジ時間 1,650 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
//typedef __int64 LL;
int main(){
    int N;
    int ans=-1;
    string s[110][110];
    cin>>N;
    for(int i=1;i<=N;i++){
        for(int j=1;j<=N;j++){
	    cin>>s[i][j];
	}
    }
    for(int i=1;i<=N;i++){
        int hoge=0;
        for(int j=1;j<=N;j++){
	    if(s[j][i]=="nyanpass")hoge++;
	}
	if(hoge==N-1){
	   if(ans==-1)ans=i;
	   else ans=-1,i=N+1;
	}
    }
    cout<<ans<<endl;
    return 0;
}
0