# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
94605 | 2019-01-21T15:55:22 Z | ahmedie404 | Timovi (COCI18_timovi) | C++14 | 1000 ms | 1528 KB |
#include <iostream> using namespace std; int ts[200000+9]; int n; long long k, m; int main(){ scanf("%d %lld %lld", &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; } if(idx < 0){ idx = 1; forw = true; } 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++){ printf("%d ", ts[i]); } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 15 ms | 1528 KB | Output is correct |
4 | Correct | 15 ms | 1528 KB | Output is correct |
5 | Execution timed out | 1081 ms | 376 KB | Time limit exceeded |
6 | Correct | 910 ms | 376 KB | Output is correct |
7 | Execution timed out | 1083 ms | 1016 KB | Time limit exceeded |
8 | Execution timed out | 1083 ms | 1016 KB | Time limit exceeded |