結果
| 問題 |
No.3068 Speedrun (Hard)
|
| コンテスト | |
| ユーザー |
umezo
|
| 提出日時 | 2025-03-22 02:51:36 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 964 bytes |
| コンパイル時間 | 3,944 ms |
| コンパイル使用メモリ | 274,400 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-22 02:51:52 |
| 合計ジャッジ時間 | 15,204 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 30 WA * 2 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;
template <class T> using V=vector<T>;
template <class T> using VV=V<V<T>>;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll a,b,c,d,n,p,q,r,s,t;
cin>>a>>b>>c>>d>>n>>p>>q>>r>>s>>t;
if(r==s){
for(int x=0;x<=a;x++){
for(int y=0;y<=b;y++){
if((t-x*p-y*q)%r!=0) continue;
ll tmp=(t-x*p-y*q)/r;
if(tmp<0 || tmp>c+d) continue;
cout<<x<<" "<<y<<" "<<c<<" "<<tmp-c<<endl;
return 0;
}
}
}
else{
for(int x=0;x<=a;x++){
for(int y=0;y<=b;y++){
ll e=t-x*p-y*q-s*(n-x-y);
if(e%(r-s)!=0) continue;
ll z=e/(r-s);
if(z<0 || z>c) continue;
ll w=n-x-y-z;
if(w<0 || w>d) continue;
cout<<x<<" "<<y<<" "<<z<<" "<<w<<endl;
return 0;
}
}
}
return 0;
}
umezo