結果

問題 No.411 昇順昇順ソート
ユーザー hanorver
提出日時 2016-08-12 22:37:34
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 283 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 69,428 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-07 13:03:55
合計ジャッジ時間 1,695 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<cmath>

int main() {
	int n, k, count = 1;

	std::cin >> n >> k;

	if (k == 1) {
		std::cout << 0 << std::endl;
		return 0;
	}

	for (int i = k + 1; i <= n; i++) {
		count += n - i + 1;
	}

	std::cout << count << std::endl;
	
	return 0;
}
0