結果
問題 | No.740 幻の木 |
ユーザー | Beat7501 |
提出日時 | 2018-10-05 21:36:57 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 351 bytes |
コンパイル時間 | 2,430 ms |
コンパイル使用メモリ | 74,156 KB |
実行使用メモリ | 41,324 KB |
最終ジャッジ日時 | 2024-04-20 17:04:06 |
合計ジャッジ時間 | 3,728 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 114 ms
40,252 KB |
testcase_01 | AC | 112 ms
40,136 KB |
testcase_02 | WA | - |
testcase_03 | AC | 103 ms
40,308 KB |
testcase_04 | WA | - |
testcase_05 | AC | 119 ms
40,836 KB |
testcase_06 | WA | - |
testcase_07 | AC | 113 ms
41,144 KB |
testcase_08 | AC | 107 ms
40,284 KB |
ソースコード
import java.util.*; class Main{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int p = sc.nextInt(); int q = sc.nextInt(); int a = 0; while(n > 0){ a++; if(a >= p && a <= p + q - 1){ n -= 2*m; }else{ n -=m; } } System.out.print(a); } }