Submission #2387666


Source Code Expand

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // 参加人数
    int participant = sc.nextInt();
    // 日数と余り
    int date = sc.nextInt();
    int add = sc.nextInt();
    // 食べた数
    int sum = add;
    for(int i = 0; i < participant ; i++){
      int num = sc.nextInt();
      int eat = 0;
      for(int j =0; j < date ; j++){
        if(j * num + 1 <= date){
          eat++;
        }else{
          break;
        }
      }
      sum = sum + eat;
    }
    System.out.println(sum);
  }
}

Submission Info

Submission Time
Task B - Chocolate
User fuu1214
Language Java7 (OpenJDK 1.7.0)
Score 200
Code Size 613 Byte
Status AC
Exec Time 112 ms
Memory 22612 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 12
Set Name Test Cases
Sample sample-01.txt, sample-02.txt, sample-03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, sample-01.txt, sample-02.txt, sample-03.txt
Case Name Status Exec Time Memory
01.txt AC 95 ms 17108 KB
02.txt AC 109 ms 20948 KB
03.txt AC 105 ms 17492 KB
04.txt AC 109 ms 20948 KB
05.txt AC 110 ms 22612 KB
06.txt AC 112 ms 21204 KB
07.txt AC 108 ms 19028 KB
08.txt AC 109 ms 19028 KB
09.txt AC 109 ms 19028 KB
sample-01.txt AC 94 ms 20820 KB
sample-02.txt AC 94 ms 20820 KB
sample-03.txt AC 95 ms 20820 KB