結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2023-01-06 20:26:15 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 591 bytes |
コンパイル時間 | 1,491 ms |
コンパイル使用メモリ | 172,544 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 15:56:21 |
合計ジャッジ時間 | 2,530 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(){int N; cin>>N;vector<vector<string> > mura(N,vector<string>(N));vector<int> record(N,0);for(int i=0;i<N;i++){for(int j=0;j<N;j++){cin>>mura[i][j];}}for(int i=0;i<N;i++){for(int j=0;j<N;j++){if(mura[i][j]=="nyanpass"){record[j]++;}}}int count=0,hito=0;for(int i=0;i<N;i++){if(record[i]==N-1){count++;hito=i;}}if(count==1){cout<<hito+1<<endl;}else{cout<<-1<<endl;}}