結果
問題 |
No.239 にゃんぱすー
|
ユーザー |
![]() |
提出日時 | 2020-03-17 17:39:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 6 ms / 2,000 ms |
コード長 | 530 bytes |
コンパイル時間 | 1,643 ms |
コンパイル使用メモリ | 171,860 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 22:48:20 |
合計ジャッジ時間 | 3,191 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<vector<string>> A( N, vector<string>( N ) ); for( int i = 0; i < N; i++ ) { for( int j = 0; j < N; j++ ) { cin >> A[i][j]; } } int idx; int cnt = 0; for( int j = 0; j < N; j++ ) { int flag = 0; for( int i = 0; i < N; i++ ) { if( i == j ) continue; if( A[i][j] != string( "nyanpass" ) ) flag = 1; } if( flag == 0 ) { idx = j; cnt++; } } int ans = -1; if( cnt == 1 ) ans = idx + 1; cout << ans << endl; }