結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2017-11-15 23:55:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 728 ms |
コンパイル使用メモリ | 84,608 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 04:04:34 |
合計ジャッジ時間 | 1,729 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS#include <iostream>#include <cstdio>#include <vector>#include <map>#include <set>#include <algorithm>#include <string>#include <cstdlib>#include <stack>#include <queue>#include <cmath>#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)#define repp(i,j,k) for(int i=j;i>=k;i--)#define Sort(x) sort(x.begin(),x.end());#define ll long longint mod=1e9+7;const int INF = 1e9;using namespace std;int main(void) {int n;cin >> n;vector<bool> v(n, true);rep(i, 0, n) {rep(j, 0, n) {string s;cin >> s;if (s != "nyanpass" && s!="-") v[j] = false;}}int judge = 0,ans;rep(i, 0, n) {if (v[i]) {judge++;ans = i + 1;}}if (judge==1) cout << ans << endl;else cout << -1 << endl;return 0;}