結果
問題 |
No.3068 Speedrun (Hard)
|
ユーザー |
![]() |
提出日時 | 2025-03-21 22:23:07 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 728 bytes |
コンパイル時間 | 2,041 ms |
コンパイル使用メモリ | 193,800 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 22:23:19 |
合計ジャッジ時間 | 10,184 ms |
ジャッジサーバーID (参考情報) |
judge7 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 RE * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define int long long signed main(){ int a,b,c,d,n,p,q,r,s,t; cin>>a>>b>>c>>d>>n>>p>>q>>r>>s>>t; for(int i=0;i<=a;i++)for(int j=0;j<=b;j++){ int lt = t-i*p-j*q; int ln = n-i-j; // x+y = ln; swap(t,s); swap(s,r); // sx+ty = lt; // sx+sy = s*ln; // y = (lt-s*ln)/(t-s) // x = ln-y int x,y; if(s == t){ x = min(c,lt); y = ln-x; } else{ y = (lt-s*ln)/(t-s); x = ln-y; } if(y*(t-s) != (lt-s*ln) || y < 0 || x < 0 || y > d || x > c){ swap(s,r); swap(t,s); continue; } cout<<i<<' '<<j<<' '<<x<<' '<<y<<endl; return 0; } assert(false); }