Submission #83319

# Submission time Handle Problem Language Result Execution time Memory
83319 2018-11-06T23:12:31 Z josiftepe Timovi (COCI18_timovi) C++14
0 / 80
18 ms 1776 KB
#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <sstream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <iomanip>
#include <fstream>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = (1 << 30);
const ll inf = (1LL << 60LL);
const int maxn = 2e5 + 10;
int n, k, m;
int ret[maxn];
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);

    cin >> n >> k >> m;
    memset(ret, 0, sizeof ret);
    int i = 0;
    bool R = true;
    int cnt = 0;
    while(m > 0){
        if(m < k){
            k = m;
        }
        if(R){
            ret[i] += k * cnt;
            i ++;
            if(i == n){
                i = n - 1;
                R = false;
            }
            cnt += m % k;
            m %= k;
            
        }
        else{
            ret[i] += k * cnt;
            i --;
            if(i == -1){
                i = 0;
                R = true;
            }
            cnt += m % k;
            m %= k;
        }
    }
    for(int i = 0; i < n; i ++){
        cout << ret[i] << " ";
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1144 KB Output isn't correct
2 Incorrect 3 ms 1224 KB Output isn't correct
3 Incorrect 17 ms 1732 KB Output isn't correct
4 Incorrect 18 ms 1732 KB Output isn't correct
5 Incorrect 15 ms 1732 KB Output isn't correct
6 Incorrect 3 ms 1732 KB Output isn't correct
7 Incorrect 17 ms 1732 KB Output isn't correct
8 Incorrect 16 ms 1776 KB Output isn't correct