結果

問題 No.1003 サイコロの実装 (1)
ユーザー ika__siika__si
提出日時 2020-04-20 22:13:51
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,602 bytes
コンパイル時間 2,241 ms
コンパイル使用メモリ 74,124 KB
実行使用メモリ 41,884 KB
最終ジャッジ日時 2024-04-16 00:56:25
合計ジャッジ時間 7,055 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

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++) {
      System.out.println(data[i]);
    }

    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