結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2016-08-02 23:17:23 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 237 ms / 2,000 ms |
コード長 | 1,263 bytes |
コンパイル時間 | 5,782 ms |
コンパイル使用メモリ | 77,544 KB |
実行使用メモリ | 46,800 KB |
最終ジャッジ日時 | 2024-11-06 23:39:05 |
合計ジャッジ時間 | 12,336 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
package yukicoder;import java.util.Scanner;public class yuki239 {public static void main(String[] args) {// TODO Auto-generated method stubScanner scan = new Scanner(System.in);int count = scan.nextInt();String[][] strArr = new String [count][count];int[][] intFlg = new int[count][count];int ans = 0;int ans3 = 0;Boolean ans_flg = false;for (int i = 0; i < count; i++) {for (int j = 0; j < count; j++) {strArr[i][j] = scan.next();}}for (int i = 0; i < count; i++) {for (int j = 0; j < count; j++) {if ("nyanpass".equals(strArr[j][i])){intFlg[i][j] = 3;} else if("-".equals(strArr[j][i]) ){intFlg[i][j] = 2;} else{intFlg[i][j] = 1;}}}for (int i = 0; i < count; i++) {for (int j = 0; j < count; j++) {if(intFlg[i][j] == 3){ans += 3;} else if (intFlg[i][j] == 2){ans += 2;} else {ans = -1;}}if(ans >= 7 && ans_flg == false){ans3 = i + 1;ans_flg = true;} else if(ans >= 7 && ans_flg == true){ans3 = -1;break;}ans = 0;}if(ans_flg == true){System.out.print(ans3);}else {System.out.print(-1);}scan.close();}}