結果
問題 |
No.3068 Speedrun (Hard)
|
ユーザー |
![]() |
提出日時 | 2025-03-21 22:18:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 707 bytes |
コンパイル時間 | 1,810 ms |
コンパイル使用メモリ | 192,604 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 22:18:53 |
合計ジャッジ時間 | 9,021 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 31 WA * 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; } }