QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#759161#9531. Weird CeilingNeptune_EXRE 1ms3608kbC++14662b2024-11-17 22:15:302024-11-17 22:15:30

Judging History

This is the latest submission verdict.

  • [2024-11-17 22:15:30]
  • Judged
  • Verdict: RE
  • Time: 1ms
  • Memory: 3608kb
  • [2024-11-17 22:15:30]
  • Submitted

answer

#define ll long long 
#include<bits/stdc++.h>
using namespace std;


int T;
ll x[1050];
vector<ll> vc;

void Find_num(ll k){
	ll bound=sqrt(k);
	for(int i=1;i<=k;i++){
		if(k%i==0 && i*i!=k){
			vc.push_back(k/i);
			vc.push_back(i);	
		}
	}
	
	sort(vc.begin(),vc.end());
	return;
	
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>T;
	for(int i=0;i<T;i++) cin>>x[i];
	
	for(int i=0;i<T;i++){
		vc.clear();
		ll ans=0;
		Find_num(x[i]);
		for(int j=1;j<=x[i];j++){
			int pos=upper_bound(vc.begin(),vc.end(),j)-vc.begin()-1;
			ans+=x[i]/vc[pos];	
		}
		cout<<ans<<endl;
	}
	
	return 0;
}


Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3608kb

input:

3
5
451
114514

output:

21
10251
7075858

result:

ok 3 lines

Test #2:

score: -100
Runtime Error

input:

1000
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101...

output:


result: