Submission #143824

# Submission time Handle Problem Language Result Execution time Memory
143824 2019-08-15T09:30:45 Z nicolaalexandra Kotrljanje (COCI18_kotrljanje) C++14
140 / 140
1136 ms 39972 KB
#include <iostream>
#include <vector>
using namespace std;

//ifstream cin ("date.in");
//ofstream cout ("date.out");
int c,d,b,m;
vector <long long> v[1000000];
int main (){

    cin>>c>>d>>b>>m;
    for (long long nr=0;;nr+=(b-1)){
        long long val = 1LL*c*nr+d;
        long long aux = val;
        int sum = 0;
        while (aux){
            sum += aux%b;
            aux /= b;
        }
        v[sum].push_back(nr);
        if (v[sum].size() == m){
            for (int i=0;i<v[sum].size();i++)
                cout<<v[sum][i]<<" ";
            return 0;
        }}


    return 0;
}

Compilation message

kotrljanje.cpp: In function 'int main()':
kotrljanje.cpp:21:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (v[sum].size() == m){
             ~~~~~~~~~~~~~~^~~~
kotrljanje.cpp:22:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int i=0;i<v[sum].size();i++)
                          ~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 17 ms 24056 KB Output is correct
2 Correct 103 ms 30436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 85 ms 28692 KB Output is correct
2 Correct 79 ms 29284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 78 ms 28772 KB Output is correct
2 Correct 82 ms 29416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 83 ms 29596 KB Output is correct
2 Correct 89 ms 29304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 84 ms 29668 KB Output is correct
2 Correct 156 ms 30236 KB Output is correct
3 Correct 103 ms 29644 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 97 ms 30020 KB Output is correct
2 Correct 86 ms 29588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 60 ms 24696 KB Output is correct
2 Correct 469 ms 30556 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 997 ms 37724 KB Output is correct
2 Correct 689 ms 39464 KB Output is correct
3 Correct 1136 ms 39972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 146 ms 31036 KB Output is correct
2 Correct 577 ms 35908 KB Output is correct
3 Correct 96 ms 30080 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 92 ms 29436 KB Output is correct
2 Correct 83 ms 28776 KB Output is correct