結果

問題 No.821 Making Integers
ユーザー leaf_1415
提出日時 2019-04-26 21:33:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 54,008 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-25 02:11:47
合計ジャッジ時間 905 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#define llint long long

using namespace std;

llint n, k;

int main(void)
{
  cin >> n >> k;
  llint x = k*n - k*(k-1)/2 + 1, m = n*(n+1)/2 + 1;
  if(x >= m){
    cout << m << endl;
  }else{
    cout << x << endl;
  }
  return 0;
}
0