結果

問題 No.239 にゃんぱすー
コンテスト
ユーザー forest3
提出日時 2020-03-17 17:39:37
言語 C++14
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 5 ms / 2,000 ms
+ 569µs
コード長 530 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,147 ms
コンパイル使用メモリ 193,068 KB
実行使用メモリ 9,844 KB
最終ジャッジ日時 2026-11-06 00:35:57
合計ジャッジ時間 3,939 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 35
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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;
}
0