# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
218928 |
2020-04-03T07:55:43 Z |
brcode |
Nadan (COCI18_nadan) |
C++14 |
|
5 ms |
384 KB |
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main() {
int n,k;
cin>>k>>n;
int curr = 1;
int tot = 0;
for(int i=1;i<=n;i++){
if(i==n){
cout<<(k-tot)<<endl;
break;
}
cout<<curr<<endl;
tot+=curr;
curr++;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
4 ms |
256 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
4 ms |
256 KB |
Output is correct |
6 |
Correct |
5 ms |
256 KB |
Output is correct |
7 |
Correct |
5 ms |
256 KB |
Output is correct |
8 |
Correct |
5 ms |
256 KB |
Output is correct |
9 |
Correct |
5 ms |
256 KB |
Output is correct |
10 |
Correct |
5 ms |
256 KB |
Output is correct |