結果
| 問題 | 
                            No.1343 Dividing Digit
                             | 
                    
| コンテスト | |
| ユーザー | 
                             xRS43BofaUEZ5gc
                         | 
                    
| 提出日時 | 2021-03-08 10:52:18 | 
| 言語 | Java  (openjdk 23)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 599 bytes | 
| コンパイル時間 | 3,446 ms | 
| コンパイル使用メモリ | 74,300 KB | 
| 実行使用メモリ | 59,772 KB | 
| 最終ジャッジ日時 | 2024-10-09 19:55:48 | 
| 合計ジャッジ時間 | 14,694 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 22 | 
ソースコード
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 k = sc.nextInt();
	    	int[] ai_Array = new int[n];
	    	for (int i = 0; i < n; i ++) {
	    		ai_Array[i] = sc.nextInt();
	    	}
	    	sc.close();
	    	double sum_all = 0;
	    	int sum_bit = 0;
	    	for (int i = n - 1; i >= 0; i -- ) {
	    		sum_all += ai_Array[i] * Math.pow(k , n - 1 - i);
	    		sum_bit += ai_Array[i];
	    	}
	    	System.out.println(sum_all%sum_bit );
	    	}
	    }
            
            
            
        
            
xRS43BofaUEZ5gc