結果

問題 No.1219 Mancala Combo
ユーザー tentententen
提出日時 2023-11-16 17:21:15
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,876 bytes
コンパイル時間 2,555 ms
コンパイル使用メモリ 87,540 KB
実行使用メモリ 61,748 KB
最終ジャッジ日時 2023-11-16 17:21:26
合計ジャッジ時間 8,351 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
53,992 KB
testcase_01 AC 52 ms
54,000 KB
testcase_02 AC 52 ms
54,012 KB
testcase_03 AC 51 ms
54,000 KB
testcase_04 AC 53 ms
53,988 KB
testcase_05 AC 52 ms
53,992 KB
testcase_06 AC 52 ms
53,988 KB
testcase_07 AC 53 ms
53,996 KB
testcase_08 AC 53 ms
53,988 KB
testcase_09 AC 52 ms
53,992 KB
testcase_10 AC 51 ms
53,988 KB
testcase_11 AC 52 ms
52,012 KB
testcase_12 AC 52 ms
53,988 KB
testcase_13 AC 52 ms
54,008 KB
testcase_14 AC 52 ms
54,000 KB
testcase_15 AC 51 ms
53,984 KB
testcase_16 AC 51 ms
53,980 KB
testcase_17 AC 197 ms
57,392 KB
testcase_18 AC 207 ms
59,280 KB
testcase_19 AC 190 ms
58,864 KB
testcase_20 AC 208 ms
59,188 KB
testcase_21 AC 182 ms
57,128 KB
testcase_22 AC 200 ms
59,372 KB
testcase_23 AC 234 ms
61,612 KB
testcase_24 AC 188 ms
58,740 KB
testcase_25 AC 215 ms
59,444 KB
testcase_26 AC 206 ms
59,248 KB
testcase_27 AC 229 ms
61,748 KB
testcase_28 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        int[] values = new int[n + 1];
        for (int i = 1; i <= n; i++) {
            values[i] = sc.nextInt();
        }
        int count = 0;
        for (int i = n; i >= 1; i--) {
            if ((count + values[i]) % i == 0) {
                count += (count + values[i]) / i;
            } else {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}
class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}
0