답안 #143818

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
143818 2019-08-15T09:25:04 Z nicolaalexandra Kotrljanje (COCI18_kotrljanje) C++14
0 / 140
185 ms 51756 KB
#include <iostream>
#include <vector>
using namespace std;

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

    cin>>c>>d>>b>>m;
    for (int nr=0;;nr+=(b-1)){
        int val = c*nr+d;
        int aux = val, 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:20:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (v[sum].size() == m){
             ~~~~~~~~~~~~~~^~~~
kotrljanje.cpp:21:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (int i=0;i<v[sum].size();i++)
                          ~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Runtime error 54 ms 47992 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 52 ms 47992 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 48032 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 48040 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 56 ms 48044 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 47980 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 48 ms 24268 KB Output is correct
2 Runtime error 176 ms 51436 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 185 ms 51756 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 112 ms 28348 KB Output is correct
2 Runtime error 100 ms 49400 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 53 ms 47864 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -