結果

問題 No.1003 サイコロの実装 (1)
ユーザー ika__siika__si
提出日時 2020-04-20 22:14:23
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 1,526 bytes
コンパイル時間 2,161 ms
コンパイル使用メモリ 74,324 KB
実行使用メモリ 41,780 KB
最終ジャッジ日時 2024-04-16 00:56:34
合計ジャッジ時間 6,889 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
41,516 KB
testcase_01 AC 135 ms
41,292 KB
testcase_02 AC 135 ms
41,316 KB
testcase_03 AC 134 ms
41,332 KB
testcase_04 AC 133 ms
41,624 KB
testcase_05 AC 136 ms
41,408 KB
testcase_06 AC 135 ms
41,736 KB
testcase_07 AC 131 ms
41,764 KB
testcase_08 AC 134 ms
41,640 KB
testcase_09 AC 138 ms
41,408 KB
testcase_10 AC 140 ms
41,240 KB
testcase_11 AC 139 ms
41,764 KB
testcase_12 AC 140 ms
41,600 KB
testcase_13 AC 139 ms
41,364 KB
testcase_14 AC 139 ms
41,780 KB
testcase_15 AC 137 ms
41,648 KB
testcase_16 AC 140 ms
41,336 KB
testcase_17 AC 138 ms
41,132 KB
testcase_18 AC 136 ms
41,496 KB
testcase_19 AC 138 ms
41,652 KB
testcase_20 AC 140 ms
41,508 KB
testcase_21 AC 141 ms
41,564 KB
testcase_22 AC 142 ms
41,340 KB
testcase_23 AC 142 ms
41,440 KB
testcase_24 AC 139 ms
41,668 KB
testcase_25 AC 134 ms
41,708 KB
testcase_26 AC 138 ms
41,428 KB
testcase_27 AC 141 ms
41,624 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.math.*;

public class Main {

  // int n = sc.nextInt();
  // long m = sc.nextLong();
  // String s = sc.next();
  // double d = sc.nextDouble();

  // // 最大公約数
  // public static long gcd (long m,long n) {
  //   if (m < n) return gcd(n,m);
  //   if (n == 0) return m;
  //   return gcd(n,m%n);
  // }
  //
  // // 最小公倍数
  // public static long lcm (long m,long n) {
  //   return m*n/gcd(m,n);
  // }
  //
  // // 素数判定
  // public static boolean isPrime (long n) {
  //   if (n == 2) return true;
  //   if (n < 2 || n%2 == 0) return false;
  //   double d = Math.sqrt(n);
  //   for (int i = 3; i <= d; i+=2) {
  //     if (n%i == 0) {
  //       return false;
  //     }
  //   }
  //   return true;
  // }
  //
  // public static final long gcd3(long[] param) {
  //   int len = param.length;
  //   long g = gcd(param[0], param[1]);    //gcd(a, b) は以前作ったもの
  //   for (int i = 1; i < len - 1; i++) {
  //       g = gcd(g, param[i + 1]);       //gcd(a, b) は以前作ったもの
  //   }
  //   return g;
  // }

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();

    int[] data = new int[7];

    for (int i = 0; i < n; i++) {
      data[(i%6)+1]++;
    }

    for (int i = 1; i < 7; i++) {
      for (int j = i+1; j < 7; j++) {
        if (data[i] != data[j]) {
          System.out.println("No");
          return;
        }
      }
    }

    System.out.println("Yes");

  }

}
0