結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
|
提出日時 | 2015-07-10 23:00:04 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 622 ms |
コンパイル使用メモリ | 61,848 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-08 02:04:11 |
合計ジャッジ時間 | 1,349 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 16 WA * 17 |
ソースコード
#include <iostream> #include <string> #include <vector> using namespace std; int main() { int N; cin>>N; vector<string> greed; for(int i=0 ; i<N ; i++){ for(int j=0 ; j<N ; j++){ string s; cin>>s; greed.push_back(s); } } int count = 0; int renchon = 0; int check = 0; for(int i=0 ; i<N ; i++){ count=0; for(int j=0 ; j<N ; j++){ if(greed[N*j+i] == "nyanpass"){ count++; } } if(count == N){ check++; renchon = i+1; } } if(check==1){ cout<<renchon<<endl; }else{ cout<<-1<<endl; } return 0; }