結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー butsurizukibutsurizuki
提出日時 2022-10-05 00:14:15
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 756 bytes
コンパイル時間 8,017 ms
コンパイル使用メモリ 336,208 KB
実行使用メモリ 394,140 KB
最終ジャッジ日時 2023-09-08 20:29:01
合計ジャッジ時間 30,725 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 312 ms
393,764 KB
testcase_01 AC 261 ms
393,920 KB
testcase_02 AC 258 ms
393,720 KB
testcase_03 AC 351 ms
393,800 KB
testcase_04 AC 353 ms
393,920 KB
testcase_05 AC 262 ms
393,800 KB
testcase_06 AC 279 ms
393,904 KB
testcase_07 AC 280 ms
393,796 KB
testcase_08 AC 265 ms
393,716 KB
testcase_09 AC 263 ms
393,712 KB
testcase_10 AC 262 ms
393,652 KB
testcase_11 AC 263 ms
393,808 KB
testcase_12 AC 271 ms
393,764 KB
testcase_13 AC 354 ms
393,736 KB
testcase_14 AC 352 ms
393,792 KB
testcase_15 AC 260 ms
393,896 KB
testcase_16 AC 281 ms
393,828 KB
testcase_17 AC 283 ms
393,604 KB
testcase_18 AC 274 ms
393,892 KB
testcase_19 AC 270 ms
393,704 KB
testcase_20 AC 271 ms
393,700 KB
testcase_21 AC 274 ms
393,760 KB
testcase_22 AC 265 ms
393,808 KB
testcase_23 AC 271 ms
393,840 KB
testcase_24 AC 267 ms
393,604 KB
testcase_25 AC 267 ms
393,796 KB
testcase_26 AC 266 ms
393,632 KB
testcase_27 AC 271 ms
393,936 KB
testcase_28 AC 352 ms
393,652 KB
testcase_29 AC 355 ms
393,628 KB
testcase_30 AC 259 ms
393,768 KB
testcase_31 AC 278 ms
393,904 KB
testcase_32 AC 279 ms
393,732 KB
testcase_33 AC 352 ms
393,624 KB
testcase_34 AC 349 ms
393,600 KB
testcase_35 AC 259 ms
393,760 KB
testcase_36 AC 280 ms
393,896 KB
testcase_37 AC 279 ms
393,716 KB
testcase_38 AC 273 ms
393,604 KB
testcase_39 AC 279 ms
393,604 KB
testcase_40 AC 266 ms
393,652 KB
testcase_41 AC 273 ms
393,604 KB
testcase_42 AC 262 ms
393,600 KB
testcase_43 AC 265 ms
393,604 KB
testcase_44 AC 263 ms
393,896 KB
testcase_45 AC 268 ms
393,708 KB
testcase_46 AC 278 ms
393,652 KB
testcase_47 AC 276 ms
393,920 KB
testcase_48 AC 350 ms
393,716 KB
testcase_49 AC 353 ms
393,704 KB
testcase_50 AC 257 ms
393,632 KB
testcase_51 AC 280 ms
393,732 KB
testcase_52 AC 280 ms
393,764 KB
testcase_53 AC 351 ms
393,760 KB
testcase_54 AC 267 ms
393,600 KB
testcase_55 AC 266 ms
393,816 KB
testcase_56 AC 262 ms
393,592 KB
testcase_57 AC 264 ms
393,800 KB
testcase_58 AC 264 ms
393,904 KB
testcase_59 AC 262 ms
393,916 KB
testcase_60 AC 260 ms
393,596 KB
testcase_61 AC 259 ms
393,776 KB
testcase_62 AC 262 ms
393,600 KB
testcase_63 AC 261 ms
393,704 KB
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
testcase_67 WA -
testcase_68 WA -
testcase_69 WA -
testcase_70 WA -
testcase_71 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

int main(){
  registerValidation();
  long long t=inf.readLong(-10000000ll,10000000ll);inf.readEoln();
  ensuref(t!=0,"t==0");
  long long x=inf.readLong(1ll,10000000ll);inf.readSpace();
  long long a=inf.readLong(x+1,10000000ll);inf.readEoln();
  long long y=inf.readLong(1ll,10000000ll);inf.readSpace();
  long long b=inf.readLong(1ll,10000000ll);inf.readEoln();
  inf.readEof();

  long long cent=25'000'000;
  vector<long long> dp(50'000'000,8e18);
  for(int i=cent;i<5e7;i++){dp[i]=i-cent;}
  for(int i=50'000'000-1;i>=b;i--){
    dp[i-b]=min(dp[i-b],dp[i]+y);
  }
  for(int i=0;i<50'000'000-a;i++){
    dp[i+a]=min(dp[i+a],dp[i]+x);
  }
  cout << dp[cent+t] << "\n";
  return 0;
}
0