QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#684157 | #9531. Weird Ceiling | Tsq | TL | 0ms | 0kb | C++14 | 480b | 2024-10-28 11:00:33 | 2024-10-28 11:00:33 |
answer
#include<iostream>
using namespace std;
int shu(int a,int b) {
int i=b;
int c=a;
while(i>=2){
if(a%i==0) {
c=a/i;
break;
}
else {i--;}
}
return c;
}
int main() {
int t;
cin >> t;
while(t--) {
int b;
long long sum=0;
cin >> b;
for(int i=1; i<=b; i++) {
sum+=shu(b,i);
}
cout << sum << "\n";
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Time Limit Exceeded
input:
3 5 451 114514
output:
21 10251