結果
問題 | No.239 にゃんぱすー |
ユーザー |
|
提出日時 | 2017-11-03 20:29:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 568 bytes |
コンパイル時間 | 1,750 ms |
コンパイル使用メモリ | 171,992 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 15:47:00 |
合計ジャッジ時間 | 3,162 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 2 |
other | AC * 16 WA * 17 |
ソースコード
#include<bits/stdc++.h> #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) using namespace std; int main() { int n; cin >> n; string s[100][100]; rep(i,0,n){ rep(j,0,n){ cin >> s[i][j]; } } set<int> st; rep(i,0,n){ int cnt{0}; rep(j,0,n){ if(s[j][i] == "nyanpss"){ cnt++; } } if(cnt == n - 1){ st.insert(i); } } cout << (st.size() == 1 ? *begin(st) + 1 : -1) << endl; }