답안 #83316

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
83316 2018-11-06T23:09:02 Z josiftepe Timovi (COCI18_timovi) C++14
20 / 80
1000 ms 2436 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);
#ifndef LOCAL_DEBUG
#endif
    cin >> n >> k >> m;
    memset(ret, 0, sizeof ret);
    int i = 0;
    bool R = true;
    while(m > 0){
        if(R){
            ret[i] += min(m, k);
            i ++;
            if(i == n){
                i = n - 1;
                R = false;
            }
            m -= k;
        }
        else{
            ret[i] += min(m, k);
            i --;
            if(i == -1){
                i = 0;
                R = true;
            }
            m -= k;
        }
    }
    for(int i = 0; i < n; i ++){
        cout << ret[i] << " ";
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 1144 KB Output isn't correct
2 Incorrect 3 ms 1220 KB Output isn't correct
3 Correct 17 ms 1600 KB Output is correct
4 Correct 17 ms 1644 KB Output is correct
5 Execution timed out 1081 ms 1644 KB Time limit exceeded
6 Incorrect 762 ms 1644 KB Output isn't correct
7 Incorrect 741 ms 2400 KB Output isn't correct
8 Execution timed out 1006 ms 2436 KB Time limit exceeded