Submission #8611881


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

#define pb push_back
#define mp make_pair
#define eb emplace_back


typedef long long ll;
typedef long double ld;


const ll inf = 2e9;
const ll base = 998244353;
ll mod = 1e9 + 7;



int main() {
//    srand(time(NULL));
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
//    std::random_device rd;
//    std::mt19937 g(rd());
    auto start = clock();


    ll a, b, x; cin >> a >> b >> x;

    ll cur = 1;
    ll cnt = 1;
    while(cur * a + cnt * b <= x && cnt < 12) {
        cur *= 10;
        ++cnt;
    }
    cur /= 10;
    cnt -= 1;
    if (cnt > 10) {
        cout << 1000000000LL << endl;
        return 0;
    }

    if (cur == 0) {
        cout << 0;
        return 0;
    }

    x -= b * cnt;
    x /= a;
    cout << min(x, 1000000000LL) << endl;

    std::cerr << double(clock() - start) / CLOCKS_PER_SEC << std::endl;
    return 0;
}

Submission Info

Submission Time
Task C - Buy an Integer
User PuRpLe_FoReVeR
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1056 Byte
Status WA
Exec Time 1 ms
Memory 256 KB

Judge Result

Set Name sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 4
AC × 15
WA × 1
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 WA 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