結果

問題 No.821 Making Integers
ユーザー kuuso1kuuso1
提出日時 2019-04-26 21:54:51
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 522 bytes
コンパイル時間 433 ms
コンパイル使用メモリ 11,008 KB
実行使用メモリ 7,956 KB
最終ジャッジ日時 2023-08-16 14:04:11
合計ジャッジ時間 951 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,860 KB
testcase_01 AC 15 ms
7,792 KB
testcase_02 AC 16 ms
7,924 KB
testcase_03 AC 15 ms
7,912 KB
testcase_04 AC 16 ms
7,780 KB
testcase_05 AC 15 ms
7,956 KB
testcase_06 AC 14 ms
7,800 KB
testcase_07 AC 15 ms
7,776 KB
testcase_08 AC 15 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
##  input functions for me
def ria(sep = ''):
    if sep == '' :
        return list(map(int, input().split())) 
    else: return list(map(int, input().split(sep)))
def rsa(sep = ''):
    if sep == '' :
        return input().split() 
    else: return input().split(sep)
def ri(): return int(input())
def rd(): return float(input())
def rs(): return input()
##

## main ##
N, K = map(int, input().split())
F = N * (N + 1) // 2
M = F - 2 * (K * (N + N - 1 * (K - 1)) // 2)
print ((F - M) // 2 + 1)



0