結果

問題 No.239 にゃんぱすー
ユーザー chacoder1
提出日時 2020-12-29 11:14:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 2,279 ms
コンパイル使用メモリ 192,264 KB
最終ジャッジ日時 2025-01-17 07:59:01
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int ck[110];


int main(){
  int n;
  cin>>n;
  string temp;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
      cin>>temp;
      if(temp !="nyanpass" && temp !="-"){
        ck[j]=1;
      }
    }
  }
  int cnt=0;
  int ans=-1;
  for(int i=0;i<n;i++){
    if(ck[i]==0){
      cnt++;
      ans=i;
    } 
  }
  if(cnt==1){
    cout<<ans+1<<endl;
  }
  else{
    cout<<-1<<endl;
  }
  return 0;
}

  

0