結果

問題 No.239 にゃんぱすー
ユーザー krotonkroton
提出日時 2015-07-08 20:31:50
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 566 ms
コンパイル使用メモリ 60,596 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-08 01:44:18
合計ジャッジ時間 1,975 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;

string A[100][100];
int main(){
	int N;
	cin >> N;

	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			cin >> A[i][j];
		}
	}

	vector<int> res;
	for(int x=0;x<N;x++){
		bool ok = true;
		for(int i=0;i<N;i++)if(i != x){
			if(A[i][x] != "nyanpass"){
				ok = false;
				break;
			}
		}
		if(ok){
			res.push_back(x + 1);
		}
	}

	cout << (res.size() == 1 ? res[0] : -1) << endl;
	return 0;
}
0