Submission #12124729


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main(){
	long long n,m,sum=0;
	cin>>n>>m;
	for(long long i=m;i<=n+1;i++){
		sum+=i*n-i*(i-1)/2-(i-1)*i/2+1;
	}
	cout<<sum%1000000007;
	return 0;
}

Submission Info

Submission Time
Task D - Sum of Large Numbers
User HH2JZ
Language C++ (GCC 9.2.1)
Score 400
Code Size 208 Byte
Status AC
Exec Time 4 ms
Memory 3636 KiB

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 3 ms 3624 KiB
hand_02 AC 2 ms 3504 KiB
max_01 AC 3 ms 3564 KiB
max_02 AC 2 ms 3452 KiB
random_01 AC 2 ms 3452 KiB
random_02 AC 2 ms 3448 KiB
random_03 AC 2 ms 3392 KiB
random_04 AC 2 ms 3564 KiB
random_05 AC 2 ms 3596 KiB
random_06 AC 2 ms 3636 KiB
random_07 AC 2 ms 3404 KiB
random_08 AC 2 ms 3524 KiB
random_09 AC 2 ms 3552 KiB
random_10 AC 2 ms 3596 KiB
random_11 AC 2 ms 3584 KiB
random_12 AC 4 ms 3520 KiB
sample_01 AC 2 ms 3432 KiB
sample_02 AC 1 ms 3392 KiB
sample_03 AC 2 ms 3584 KiB