結果
問題 | No.740 幻の木 |
ユーザー | kusagame12 |
提出日時 | 2023-11-09 17:07:52 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 956 bytes |
コンパイル時間 | 2,452 ms |
コンパイル使用メモリ | 74,284 KB |
実行使用メモリ | 57,984 KB |
最終ジャッジ日時 | 2023-11-09 17:08:07 |
合計ジャッジ時間 | 4,193 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 123 ms
57,984 KB |
testcase_01 | AC | 122 ms
57,840 KB |
testcase_02 | AC | 123 ms
57,824 KB |
testcase_03 | AC | 122 ms
57,696 KB |
testcase_04 | AC | 137 ms
57,952 KB |
testcase_05 | AC | 125 ms
57,840 KB |
testcase_06 | WA | - |
testcase_07 | AC | 121 ms
57,688 KB |
testcase_08 | AC | 122 ms
57,948 KB |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int p = sc.nextInt(); int q = sc.nextInt(); int ans = 0; while(n > 0){ int season = q; for(int i = 1 ; i <= 12 ; i++){ if(i == p){ while(season > 0){ n -= 2 * m; ans++; season--; i++; if(n <= 0){ break; } } } else { n -= m; ans++; } if(n <= 0){ break; } } } System.out.println(ans); } }