結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2020-12-15 10:16:24 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 486 bytes |
コンパイル時間 | 1,566 ms |
コンパイル使用メモリ | 169,448 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-20 01:31:36 |
合計ジャッジ時間 | 3,121 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {int n;string s;cin >> n;vector<int> a(n, 1);for (int i = 0; i < n; i++) {for (int j = 0; j < n; j++) {cin >> s;if (s != "nyanpass" && s != "-") a[j] = 0;}}int ans = -1;for (int i = 0; i < n; i++) {if (a[i]) {if (ans != -1) {cout << -1 << endl;return 0;}else {ans = i + 1;}}}cout << ans << endl;return 0;}