結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2016-08-23 21:27:28 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 557 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 60,316 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 00:39:09 |
合計ジャッジ時間 | 1,418 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) #define ll long long bool A[100][100]; int main() { int n; cin >> n; rep(i, n) rep(j, n) { string s; cin >> s; if (s == "nyanpass") A[i][j] = true; else if (s == "-") A[i][j] = true; } int cnt = 0,ans; rep(j, n) rep(i,n){ if (A[i][j]) { if (i == n - 1) { cnt++; ans = j + 1; } continue; } else break; } if (cnt == 1) cout << ans << endl; else cout << -1 << endl; return 0; }