結果
問題 |
No.773 コンテスト
|
ユーザー |
|
提出日時 | 2020-08-20 01:52:50 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 131 ms / 2,000 ms |
コード長 | 830 bytes |
コンパイル時間 | 2,334 ms |
コンパイル使用メモリ | 76,688 KB |
実行使用メモリ | 41,736 KB |
最終ジャッジ日時 | 2024-10-12 13:24:09 |
合計ジャッジ時間 | 6,425 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
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); } }