結果
問題 | No.648 お や す み |
ユーザー | silviasetitech |
提出日時 | 2020-03-15 16:17:44 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,259 bytes |
コンパイル時間 | 2,769 ms |
コンパイル使用メモリ | 79,000 KB |
実行使用メモリ | 54,452 KB |
最終ジャッジ日時 | 2024-05-03 22:25:29 |
合計ジャッジ時間 | 16,050 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 132 ms
41,096 KB |
testcase_01 | AC | 130 ms
41,240 KB |
testcase_02 | AC | 128 ms
41,084 KB |
testcase_03 | AC | 117 ms
40,200 KB |
testcase_04 | AC | 135 ms
41,648 KB |
testcase_05 | AC | 134 ms
41,232 KB |
testcase_06 | AC | 133 ms
41,184 KB |
testcase_07 | AC | 133 ms
41,600 KB |
testcase_08 | AC | 129 ms
41,352 KB |
testcase_09 | AC | 131 ms
41,404 KB |
testcase_10 | AC | 133 ms
41,320 KB |
testcase_11 | AC | 130 ms
41,088 KB |
testcase_12 | AC | 141 ms
41,248 KB |
testcase_13 | AC | 138 ms
41,224 KB |
testcase_14 | AC | 136 ms
41,204 KB |
testcase_15 | AC | 134 ms
41,268 KB |
testcase_16 | AC | 135 ms
41,388 KB |
testcase_17 | AC | 119 ms
40,164 KB |
testcase_18 | AC | 137 ms
41,236 KB |
testcase_19 | AC | 133 ms
41,484 KB |
testcase_20 | AC | 135 ms
41,044 KB |
testcase_21 | AC | 132 ms
41,304 KB |
testcase_22 | AC | 132 ms
41,232 KB |
testcase_23 | AC | 131 ms
40,880 KB |
testcase_24 | AC | 129 ms
41,396 KB |
testcase_25 | AC | 130 ms
41,400 KB |
testcase_26 | AC | 119 ms
40,180 KB |
testcase_27 | AC | 134 ms
41,352 KB |
testcase_28 | AC | 141 ms
41,292 KB |
testcase_29 | AC | 139 ms
41,132 KB |
testcase_30 | AC | 130 ms
41,024 KB |
testcase_31 | AC | 132 ms
41,276 KB |
testcase_32 | AC | 132 ms
41,104 KB |
testcase_33 | AC | 117 ms
39,852 KB |
testcase_34 | AC | 134 ms
41,124 KB |
testcase_35 | AC | 131 ms
41,380 KB |
testcase_36 | AC | 129 ms
41,128 KB |
testcase_37 | AC | 138 ms
41,084 KB |
testcase_38 | AC | 136 ms
41,304 KB |
testcase_39 | AC | 131 ms
41,260 KB |
testcase_40 | AC | 122 ms
40,192 KB |
testcase_41 | AC | 131 ms
41,020 KB |
testcase_42 | AC | 130 ms
41,792 KB |
testcase_43 | AC | 129 ms
41,176 KB |
testcase_44 | AC | 128 ms
40,988 KB |
testcase_45 | AC | 117 ms
40,084 KB |
testcase_46 | AC | 130 ms
40,908 KB |
testcase_47 | AC | 130 ms
41,268 KB |
testcase_48 | AC | 116 ms
39,856 KB |
testcase_49 | AC | 128 ms
41,440 KB |
testcase_50 | AC | 116 ms
40,220 KB |
testcase_51 | AC | 136 ms
41,164 KB |
testcase_52 | AC | 131 ms
41,420 KB |
testcase_53 | AC | 130 ms
41,348 KB |
testcase_54 | AC | 132 ms
41,096 KB |
testcase_55 | AC | 130 ms
41,176 KB |
testcase_56 | AC | 133 ms
41,172 KB |
testcase_57 | AC | 133 ms
41,124 KB |
testcase_58 | AC | 133 ms
41,388 KB |
testcase_59 | AC | 131 ms
40,896 KB |
testcase_60 | AC | 137 ms
41,140 KB |
testcase_61 | AC | 129 ms
41,420 KB |
testcase_62 | AC | 135 ms
40,900 KB |
testcase_63 | AC | 132 ms
41,016 KB |
testcase_64 | AC | 117 ms
39,976 KB |
testcase_65 | AC | 131 ms
41,288 KB |
testcase_66 | AC | 118 ms
40,216 KB |
testcase_67 | AC | 134 ms
41,484 KB |
testcase_68 | AC | 133 ms
41,228 KB |
testcase_69 | AC | 130 ms
41,576 KB |
testcase_70 | AC | 128 ms
41,224 KB |
testcase_71 | AC | 128 ms
41,224 KB |
testcase_72 | AC | 115 ms
40,164 KB |
testcase_73 | AC | 131 ms
41,180 KB |
testcase_74 | AC | 129 ms
41,008 KB |
testcase_75 | AC | 133 ms
41,440 KB |
testcase_76 | AC | 133 ms
41,096 KB |
testcase_77 | WA | - |
testcase_78 | WA | - |
testcase_79 | WA | - |
testcase_80 | WA | - |
testcase_81 | WA | - |
testcase_82 | AC | 133 ms
41,488 KB |
testcase_83 | AC | 133 ms
40,988 KB |
ソースコード
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author silviase */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); sheepSleep solver = new sheepSleep(); solver.solve(1, in, out); out.close(); } static class sheepSleep { public void solve(int testNumber, Scanner in, PrintWriter out) { long n = in.nextLong(); long ng = -1; long ok = (int) 1e9; while (Math.abs(ok - ng) > 1) { long mid = (ok + ng) / 2; if (mid * (mid + 1) / 2 >= n) { ok = mid; } else { ng = mid; } } if (ok * (ok + 1) / 2 == n) { out.println("YES"); out.println(ok); } else { out.println("NO"); } } } }