# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
83317 | josiftepe | Timovi (COCI18_timovi) | C++14 | 1086 ms | 2228 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
while(m > 0){
if(m < k){
k = m;
}
if(R){
ret[i] += k;
i ++;
if(i == n){
i = n - 2;
R = false;
}
m -= k;
}
else{
ret[i] += k;
i --;
if(i == -1){
i = 1;
R = true;
}
m -= k;
}
}
for(int i = 0; i < n; i ++){
cout << ret[i] << " ";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |