結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-21 23:37:52 |
| 言語 | C++23(gcc16) (gcc 16.2.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 5 ms / 2,000 ms |
| + 756µs | |
| コード長 | 459 bytes |
| 記録 | |
| コンパイル時間 | 2,683 ms |
| コンパイル使用メモリ | 187,432 KB |
| 実行使用メモリ | 9,844 KB |
| 最終ジャッジ日時 | 2026-10-21 23:38:18 |
| 合計ジャッジ時間 | 4,873 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 |
ソースコード
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
int main(void){
int n; cin >> n;
vector a(n, vector<string>(n));
for(auto&x:a)for(auto&y:x) cin >> y;
vector<int> ans;
for(int j=0; j<n; j++){
int c=0;
for(int i=0; i<n; i++){
if(a[i][j]=="nyanpass") c++;
}
if(c==n-1) ans.push_back(j+1);
}
if(ans.size()!=1) cout << -1 << endl;
else cout << ans[0] << endl;
return 0;
}