結果

問題 No.239 にゃんぱすー
ユーザー kurokoji
提出日時 2016-03-29 11:48:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 989 bytes
コンパイル時間 1,471 ms
コンパイル使用メモリ 160,908 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-10-02 07:21:17
合計ジャッジ時間 2,530 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 25 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

// #define int long long

/* short */
#define pb push_back
#define print(Target) cout << Target << '\n'

/* REPmacro */
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REPS(i, a, n) for (int i = (a); i < (n); i++)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;

/* func */
inline bool is_uruu(int y) {return (y % 4 == 0 && (y % 100 != 0 || y % 400 == 0));}

/* const */
const int INF = INT_MAX;

signed main()
{
  ios::sync_with_stdio(false);
  int n; cin >> n;
  vector<bool> flg(n, false);
  
  REP(i, n){
    REP(j, n){
      string s;
      cin >> s;
      if (s == "nyanpass"){
        flg[j] = true;
      }
    }
  }
  int sum = 0;
  REP(i, n){
    sum += flg[i];
  }
  if (sum != 1){
    print("-1");
  }else {
    REP(i, n){
      if (flg[i]){
        print(i + 1);
        break;
      }
    }
  }
  
  return (0);
}
0