답안 #218928

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
218928 2020-04-03T07:55:43 Z brcode Nadan (COCI18_nadan) C++14
50 / 50
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++;
        
    }
}
# 결과 실행 시간 메모리 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