結果

問題 No.773 コンテスト
ユーザー yukiyuki
提出日時 2020-08-20 01:52:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 830 bytes
コンパイル時間 2,099 ms
コンパイル使用メモリ 76,240 KB
実行使用メモリ 41,488 KB
最終ジャッジ日時 2024-04-20 17:28:08
合計ジャッジ時間 5,883 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
40,744 KB
testcase_01 AC 116 ms
41,160 KB
testcase_02 AC 123 ms
41,488 KB
testcase_03 AC 113 ms
40,440 KB
testcase_04 AC 116 ms
39,844 KB
testcase_05 AC 114 ms
40,284 KB
testcase_06 AC 118 ms
39,980 KB
testcase_07 AC 110 ms
40,624 KB
testcase_08 AC 122 ms
41,316 KB
testcase_09 AC 120 ms
40,992 KB
testcase_10 AC 124 ms
41,208 KB
testcase_11 AC 124 ms
41,304 KB
testcase_12 AC 116 ms
40,432 KB
testcase_13 AC 112 ms
40,064 KB
testcase_14 AC 110 ms
39,972 KB
testcase_15 AC 134 ms
41,260 KB
testcase_16 AC 113 ms
40,232 KB
testcase_17 AC 121 ms
41,020 KB
testcase_18 AC 119 ms
41,120 KB
testcase_19 AC 113 ms
40,140 KB
testcase_20 AC 125 ms
41,416 KB
testcase_21 AC 124 ms
41,244 KB
testcase_22 AC 109 ms
40,132 KB
testcase_23 AC 118 ms
41,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner in = new Scanner(System.in);
        // 合宿の日程
        List<Integer> camp = Arrays.asList(23, 24, 25);
        final int camp_length = 3;
        
        int start = in.nextInt();
        int end = in.nextInt();
        List<Integer> trip = new ArrayList<>();
        
        // 旅行の日程
        for(int i=start; i<=end; i++){
            trip.add(i);
        }
        
        // 日程重複の確認
        int count = 0;
        int N = (camp_length > trip.size()) ? trip.size() : camp_length;

        for(int a : trip){
            if(camp.contains(a)){
                count++;
            }                
        }
        System.out.println(camp_length - count);
        
    }
}
0