Submission #83311

# Submission time Handle Problem Language Result Execution time Memory
83311 2018-11-06T22:18:37 Z fredbr Timovi (COCI18_timovi) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 200010;

ll v[maxn];

int main()
{
	ll n, k, m;
	cin >> n >> k >> m;

	ll cnt = max(0ll, m-k)/(k*(n-1));

	if (cnt == 0) {

		for (int i = 1; i <= n and m > 0; i++) v[i] = min(m, k), m -=k;
	
	} else {

		ll x = cnt*k;
		ll volta  =
		ll ida = cnt / 2;

		m -= k;
		v[1] = k;
		for (int i = 1; i <= n; i++) v[i] += ds*k;
		m -= x*n;

		if (cnt == 0) v[1] = min(m, k), m -= k;

		for (int i = 2; i <= n and m > 0; i--) v[i] += min(k, m), m -= k;	
	}

	for (int i = 1; i <= n; i++) cout << v[i] << " ";
	cout << "\n";
}

Compilation message

timovi.cpp: In function 'int main()':
timovi.cpp:26:6: error: expected primary-expression before 'ida'
   ll ida = cnt / 2;
      ^~~
timovi.cpp:30:40: error: 'ds' was not declared in this scope
   for (int i = 1; i <= n; i++) v[i] += ds*k;
                                        ^~
timovi.cpp:25:6: warning: unused variable 'volta' [-Wunused-variable]
   ll volta  =
      ^~~~~