QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#162442#5252. DeforestationyinshaziyueCompile Error//C++17512b2023-09-03 12:30:522023-09-03 12:30:52

Judging History

你现在查看的是最新测评结果

  • [2023-09-03 12:30:52]
  • 评测
  • [2023-09-03 12:30:52]
  • 提交

answer

#include<algorithm>
#include<string>
#include<stdio.h>
#include<map>
#include<iostream>
#include<vector>
#include<iomanip>
#include<random>
#include<cmath>
#include<set>
using namespace std;
int m,cnt; vector<int>kk(10000000),long long all;
void input(int a,int b) {
	kk[++cnt] = a;
	all += a;
	for (int i = 1; i <= b; i++) {
		int a1, b1;
		cin >> a1 >> b1;
		input(a1, b1);
	}
}
int main() {
	cin >> m;
	int a, b;
	cin >> a >> b;
	input(a, b);
	long long ans = all / m;
	return 0;
}

Details

answer.code:12:36: error: expected unqualified-id before ‘long’
   12 | int m,cnt; vector<int>kk(10000000),long long all;
      |                                    ^~~~
answer.code: In function ‘void input(int, int)’:
answer.code:15:9: error: ‘all’ was not declared in this scope
   15 |         all += a;
      |         ^~~
answer.code: In function ‘int main()’:
answer.code:27:25: error: ‘all’ was not declared in this scope
   27 |         long long ans = all / m;
      |                         ^~~