結果
問題 |
No.853 河原の石
|
ユーザー |
![]() |
提出日時 | 2019-07-26 21:39:20 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,271 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 82,436 KB |
実行使用メモリ | 58,444 KB |
最終ジャッジ日時 | 2024-07-02 06:45:34 |
合計ジャッジ時間 | 4,423 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 2 WA * 55 |
ソースコード
#!usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop import sys import math import bisect import random def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for x in sys.stdin.readline().split()] def S(): return list(sys.stdin.readline())[:-1] def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def LSR(n): return [LS() for i in range(n)] sys.setrecursionlimit(1000000) mod = 1000000007 #A def A(): try: n = I() a = IR(n) l = [] for i in range(n): for j in range(i): l.append(a[i]+a[j]) l = list(set(l)) l.sort() l = l[::-1] print(l[1]) except: print('"assert"') return #B def B(): n = I() return #C def C(): def su(n): return n*(n+1)//2 h,w = LI() if h < w: ans = su(w)-su(w-h) else: ans = max(0,h-w)+su(w) print(ans) return #D def D(): n = I() return #E def E(): n = I() return #F def F(): n = I() return #Solve if __name__ == "__main__": C()