結果

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

ソースコード

diff #

#include <iostream>
using namespace std;
 
int main(){
	int N;
	cin >> N;
	bool if_nyantyon[N];
	for(int i = 0; i < N; i++){
		if_nyantyon[i] = true;
	}
	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			string hello;
			cin >> hello;
			if(hello != "nyanpass" && hello != "-"){
				if_nyantyon[j] = false;
			}
		}
	}
	int ans = -1;
	for(int i = 0; i < N; i++){
		if(if_nyantyon[i]){
			if(ans == -1){
				ans = i + 1;
			}else{
				cout << -1 << endl;
				return 0;
			}
		}
	}
	cout << ans << endl;
}
0