Submission #12146913


Source Code Expand

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

int main(){
    using namespace std;
    unsigned long N, K;
    cin >> N >> K;
    constexpr unsigned long MOD = 1000000007;
    cout << (N * (N + 1) + K * (N + 2) - 2 * K * K + 6) % MOD * (N - K + 2) % MOD * 166666668 % MOD << 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 284 Byte
Status AC
Exec Time 5 ms
Memory 3636 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 5 ms 3580 KB
hand_02 AC 2 ms 3568 KB
max_01 AC 2 ms 3584 KB
max_02 AC 2 ms 3520 KB
random_01 AC 2 ms 3444 KB
random_02 AC 2 ms 3636 KB
random_03 AC 2 ms 3392 KB
random_04 AC 2 ms 3592 KB
random_05 AC 2 ms 3408 KB
random_06 AC 2 ms 3392 KB
random_07 AC 2 ms 3520 KB
random_08 AC 2 ms 3548 KB
random_09 AC 2 ms 3524 KB
random_10 AC 2 ms 3392 KB
random_11 AC 2 ms 3596 KB
random_12 AC 2 ms 3564 KB
sample_01 AC 2 ms 3564 KB
sample_02 AC 2 ms 3592 KB
sample_03 AC 2 ms 3452 KB