QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#683862 | #9531. Weird Ceiling | yxl | TL | 0ms | 0kb | C++14 | 536b | 2024-10-28 00:48:40 | 2024-10-28 00:48:41 |
answer
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<string>
#include<map>
#include<deque>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<iomanip>
using namespace std;
int f(int a,int b){
int i=b;
while (i>=2){
if (a%i==0){
return a/i;
}
i--;
}
return a;
}
int main(){
int t,n;
cin>>t;
while(t--){
cin>>n;
long long sum=0;
for (int i=1;i<=n;i++){
sum+=f(n,i);
}
cout<<sum<<endl;
}
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