結果
| 問題 | No.773 コンテスト |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-20 01:52:50 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 57 ms / 2,000 ms |
| + 56µs | |
| コード長 | 830 bytes |
| 記録 | |
| コンパイル時間 | 1,629 ms |
| コンパイル使用メモリ | 94,964 KB |
| 実行使用メモリ | 42,584 KB |
| 最終ジャッジ日時 | 2026-09-14 18:56:41 |
| 合計ジャッジ時間 | 4,853 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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);
}
}