結果
問題 | No.821 Making Integers |
ユーザー | kuuso1 |
提出日時 | 2019-04-26 21:54:51 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 91 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-25 03:24:44 |
合計ジャッジ時間 | 812 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
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)