QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#568278#9308. World CupDepartagainCompile Error//C++14629b2024-09-16 15:50:042024-09-16 15:50:05

Judging History

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

  • [2024-09-16 15:50:05]
  • 评测
  • [2024-09-16 15:50:04]
  • 提交

answer

#include<iostream>
using namespace std;
#include<algorithm>
int main()
{
	int T;
	cin >> T;
	while (T--)
	{
		int arr[33];
		for (int i = 0; i < 32; i++) scanf_s("%d", &arr[i]);
		int cn = arr[0];
		sort(arr, arr + 32);
		//for (int i = 0; i < 32; i++)printf("%d", arr[i]);
		for (int i = 0; i < 32; i++) if (cn == arr[i]) cn = 32-i;
		printf("cn=%d\n", cn);
		if (cn == 1) printf("1\n");
		else if (cn >= 2 && cn <= 17)printf("2\n");
		else if (cn == 18)printf("4\n");
		else if (cn >= 19 && cn <= 26)printf("8\n");
		else if (cn >= 27 && cn <= 30)printf("16\n");
		else printf("32\n");

	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:11:46: error: ‘scanf_s’ was not declared in this scope; did you mean ‘scanf’?
   11 |                 for (int i = 0; i < 32; i++) scanf_s("%d", &arr[i]);
      |                                              ^~~~~~~
      |                                              scanf