結果
問題 | No.37 遊園地のアトラクション |
ユーザー | 184 |
提出日時 | 2014-10-10 16:33:06 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 778 bytes |
コンパイル時間 | 1,241 ms |
コンパイル使用メモリ | 66,384 KB |
実行使用メモリ | 4,504 KB |
最終ジャッジ日時 | 2023-08-28 20:36:54 |
合計ジャッジ時間 | 2,309 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 1 ms
4,380 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | AC | 3 ms
4,380 KB |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 4 ms
4,376 KB |
testcase_17 | WA | - |
testcase_18 | AC | 4 ms
4,376 KB |
testcase_19 | WA | - |
testcase_20 | AC | 4 ms
4,376 KB |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | AC | 2 ms
4,380 KB |
testcase_24 | AC | 2 ms
4,376 KB |
testcase_25 | AC | 2 ms
4,380 KB |
testcase_26 | AC | 2 ms
4,380 KB |
testcase_27 | WA | - |
testcase_28 | AC | 1 ms
4,376 KB |
testcase_29 | WA | - |
testcase_30 | AC | 1 ms
4,376 KB |
ソースコード
#include <cstdlib> #include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <map> #include <vector> #include <queue> using namespace std; /* 184 //名前が 184 最強の解き方!!!いってみただけ。 no37 */ int main(){ int t,n; scanf("%d%d",&t,&n);//%d%d%d%d",&n,&v,&x,&y,&ax,&ay); int v[20],c[20]; for(int i=0;i<n;i++)scanf("%d",&c[i]); for(int i=0;i<n;i++)scanf("%d",&v[i]); int dp[100000]={}; dp[0]=1; int last=0; srand(1); int max=0; for(int i=0;i<1000;i++){ int cnt[20]={}; int cs=0; int r; int vl=0; while(cs<=t){ r=rand()%15; if(cs+c[r]>t)break; cs+=c[r]; vl+=v[r]>>cnt[r]++; } if(max<vl)max=vl; } printf("%d\n",max); return 0; }