QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#684157#9531. Weird CeilingTsqTL 0ms0kbC++14480b2024-10-28 11:00:332024-10-28 11:00:33

Judging History

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

  • [2024-10-28 11:00:33]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [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;
}

详细

Test #1:

score: 0
Time Limit Exceeded

input:

3
5
451
114514

output:

21
10251

result: