結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
commy
|
| 提出日時 | 2017-10-14 20:40:15 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 650 bytes |
| コンパイル時間 | 675 ms |
| コンパイル使用メモリ | 74,496 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 14:52:15 |
| 合計ジャッジ時間 | 1,771 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int lli;
int main() {
int N;
cin >> N;
vector<vector<string>> A(N, vector<string>(N));
REP (i, 0, N) REP (j, 0, N) cin >> A[i][j];
int nyanpass = -2;
REP (j, 0, N) {
int tmp = 0;
REP (i, 0, N) {
if (A[i][j] == "nyanpass") tmp++;
}
if (tmp == N - 1) {
if (nyanpass == -2) nyanpass = j + 1;
else nyanpass = -1;
}
}
cout << max(-1, nyanpass) << endl;
return 0;
}
commy