結果
| 問題 |
No.239 にゃんぱすー
|
| ユーザー |
|
| 提出日時 | 2015-10-04 10:47:44 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 948 bytes |
| コンパイル時間 | 469 ms |
| コンパイル使用メモリ | 65,576 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-19 19:30:12 |
| 合計ジャッジ時間 | 1,802 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:29:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
29 | scanf("%d",&n);
| ~~~~~^~~~~~~~~
main.cpp:31:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
31 | rep(j,n) scanf("%s",a[i][j]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>
#include <cstdio>
using namespace std;
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始! */
/* 入力終了! */
int main(void)
{
int i,j,k,l;
int n;
static char a[100][100][35];
char now_renchon;
int renchon = -1;
scanf("%d",&n);
rep(i,n) {
rep(j,n) scanf("%s",a[i][j]);
}
for(j=0;j<n;j++) {
now_renchon = 1;
for(i=0;i<n;i++) {
if(i == j) continue;
if(strcmp(a[i][j],"nyanpass") != 0) {
now_renchon = 0;break;
}
}
if(now_renchon && renchon > -1) {
renchon = -1; break;
}
if(now_renchon && renchon == -1) {
renchon= j+1;
}
}
printf("%d\n",renchon);
return 0;
}