提出 #17784855


ソースコード 拡げる

#include <bits/stdc++.h>
#define INF 1e9
#define eps 1e-6
typedef long long ll;
using namespace std;

int n;
ll ans, a, b;

int main(){

	cin >> n;
	for(int i = 1; i <= n; i++)
		cin >> a >> b, ans += (a + b) * (b - a + 1) / 2;
	cout << ans << endl;

	return 0;
}

提出情報

提出日時
問題 B - Trapezoid Sum
ユーザ HoshizoraZ
言語 C++ (GCC 9.2.1)
得点 200
コード長 282 Byte
結果 AC
実行時間 49 ms
メモリ 3612 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 3
AC × 13
セット名 テストケース
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 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
ケース名 結果 実行時間 メモリ
random_01.txt AC 8 ms 3508 KiB
random_02.txt AC 2 ms 3576 KiB
random_03.txt AC 2 ms 3512 KiB
random_04.txt AC 3 ms 3436 KiB
random_05.txt AC 3 ms 3508 KiB
random_06.txt AC 2 ms 3612 KiB
random_07.txt AC 10 ms 3396 KiB
random_08.txt AC 29 ms 3540 KiB
random_09.txt AC 33 ms 3556 KiB
random_10.txt AC 49 ms 3556 KiB
sample_01.txt AC 2 ms 3584 KiB
sample_02.txt AC 1 ms 3428 KiB
sample_03.txt AC 2 ms 3392 KiB