Submission #12113593


Source Code Expand

Copy
#include<bits/stdc++.h>

int main(){
    using namespace std;
    unsigned long N, K;
    cin >> N >> K;
    unsigned long ans{0};
    ++N;
    for(unsigned long i{K}; i <= N; ++i)(ans += i * (N - i) + 1) %= 1000000007;
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task D - Sum of Large Numbers
User MMNMM
Language C++ (GCC 9.2.1)
Score 400
Code Size 271 Byte
Status AC
Exec Time 3 ms
Memory 3592 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 19
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All hand_01, hand_02, max_01, max_02, random_01, random_02, random_03, random_04, random_05, random_06, random_07, random_08, random_09, random_10, random_11, random_12, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_01 AC 2 ms 3448 KB
hand_02 AC 2 ms 3520 KB
max_01 AC 3 ms 3564 KB
max_02 AC 3 ms 3548 KB
random_01 AC 2 ms 3388 KB
random_02 AC 2 ms 3584 KB
random_03 AC 3 ms 3436 KB
random_04 AC 2 ms 3520 KB
random_05 AC 2 ms 3392 KB
random_06 AC 2 ms 3448 KB
random_07 AC 2 ms 3520 KB
random_08 AC 3 ms 3504 KB
random_09 AC 3 ms 3564 KB
random_10 AC 2 ms 3520 KB
random_11 AC 2 ms 3568 KB
random_12 AC 2 ms 3592 KB
sample_01 AC 2 ms 3552 KB
sample_02 AC 2 ms 3520 KB
sample_03 AC 2 ms 3404 KB