Submission #1371618
Source Code Expand
#include <bits/stdc++.h> #define ll long long #define INF INT_MAX/3 #define debug(x) cout<<#x<<": "<<x<<endl using namespace std; int main(void){ // Here your code ! ll int N,H; cin >> N >> H; ll int A,B,C,D,E; cin >> A >> B >> C >> D >> E; ll int now=INF,min=INF; ll int CB,CD; const ll int need = N * E - H ; B = B + E; D = D + E; CB = need / B + 1 ; CB++; while(1){ if(now < min){min = now;} if(CB <= 0){break;} CB--; CD=(need - CB * B)/D + 1; now = CB * A + CD * C; } cout << min << "\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - A |
User | shamoji101 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 659 Byte |
Status | WA |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | A.txt, B.txt, C.txt, D.txt, E.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
A.txt | WA | 1 ms | 256 KB |
B.txt | WA | 1 ms | 256 KB |
C.txt | WA | 1 ms | 256 KB |
D.txt | WA | 1 ms | 256 KB |
E.txt | WA | 1 ms | 256 KB |