結果

問題 No.821 Making Integers
ユーザー alexara1123
提出日時 2019-09-26 19:51:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 722 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 92,252 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-23 08:06:07
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <functional>
#include <cmath>
#include <cassert>
#include <string>
#include <iostream>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
//typedef pair<ll, ll> P;
ll MOD = 1000000007;
const int mod = 1000000007;
ll INF = 1LL << 60;

template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val)
{
   fill((T *)array, (T *)(array + N), val);
}



int main()
{
   ios::sync_with_stdio(false);
   cin.tie(0);

   ll n , k;
   cin >> n >> k;

   cout <<(k*(2*n-k+1))/2  +1<< endl;


}
0