結果
| 問題 | No.821 Making Integers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-02 00:08:43 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 344 bytes |
| 記録 | |
| コンパイル時間 | 1,572 ms |
| コンパイル使用メモリ | 173,992 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-26 15:07:22 |
| 合計ジャッジ時間 | 1,421 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long int ll;
using namespace std;
ll ans;
ll f(ll a, ll d, ll n) {
return (a * 2 + d * (n - 1)) * n / 2;
}
int main(void) {
ios::sync_with_stdio(false);
ll n, k; cin >> n >> k;
cout << 1 + f(n, -1,k) << endl;
return 0;
}