結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
|
提出日時 | 2020-07-14 22:10:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 7 ms / 2,000 ms |
コード長 | 652 bytes |
コンパイル時間 | 1,492 ms |
コンパイル使用メモリ | 173,188 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 22:37:38 |
合計ジャッジ時間 | 2,901 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (ll i = 0; i < n; ++i) typedef long long ll; using namespace std; const int INF = 1e9; int main() { int n; cin >> n; vector<vector<string>> s(n, vector<string>(n)); rep(i, n) rep(j, n) cin >> s[i][j]; int ans = -1; rep(j, n) { bool flag = true; rep(i, n) { if (s[i][j] != "nyanpass" && s[i][j] != "-") flag = false; } if (flag) { if (ans != -1) { cout << -1 << endl; return 0; } ans = j + 1; } } cout << ans << endl; return 0; }