結果

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <fstream>

using namespace std;

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	std::cout << std::fixed;
	int N;
	vector<int> A(100);
	cin >> N;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			string L;
			cin >> L;
			if (L == "nyanpass") {
				A[j]++;
			}
		}
	}
	int index = -1;
	for (int i = 0; i < N; i++) {
		if (A[i] == N - 1) {
			if (index == -1)
				index = i + 1;
			else
				index = -2;
		}
	}
	cout << ((index < 0) ? -1 : index) << endl;
}
0