답안 #472244

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
472244 2021-09-13T10:10:56 Z HossamHero7 Nadan (COCI18_nadan) C++14
50 / 50
1 ms 204 KB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define endl '\n'
void solve(){
    int k,n;
    cin>>k>>n;
    vector <int> v(n);
    ll sum = 0;
    for(int i=0;i<n-1;i++){
        v[i] = i+1;
        sum += i+1;
    }
    ll ans = k - sum;
    v[n-1] = ans;
    for(auto i : v){
        cout<<i<<endl;
    }
}
int main()
{
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct