Submission #8611505
Source Code Expand
Copy
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) typedef pair<int, int> P; typedef long long ll; int main(){ ll a,b,x; cin >> a >> b >> x; ll mx = 10; ll ans = 0; for(ll i = 1;i<=10;i++){ ll tmp = x-b*i; ans = max(ans,min(mx-1,tmp/a)); mx*=10; } cout << min(ans,(ll)1e9) << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Buy an Integer |
User | octo |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 399 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
sample | sample01, sample02, sample03, sample04 |
All | border01, border02, border03, corner01, max01, max02, max03, min01, min02, rnd01, rnd02, rnd03, sample01, sample02, sample03, sample04 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
border01 | AC | 1 ms | 256 KB |
border02 | AC | 1 ms | 256 KB |
border03 | AC | 1 ms | 256 KB |
corner01 | AC | 1 ms | 256 KB |
max01 | AC | 1 ms | 256 KB |
max02 | AC | 1 ms | 256 KB |
max03 | AC | 1 ms | 256 KB |
min01 | AC | 1 ms | 256 KB |
min02 | AC | 1 ms | 256 KB |
rnd01 | AC | 1 ms | 256 KB |
rnd02 | AC | 1 ms | 256 KB |
rnd03 | AC | 1 ms | 256 KB |
sample01 | AC | 1 ms | 256 KB |
sample02 | AC | 1 ms | 256 KB |
sample03 | AC | 1 ms | 256 KB |
sample04 | AC | 1 ms | 256 KB |