Submission #168175

# Submission time Handle Problem Language Result Execution time Memory
168175 2019-12-11T19:31:59 Z rzbt Kotrljanje (COCI18_kotrljanje) C++14
126 / 140
1100 ms 20872 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(int 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("%d ",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:28:46: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
             for(auto x:lol[zc])printf("%d ",x);
                                              ^
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 7 ms 5368 KB Output is correct
2 Incorrect 81 ms 13412 KB Expected unsigned integer, but "-2147481659" found
# Verdict Execution time Memory Grader output
1 Correct 69 ms 10452 KB Output is correct
2 Correct 58 ms 9828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 10364 KB Output is correct
2 Correct 75 ms 10712 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 64 ms 10260 KB Output is correct
2 Correct 61 ms 10212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 68 ms 10496 KB Output is correct
2 Correct 131 ms 11844 KB Output is correct
3 Correct 79 ms 11300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 66 ms 10980 KB Output is correct
2 Correct 75 ms 11260 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 5880 KB Output is correct
2 Correct 433 ms 11508 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 971 ms 19076 KB Output is correct
2 Correct 667 ms 20692 KB Output is correct
3 Correct 1100 ms 20872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 115 ms 13128 KB Output is correct
2 Correct 547 ms 17436 KB Output is correct
3 Correct 75 ms 11192 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 11108 KB Output is correct
2 Correct 73 ms 10092 KB Output is correct