結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2018-06-03 21:20:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 695 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 32,128 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 09:27:52 |
合計ジャッジ時間 | 1,232 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <stdio.h> #include <string.h> int main(){ int N, i, j, cnt = 0, nyanpass = 0, rentyon; char str[100][100][31]; scanf("%d\n", &N); for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ scanf("%s ", str[i][j]); } } for(i = 0; i < N; i++){ for(j = 0; j < N; j++){ if(strcmp(str[j][i], "nyanpass") == 0){ nyanpass++; } if(nyanpass == N - 1){ cnt++; rentyon = i + 1; break; } } nyanpass = 0; } if(cnt == 1){ printf("%d\n", rentyon); }else{ printf("-1\n"); } return 0; }