結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2015-10-03 01:56:51 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 508 ms |
コンパイル使用メモリ | 57,456 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 19:11:03 |
合計ジャッジ時間 | 1,448 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream> #include <sstream> using namespace std; int main(int argc, char *argv[]) { int cnt[100] = {}; int N; cin >> N; for (int i = 0; i < N; ++i) { for (int j = 0; j < N; ++j) { string s; cin >> s; cnt[j] += s.compare("nyanpass") == 0; } } int ans = -1; for (int i = 0; i < N; ++i) { if (cnt[i] >= (N - 1)) { if (ans >= 0) { ans = -1; break; } ans = i + 1; } } cout << ans << endl; return 0; }