結果

問題 No.239 にゃんぱすー
ユーザー ちよちゃんちよちゃん
提出日時 2016-08-02 23:17:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 244 ms / 2,000 ms
コード長 1,263 bytes
コンパイル時間 3,707 ms
コンパイル使用メモリ 77,784 KB
実行使用メモリ 46,912 KB
最終ジャッジ日時 2024-04-24 15:09:49
合計ジャッジ時間 12,209 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,284 KB
testcase_01 AC 133 ms
41,288 KB
testcase_02 AC 129 ms
41,108 KB
testcase_03 AC 136 ms
41,172 KB
testcase_04 AC 134 ms
41,124 KB
testcase_05 AC 132 ms
41,276 KB
testcase_06 AC 133 ms
41,264 KB
testcase_07 AC 136 ms
41,296 KB
testcase_08 AC 139 ms
41,224 KB
testcase_09 AC 148 ms
41,516 KB
testcase_10 AC 153 ms
41,652 KB
testcase_11 AC 172 ms
41,416 KB
testcase_12 AC 176 ms
42,056 KB
testcase_13 AC 181 ms
42,248 KB
testcase_14 AC 180 ms
42,168 KB
testcase_15 AC 185 ms
42,120 KB
testcase_16 AC 183 ms
42,688 KB
testcase_17 AC 193 ms
42,668 KB
testcase_18 AC 197 ms
43,204 KB
testcase_19 AC 200 ms
43,168 KB
testcase_20 AC 202 ms
43,944 KB
testcase_21 AC 207 ms
43,980 KB
testcase_22 AC 215 ms
44,580 KB
testcase_23 AC 218 ms
44,948 KB
testcase_24 AC 233 ms
46,620 KB
testcase_25 AC 228 ms
46,496 KB
testcase_26 AC 232 ms
46,912 KB
testcase_27 AC 141 ms
41,548 KB
testcase_28 AC 165 ms
41,376 KB
testcase_29 AC 180 ms
41,744 KB
testcase_30 AC 182 ms
42,112 KB
testcase_31 AC 191 ms
42,820 KB
testcase_32 AC 192 ms
43,204 KB
testcase_33 AC 215 ms
43,408 KB
testcase_34 AC 215 ms
44,692 KB
testcase_35 AC 234 ms
46,816 KB
testcase_36 AC 244 ms
46,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class yuki239 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner 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();

	}

}
0