結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-04 15:59:54 |
| 言語 | C (gcc 15.3.0) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 953µs | |
| コード長 | 555 bytes |
| 記録 | |
| コンパイル時間 | 752 ms |
| コンパイル使用メモリ | 39,232 KB |
| 実行使用メモリ | 7,724 KB |
| 最終ジャッジ日時 | 2026-09-04 16:01:46 |
| 合計ジャッジ時間 | 3,196 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <stdio.h>
#include <string.h>
int main(void)
{
char a[101][101][31];
int n;
int i, j;
int vno[101] = {0};
int count = 0;
int ans = 0;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
scanf("%s", &a[i][j]);
}
}
for (i = 1; i <= n; i++) {
for (j = 1; j <= n; j++) {
if (!strcmp(a[i][j], "nyanpass"))
vno[j]++;
}
}
for (j = 1; j <= n; j++) {
if (vno[j] == n - 1) {
count++;
ans = j;
}
}
if (count == 0 || count >= 2)
printf("%d\n", -1);
else
printf("%d\n", ans);
return 0;
}