Submission #116721

#TimeUsernameProblemLanguageResultExecution timeMemory
116721tselmegkhNadan (COCI18_nadan)C++14
50 / 50
2 ms384 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...