Submission #24976

# Submission time Handle Problem Language Result Execution time Memory
24976 2017-06-19T14:23:13 Z gabrielsimoes Fireworks (APIO16_fireworks) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n, m;
	scanf("%d %d", &n, &m);

	vector<int> v; v.resize(m+n);
	vector<int> p; p.resize(m+n);
	for (int i = 0; i < n+m; i++)
		scanf("%d %d", &p[i], &v[i]);

	if (n == 1) {
		sort(v.begin()+1, v.end());
		ll ret = 0;
		for (int i = 1; i <= m; i++) ret += abs(v[m/2] - v[i]);
		return printf("%lld\n", ret), 0;
	}
}

Compilation message

fireworks.cpp: In function 'int main()':
fireworks.cpp:15:3: error: 'll' was not declared in this scope
   ll ret = 0;
   ^
fireworks.cpp:16:32: error: 'ret' was not declared in this scope
   for (int i = 1; i <= m; i++) ret += abs(v[m/2] - v[i]);
                                ^
fireworks.cpp:17:27: error: 'ret' was not declared in this scope
   return printf("%lld\n", ret), 0;
                           ^
fireworks.cpp:6:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &n, &m);
                        ^
fireworks.cpp:11:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d", &p[i], &v[i]);
                               ^