結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2016-01-06 22:31:29 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 393 ms |
コンパイル使用メモリ | 54,404 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-19 12:24:36 |
合計ジャッジ時間 | 1,335 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 16 WA * 17 |
ソースコード
#include<iostream> using namespace std; int main(void) { int i, j, k, ans = 0, hu = 0, n, m = 0, pa[105] = { 0 }; char a[105][105][33], h[10] = "nyanpass"; cin >> n; for (j = 1; j <= n; j++) { for (i = 1; i <= n; i++) cin >> a[j][i]; for (k = 0; k < 8; k++) { m = 0; if (a[j][i][k] == h[k]) m++; else break; if (m == 8) { pa[i]++; } } } int min = n - 1; for (i = 1; i <= n; i++) if (min == pa[i]) { ans = i; hu++; } if (hu != 1)ans = -1; cout << ans << endl; return 0; }