結果

問題 No.239 にゃんぱすー
ユーザー siguma323
提出日時 2016-05-20 16:48:31
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 886 bytes
コンパイル時間 875 ms
コンパイル使用メモリ 92,492 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-06 11:29:06
合計ジャッジ時間 2,049 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <utility>
#include <list>
#include <functional>
#include <queue>
#include <map>
#include <iterator>
#include <iomanip>
#include <complex>
using namespace std;

using ull = unsigned long long;
using ll = long long;


int main()
{
  int n;
  cin >> n;
  vector<vector<string>> board(n,vector<string>(n));

  for(auto&& y : board)
    for(auto&& x : y)
      cin >> x;

  int result = -1;

  for(int i = 0; i < n; ++i)
  {
    bool check = true;
    for(int j = 0; j < n; ++j)
    {
      check &= (board.at(j).at(i) == "nyanpass" || board.at(j).at(i) == "-");
    }

    if(check && result == -1)
      result = i+1;
    else if(check)
    {
      cout << -1 << endl;
      return 0;
    }
    
  }

  cout << result << endl;
}
0