Submission #361671

# Submission time Handle Problem Language Result Execution time Memory
361671 2021-01-31T04:56:28 Z israeladewuyi Nadan (COCI18_nadan) C++17
10 / 50
1 ms 512 KB
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<pair<int,int>> vp;

#define int ll
#define PB push_back
#define pb pop_back
#define in insert 
#define endl "\n"
#define MP make_pair
#define f first
#define Trav(a,x) for(auto &a: x)
#define	sort(x) sort(x.begin(),x.end());
const int MOD  = 998244353;
const int maxn = 1e5+1;

int a,b,c,d,k,n,m,x,s,y,ans;

int32_t main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin>>k>>n;
	vi A(n);
	if(k % n == 0) 
		for(int i = 0; i < n; i++){
			A[i] = k/n;
		}
	b = 0;
	for(int  i = 0; i < n; i++){
		if(i == n-1)A[i]+=b;
		else{
			A[i]-=(i+1);
			b+=i+1;
		}
		
	}
	Trav(a,A)cout<<a<<endl;
	return 0;
}

 

Compilation message

nadan.cpp:2: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    2 | #pragma GCC optimization ("O3")
      | 
nadan.cpp:3: warning: ignoring #pragma GCC optimization [-Wunknown-pragmas]
    3 | #pragma GCC optimization ("unroll-loops")
      |
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 492 KB Output isn't correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Incorrect 1 ms 512 KB Output isn't correct
4 Correct 1 ms 364 KB Output is correct
5 Incorrect 1 ms 364 KB Output isn't correct
6 Incorrect 1 ms 364 KB Output isn't correct
7 Incorrect 1 ms 364 KB Output isn't correct
8 Correct 1 ms 384 KB Output is correct
9 Incorrect 1 ms 376 KB Output isn't correct
10 Incorrect 1 ms 364 KB Output isn't correct