# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94604 | ahmedie404 | Timovi (COCI18_timovi) | C++14 | 1075 ms | 1532 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
int ts[200000+9];
int n;
long long k, m;
int main(){
cin >> n >> k >> m;
for(int i=0;i<n;i++) ts[i]=0;
int idx=0;
bool forw=true;
while(true){
if(idx >= n){
idx = n-2;
forw = false;
continue;
}
if(idx < 0){
idx = 1;
forw = true;
continue;
}
if(k > 0 && m > 0){
ts[idx] += ( m >= k ) ? k : m;
m-=( m >= k ) ? k : m;
idx += forw == true ? 1 : -1;
} else break;
}
for(int i=0;i<n;i++){
cout << ts[i] << " ";
}
cout << endl;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |