結果
| 問題 |
No.821 Making Integers
|
| コンテスト | |
| ユーザー |
MarcusAureliusAntoninus
|
| 提出日時 | 2019-04-26 21:32:03 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 166 bytes |
| コンパイル時間 | 1,960 ms |
| コンパイル使用メモリ | 190,468 KB |
| 最終ジャッジ日時 | 2025-01-07 03:05:17 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%lld%lld", &N, &K);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
int main()
{
long long N, K;
scanf("%lld%lld", &N, &K);
K = std::min(K, N);
printf("%lld\n", K * (N - K + 1 + N) / 2 + 1);
return 0;
}
MarcusAureliusAntoninus