結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-17 19:30:42 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 726 bytes |
| 記録 | |
| コンパイル時間 | 300 ms |
| コンパイル使用メモリ | 59,520 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-29 21:30:12 |
| 合計ジャッジ時間 | 2,272 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <stdio.h>
#include <string>
int main(){
//input
int N;
scanf("%d",&N);
bool person[100];
for (int i = 0;i < N;i++){
person[i] = true;
}
for (int i = 0;i < N;i++){
for (int j = 0;j < N;j++){
char str[31];
scanf("%s",str);
if (i != j && std::string(str) != "nyanpass"){
person[j] = false;
}
}
}
//count "true" person
int renge;
int count = 0;
for (int i = 0;i < N;i++){
if (person[i]){
renge = i+1;
count++;
}
}
//output
if (count == 1){
printf("%d\n",renge);
}else{
printf("%d\n",-1);
}
return 0;
}