QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#689755#9531. Weird CeilingNewbackCompile Error//C++98465b2024-10-30 18:27:462024-10-30 18:27:48

Judging History

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

  • [2024-10-30 18:27:48]
  • 评测
  • [2024-10-30 18:27:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int a[110001];
int main(){
	int T;
	cin >> T;
	while(T--){
		int n;
		cin >> n;
		int t = 1;
		long long sum =0;
		for(int i=1;i<sqrt(n);i++){
			if(n%i==0){
				a[t++] = i;
				a[t++] = n/i;
			}
		}
		sort(a+1,a+t);
		/*for(int i=1;i<t;i++){
			cout << a[i] <<" ";
		}*/
		/*for(int i=2;i<t;i++){
			sum+=(a[i]-a[i-1])*(n/a[i-1]);
		}
		sum+=n/a[t-1];
		cout << sum << endl;
	}
	return 0;
}

详细

answer.code:22:17: error: unterminated comment
   22 |                 /*for(int i=2;i<t;i++){
      |                 ^
answer.code: In function ‘int main()’:
answer.code:18:31: error: expected ‘}’ at end of input
   18 |                 sort(a+1,a+t);
      |                               ^
answer.code:7:19: note: to match this ‘{’
    7 |         while(T--){
      |                   ^
answer.code:18:31: error: expected ‘}’ at end of input
   18 |                 sort(a+1,a+t);
      |                               ^
answer.code:4:11: note: to match this ‘{’
    4 | int main(){
      |           ^