結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
|
| 提出日時 | 2015-07-10 23:01:08 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| コード長 | 597 bytes |
| コンパイル時間 | 565 ms |
| コンパイル使用メモリ | 63,576 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-08 02:04:15 |
| 合計ジャッジ時間 | 1,289 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
int N;
cin>>N;
vector<string> greed;
for(int i=0 ; i<N ; i++){
for(int j=0 ; j<N ; j++){
string s;
cin>>s;
greed.push_back(s);
}
}
int count = 0;
int renchon = 0;
int check = 0;
for(int i=0 ; i<N ; i++){
count=0;
for(int j=0 ; j<N ; j++){
if(greed[N*j+i] == "nyanpass"){
count++;
}
}
if(count == N-1){
check++;
renchon = i+1;
}
}
if(check==1){
cout<<renchon<<endl;
}else{
cout<<-1<<endl;
}
return 0;
}