結果

問題 No.821 Making Integers
ユーザー erbowlerbowl
提出日時 2019-08-19 23:19:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 570 ms / 2,000 ms
コード長 235 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 161,996 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 13:17:40
合計ジャッジ時間 3,295 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 72 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 570 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 412 ms
5,376 KB
testcase_06 AC 20 ms
5,376 KB
testcase_07 AC 48 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    ll n,k;
    std::cin >> n>>k;
    ll sum = 1;

    for (int i = 1; i <= k; i++) {
        sum += n-(i-1);
    }
    std::cout << sum << std::endl;
}
0