結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
kohaku_kohaku
|
| 提出日時 | 2016-11-12 22:01:48 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 124 ms / 2,000 ms |
| + 714µs | |
| コード長 | 881 bytes |
| 記録 | |
| コンパイル時間 | 1,526 ms |
| コンパイル使用メモリ | 85,844 KB |
| 実行使用メモリ | 49,060 KB |
| 最終ジャッジ日時 | 2026-10-11 12:24:04 |
| 合計ジャッジ時間 | 6,561 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 34 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = Integer.parseInt( sc.nextLine() );
int [] count = new int [N];
for(int i=0; i<N; i++){
String tem = sc.nextLine();
String [] arr = tem.split(" ");
for(int j=0; j<N; j++){
if( "nyanpass".equals(arr[j]) ){
count[j]++;
}
}
}
int f = 0;
for(int i=0; i<N; i++){
if(count[i]==N-1){
f++;
}
}
if(f!=1){
System.out.println(-1);
}else{
for(int i=0; i<N; i++){
if(count[i]==N-1){
System.out.println(i+1);
break;
}
}
}
}
}
kohaku_kohaku