結果

問題 No.821 Making Integers
ユーザー toma
提出日時 2019-04-26 21:30:52
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 1,400 ms
コンパイル使用メモリ 165,956 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 02:06:25
合計ジャッジ時間 1,872 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include"bits/stdc++.h"

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7



int main()
{
	ll N, K, res = 0;
	cin >> N >> K;
	res += K * N;
	res -= K * (K - 1) / 2;
	cout << res + 1 << endl;
	return 0;
}
0