답안 #168176

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
168176 2019-12-11T19:32:40 Z rzbt Kotrljanje (COCI18_kotrljanje) C++14
126 / 140
1098 ms 20848 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("%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);
     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 7 ms 5112 KB Output is correct
2 Incorrect 82 ms 11732 KB Expected unsigned integer, but "-2147481659" found
# 결과 실행 시간 메모리 Grader output
1 Correct 68 ms 10456 KB Output is correct
2 Correct 56 ms 9700 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 68 ms 10352 KB Output is correct
2 Correct 70 ms 10708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 10256 KB Output is correct
2 Correct 60 ms 10212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 67 ms 10384 KB Output is correct
2 Correct 130 ms 11732 KB Output is correct
3 Correct 78 ms 11296 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 65 ms 10980 KB Output is correct
2 Correct 76 ms 11388 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 43 ms 5880 KB Output is correct
2 Correct 433 ms 11452 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 968 ms 19304 KB Output is correct
2 Correct 663 ms 20776 KB Output is correct
3 Correct 1098 ms 20848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 115 ms 13128 KB Output is correct
2 Correct 548 ms 17368 KB Output is correct
3 Correct 75 ms 11116 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 67 ms 11108 KB Output is correct
2 Correct 73 ms 10096 KB Output is correct