結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
d_sei
|
| 提出日時 | 2019-08-26 20:19:58 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 2,000 ms |
| コード長 | 684 bytes |
| コンパイル時間 | 818 ms |
| コンパイル使用メモリ | 87,348 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 02:12:24 |
| 合計ジャッジ時間 | 1,998 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long int lont;
int main() {
int N;
cin >> N;
vector<vector<string>>vec(N, vector<string>(N));
for (int ia = 0; ia < N; ia++) {
for (int ib = 0; ib < N; ib++) {
cin >> vec.at(ia).at(ib);
}
}
vector<int>veca(N);
for (int ic = 0; ic < N; ic++) {
for (int id = 0; id < N; id++) {
if (vec.at(id).at(ic) == "nyanpass") {
veca.at(ic)++;
}
}
}
int cnt = 0;
int IE;
for (int ie = 0; ie < N; ie++) {
if (veca.at(ie) == N - 1) {
cnt++;
IE = ie;
}
}
if (cnt == 1) {
cout << IE+1 << endl;
}
else {
cout << -1 << endl;
}
}
d_sei