結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2018-05-12 19:03:24 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 664 bytes |
コンパイル時間 | 1,316 ms |
コンパイル使用メモリ | 161,120 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 09:41:06 |
合計ジャッジ時間 | 3,139 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include<bits/stdc++.h>using namespace std;int main(){int N;int ans=0;cin >> N;string A[N][N];for(int i=0;i<N;i++){for(int j=0;j<N;j++){cin >> A[j][i];}}for(int i=0;i<N;i++){for(int j=0;j<N;j++){if(A[i][j]=="nyanpass" || A[i][j]=="-"){if(j==N-1 && ans==0) ans = i+1;else if(j==N-1 && ans!=0){cout << -1 << endl;return 0;}}else{break;}}}if(ans==0) cout << -1 << endl;else cout << ans << endl;return 0;}