답안 #116721

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
116721 2019-06-13T16:13:35 Z tselmegkh Nadan (COCI18_nadan) C++14
50 / 50
2 ms 384 KB
#include<bits/stdc++.h>
using namespace std;

#define INF 1e9
#define MAX 100005
#define xx first
#define yy second
#define pb push_back
#define mp make_pair
#define ull long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define nl '\n'
#define zai <<' '<<
#define all(a) a.begin(),a.end()
#define pc __builtin_popcount
#define debug(x) cerr << #x << " = " << (x) << ", "
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
template<class C> void mini(C &_a, C _b) { _a = min(_a, _b); }
template<class C> void maxi(C &_a, C _b) { _a = max(_a, _b); }

int main(){
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int k,n;
	cin >> k >> n;
	if(n==1){
		cout << k;
		return 0;
	}
	ull sum=0;
	for(int i=1;i<=n-1;i++){
		sum+=i;
		cout << i << nl;
	}
	assert(k-sum>=0);
	cout << k-sum;
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 2 ms 384 KB Output is correct
8 Correct 2 ms 384 KB Output is correct
9 Correct 2 ms 384 KB Output is correct
10 Correct 2 ms 256 KB Output is correct