結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2015-12-10 21:39:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 568 bytes |
コンパイル時間 | 469 ms |
コンパイル使用メモリ | 59,480 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-15 07:42:41 |
合計ジャッジ時間 | 1,977 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; #define NYAN "nyanpass" int main(){ cin.tie(0); ios::sync_with_stdio(false); int n, bNyan=0, nyan_i; string str; cin >> n; vector<int> a(n, 1); for(int i=0; i<n; ++i){ for(int j=0; j<n; ++j){ cin >> str; if(str!=NYAN && str!="-") a[j]=0; } } for(int i=0; i<n; ++i){ if(a[i]==1){ if(bNyan==1){ cout << -1 << "\n"; return 0; } nyan_i=i; bNyan=1; } } if(bNyan==0)nyan_i=-2; cout << nyan_i+1 << "\n"; return 0; }