結果
| 問題 | No.3696 Betting Machine |
| コンテスト | |
| ユーザー |
simasima_71
|
| 提出日時 | 2026-09-09 22:02:01 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 1,624 bytes |
| 記録 | |
| コンパイル時間 | 2,039 ms |
| コンパイル使用メモリ | 345,036 KB |
| 実行使用メモリ | 10,036 KB |
| 最終ジャッジ日時 | 2026-09-09 22:02:13 |
| 合計ジャッジ時間 | 4,655 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 8 WA * 13 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/vector:67,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/functional:66,
from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:55,
from main.cpp:1:
In function '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = long long int*; _ForwardIterator = long long int*]',
inlined from 'constexpr _ForwardIterator std::__uninitialized_copy_a(_InputIterator, _Sentinel, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = long long int*; _Sentinel = long long int*; _ForwardIterator = long long int*; _Tp = long long int]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_uninitialized.h:635:32,
inlined from 'constexpr std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long long int; _Alloc = std::allocator<long long int>]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/vector.tcc:257:35,
inlined from 'int main()' at main.cpp:47:11:
/home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/bits/stl_uninitialized.h:273:31: warning: 'void* __builtin_memcpy(void*, const void*, long unsigned int)' writing between 1 and 8008 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
273 | __builtin_memcpy(std::__niter_base(__result),
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274 | std::__niter_base(__first),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
275 | __n * sizeof(_ValT));
| ~~~~~~~~~~~~~~~~~~~~
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@15/15.3.0/include/c++/15/x86_64-pc-linux-gnu/bits/c++
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using pl = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main(){
ll s,t,n;
cin>>s>>t>>n;
vl p(3);
vl a(3);
vl b(3);
rep(i,0,3){
cin>>p[i]>>a[i]>>b[i];
}
vector<ll> u(1001,0);
ll re=1000000000000000000;
rep(i,t,1001){
u[i]=re;
}
vl d;
rep(ar,0,n){
if(ar==n-1)d=u;
vl e(1001,0);
rep(i,0,1001){
ll mx=0;
rep(j,0,i+1){
ll zn=0;
rep(l,0,3){
ll er=i-j+(a[l]*j)/(b[l]);
if(er>=1000)zn+=u[1000]/100*p[l];
else zn+=u[er]/100*p[l];
}
mx=max(mx,zn);
}
e[i]=mx;
}
u=e;
}
ll r=u[s];
rep(i,0,8)r/=100;
cout<<r<<endl;
vl ans;
rep(j,1,s+1){
ll zn=0;
rep(l,0,3){
ll er=s-j+(a[l]*j)/(b[l]);
if(er>=1000)zn+=d[1000]/100*p[l];
else zn+=d[er]/100*p[l];
}
if(zn==u[s])ans.push_back(j);
}
cout<<ans.size()<<endl;
rep(i,0,ans.size()){
cout<<ans[i];
if(i==(ll)ans.size()-1)cout<<" ";
}
cout<<endl;
}
simasima_71