Submission #168177

# Submission time Handle Problem Language Result Execution time Memory
168177 2019-12-11T19:34:49 Z rzbt Kotrljanje (COCI18_kotrljanje) C++14
140 / 140
1104 ms 20768 KB
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define MAXN 200005
typedef long long ll;


using namespace std;

ll c,d,b,m;
vector<ll > lol[MAXN];
int main()
{

    scanf("%lld %lld %lld %lld",&c,&d,&b,&m);
    for(ll i=1;;i+=(b-1)){
        ll tren=d+i*c;
        ll zc=0;
        while(tren>0){
            zc+=tren%b;
            tren/=b;
        }
        lol[zc].pb(i);
        if(lol[zc].size()>=m){
            for(auto x:lol[zc])printf("%lld ",x);
            return 0;
        }
    }

    return 0;
}

Compilation message

kotrljanje.cpp: In function 'int main()':
kotrljanje.cpp:27:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if(lol[zc].size()>=m){
            ~~~~~~~~~~~~~~^~~
kotrljanje.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%lld %lld %lld %lld",&c,&d,&b,&m);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 5112 KB Output is correct
2 Correct 84 ms 11736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 10452 KB Output is correct
2 Correct 56 ms 9828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 10352 KB Output is correct
2 Correct 70 ms 10704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 10260 KB Output is correct
2 Correct 61 ms 10188 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 10460 KB Output is correct
2 Correct 132 ms 11836 KB Output is correct
3 Correct 80 ms 11172 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 66 ms 10980 KB Output is correct
2 Correct 77 ms 11260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 42 ms 5880 KB Output is correct
2 Correct 433 ms 11412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 970 ms 19044 KB Output is correct
2 Correct 665 ms 20768 KB Output is correct
3 Correct 1104 ms 20740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 122 ms 13108 KB Output is correct
2 Correct 556 ms 17344 KB Output is correct
3 Correct 79 ms 11192 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 11108 KB Output is correct
2 Correct 74 ms 10216 KB Output is correct