結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2017-08-25 19:37:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 567 bytes |
コンパイル時間 | 547 ms |
コンパイル使用メモリ | 63,352 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-15 15:42:41 |
合計ジャッジ時間 | 1,734 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream>#include <vector>#include <string>#include <numeric>using namespace std;int main(){int N;string str;cin >> N;vector<vector<int> > A(N + 1, vector<int>(N + 1, 0));for (int i = 1; i <= N; i++) {for (int j = 1; j <= N; j++) {cin >> str;A[j][i] = (str == "nyanpass" ? 1 : 0);}}int nyancount = 0, nyan;for (int i = 1; i <= N; i++) {if (accumulate(A[i].begin(), A[i].end(), 0) == N - 1) {nyancount++;nyan = i;}}if (nyancount == 1)cout << nyan << endl;elsecout << -1 << endl;return 0;}