結果
| 問題 | No.239 にゃんぱすー |
| コンテスト | |
| ユーザー |
len_prog
|
| 提出日時 | 2016-06-15 11:56:07 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 193 ms / 2,000 ms |
| コード長 | 969 bytes |
| 記録 | |
| コンパイル時間 | 1,688 ms |
| コンパイル使用メモリ | 82,568 KB |
| 実行使用メモリ | 47,560 KB |
| 最終ジャッジ日時 | 2026-04-25 20:04:30 |
| 合計ジャッジ時間 | 7,681 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int N = scan.nextInt();
String[][] greetArr = new String[N][N];
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
greetArr[i][j] = scan.next();
}
}
boolean isFindRenchon = false;
boolean notNyanpassSay = false;
int renchonCount = 0;
int renchonDiscoverPos = -1;
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++){
if(greetArr[j][i].equals("-")){
//何もしない
}else if(greetArr[j][i].equals("nyanpass")){
if(!isFindRenchon){
renchonDiscoverPos = i;
}
}else{
notNyanpassSay = true;
}
}
if(!notNyanpassSay){
renchonCount++;
isFindRenchon = true;
}
notNyanpassSay = false;
}
if(renchonCount == 1 && isFindRenchon){
System.out.println(renchonDiscoverPos + 1);
}else{
System.out.println(-1);
}
scan.close();
}
}
len_prog