Submission #16454643


Source Code Expand

#include<bits/stdc++.h>
using namespace std;
const int N = 1e7 + 1;
int n, m, k;
long long int cs[N]; 
int main(){
    int n;
    cin >> n;
    long long int sum = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i; j <= n ; j += i)
            cs[j]++;
        sum += 1LL * i * cs[i];
    }
    cout << sum << endl;
    return 0;
}

Submission Info

Submission Time
Task D - Sum of Divisors
User thenoobestever
Language C++ (GCC 9.2.1)
Score 400
Code Size 355 Byte
Status AC
Exec Time 1212 ms
Memory 81720 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 20
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All hand_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, sample_01.txt, sample_02.txt, sample_03.txt, sq_01.txt, sq_02.txt, sq_03.txt, sq_04.txt, sq_05.txt, sq_06.txt
Case Name Status Exec Time Memory
hand_01.txt AC 6 ms 3564 KiB
random_01.txt AC 1176 ms 81712 KiB
random_02.txt AC 845 ms 65468 KiB
random_03.txt AC 1172 ms 81720 KiB
random_04.txt AC 404 ms 42472 KiB
random_05.txt AC 1167 ms 81652 KiB
random_06.txt AC 263 ms 32428 KiB
random_07.txt AC 1179 ms 81720 KiB
random_08.txt AC 575 ms 51752 KiB
random_09.txt AC 1168 ms 81556 KiB
random_10.txt AC 49 ms 11624 KiB
sample_01.txt AC 5 ms 3440 KiB
sample_02.txt AC 1 ms 3568 KiB
sample_03.txt AC 1212 ms 81688 KiB
sq_01.txt AC 1179 ms 81556 KiB
sq_02.txt AC 1170 ms 81536 KiB
sq_03.txt AC 1165 ms 81632 KiB
sq_04.txt AC 1188 ms 81656 KiB
sq_05.txt AC 1173 ms 81664 KiB
sq_06.txt AC 1158 ms 81704 KiB