QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#687946#9531. Weird CeilingDrMissRightTL 0ms0kbC++20684b2024-10-29 22:05:042024-10-29 22:05:05

Judging History

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

  • [2024-10-29 22:05:05]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:0kb
  • [2024-10-29 22:05:04]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
using ULL = unsigned long long;
using LLL = __int128;
using PII = pair<int, int>;
const int inf = 0x3f3f3f3f;


void solve(){
	int n;
	cin >> n;
	int ans1 = n + 1;
	int ans2 = 0;
	for (int i = 2; i <= n - 1; ++ i) {
		bool fl = false;
		for (int j = i; j >= 2; -- j)  {
			if (n % j == 0) {
				fl = true;
				ans2 += n / j;
				break;
			}
		}
		if (!fl) {
			ans2 += n;
		}
	}
	
	cout << ans1 + ans2 << '\n';
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    cin >> T;
    while(T --) solve();
    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:


result: