Submission #156889

# Submission time Handle Problem Language Result Execution time Memory
156889 2019-10-08T04:55:21 Z junodeveloper Nadan (COCI18_nadan) C++14
50 / 50
2 ms 376 KB
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
int n,k;
int main() {
	scanf("%d%d",&k,&n);
	int i,s=0;
	for(i=1;i<n;i++) printf("%d\n",i),s+=i;
	printf("%d",k-s);
	return 0;
}

Compilation message

nadan.cpp: In function 'int main()':
nadan.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&k,&n);
  ~~~~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 0 ms 256 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 256 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 256 KB Output is correct