結果

問題 No.239 にゃんぱすー
ユーザー 0w1
提出日時 2016-11-19 18:22:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 172,984 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-27 06:06:31
合計ジャッジ時間 3,157 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

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

signed main(){
  int N; cin >> N;
  vector< vector< string > > mat( N, vector< string >( N ) );
  for( int i = 0; i < N; ++i )
    for( int j = 0; j < N; ++j )
      cin >> mat[ i ][ j ];
  int ans = -1;
  for( int j = 0; j < N; ++j ){
    int ng = 0;
    for( int i = 0; i < N; ++i ) if( i != j )
      ng |= mat[ i ][ j ] != "nyanpass";
    if( not ng ){
      if( ans != -1 )
        cout << -1 << endl,
        exit( 0 );
      else
        ans = j + 1;
    }
  }
  cout << ans << endl;
  return 0;
}
 
0