結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー xRS43BofaUEZ5gc
提出日時 2021-03-05 11:05:25
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 1,018 bytes
コンパイル時間 3,395 ms
コンパイル使用メモリ 77,468 KB
実行使用メモリ 56,052 KB
最終ジャッジ日時 2024-10-06 07:37:44
合計ジャッジ時間 14,230 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 46
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class HelloWorld {

	    public static void main(String[] args) throws Exception {

	    	Scanner sc = new Scanner(System.in);
	    	int n = sc.nextInt();
	    	int[] ai = new int[n];
	    	int[][] bij = new int[n][n];
	    	for (int i = 0; i < n; i ++) {
	    		ai[i] = sc.nextInt();
	    	}
	    	for (int i = 0; i < n; i ++) {
	    		for (int j = 0; j < n; j ++) {
	    			bij[i][j] = sc.nextInt();
	    		}
	    	}
	    	sc.close();

	    	int[] max_score_Array = new int[n];
	    	int[][] indexs_strArray = new int[n][n];

	    	for (int i = 0; i < n; i++) {
	    		max_score_Array[i] += ai[i];

	    		for (int j = 0; j < n; j ++) {
	    			if (i == j) {
	    				continue;
	    			}
	    			if(ai[j] + bij[i][j] > 0) {
	    				max_score_Array[i] = max_score_Array[i] + ai[j] +bij[i][j];
	    				indexs_strArray[i][j] = 1;
	    			}
	    			
	    			
	    		}

	    	}

	    	for (int i = 0; i < n; i++) {
	    	System.out.println(max_score_Array[i]);
	    	}
	    	}

	    }
0