結果
| 問題 | No.799 赤黒かーどげぇむ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-26 15:03:09 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 59 ms / 2,000 ms |
| コード長 | 737 bytes |
| 記録 | |
| コンパイル時間 | 3,926 ms |
| コンパイル使用メモリ | 82,420 KB |
| 実行使用メモリ | 41,808 KB |
| 最終ジャッジ日時 | 2026-05-18 12:06:30 |
| 合計ジャッジ時間 | 5,525 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
import java.io.*;
import java.util.Scanner;
public class Main_yukicoder799 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int d = sc.nextInt();
int ans = 0;
for (int i = a; i <= b; i++) {
if (i >= c && i <= d) {
ans += d - c;
} else {
ans += d - c + 1;
}
}
pr.println(ans);
}
// ---------------------------------------------------
public static void main(String[] args) {
sc = new Scanner(System.in);
pr = new Printer(System.out);
solve();
pr.close();
sc.close();
}
static class Printer extends PrintWriter {
Printer(OutputStream out) {
super(out);
}
}
}