結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2015-09-03 18:15:26 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 399 bytes |
コンパイル時間 | 1,600 ms |
コンパイル使用メモリ | 158,436 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-18 21:53:29 |
合計ジャッジ時間 | 3,000 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 24 WA * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; string t = "nyanpass"; int n; int cnt[100]; int main() { scanf("%d", &n); for (int i = 0; i < n; i++){ for (int j = 0; j < n; j++){ string s; cin >> s; if (s == t) cnt[j]++; } } int q = 0, r = -1; for (int i = 0; i < n; i++){ if (cnt[i] == n - 1){ q++; r = i; } } if (q > 1) puts("-1"); else printf("%d\n", r + 1); }