結果

問題 No.2225 Treasure Searching Rod (Easy)
ユーザー buey_tbuey_t
提出日時 2023-02-24 21:33:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 435 ms / 2,000 ms
コード長 1,367 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,852 KB
実行使用メモリ 96,108 KB
最終ジャッジ日時 2023-10-11 05:54:37
合計ジャッジ時間 9,527 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 246 ms
92,508 KB
testcase_01 AC 248 ms
92,464 KB
testcase_02 AC 251 ms
92,428 KB
testcase_03 AC 250 ms
92,420 KB
testcase_04 AC 248 ms
92,492 KB
testcase_05 AC 256 ms
92,284 KB
testcase_06 AC 252 ms
92,456 KB
testcase_07 AC 433 ms
96,076 KB
testcase_08 AC 429 ms
95,936 KB
testcase_09 AC 435 ms
95,688 KB
testcase_10 AC 264 ms
93,328 KB
testcase_11 AC 251 ms
92,976 KB
testcase_12 AC 432 ms
95,904 KB
testcase_13 AC 432 ms
96,108 KB
testcase_14 AC 427 ms
95,956 KB
testcase_15 AC 252 ms
93,280 KB
testcase_16 AC 258 ms
93,464 KB
testcase_17 AC 256 ms
93,244 KB
testcase_18 AC 265 ms
93,408 KB
testcase_19 AC 255 ms
93,516 KB
testcase_20 AC 262 ms
93,480 KB
testcase_21 AC 294 ms
93,304 KB
testcase_22 AC 247 ms
92,312 KB
testcase_23 AC 309 ms
93,660 KB
testcase_24 AC 265 ms
93,616 KB
testcase_25 AC 277 ms
93,408 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    try:
        import pypyjit
        pypyjit.set_param('max_unroll_recursion=-1')
    except:
        pass
    try:
        import sys
        sys.setrecursionlimit(10**7)
    except:
        pass
    from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
    import heapq
    from bisect import bisect_left, bisect_right
    import copy
    from collections import deque,Counter,defaultdict
    from itertools import permutations,combinations
    from decimal import Decimal,ROUND_HALF_UP
    #tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
    from functools import lru_cache, reduce
    #@lru_cache(maxsize=None)
    from operator import add,sub,mul,xor,and_,or_
    INF = 10**18
    mod1 = 10**9+7
    mod2 = 998244353
    
    #DecimalならPython
    
    H,W,K = map(int, input().split())
    
    x = [0]*(K)
    y = [0]*K
    v = [0]*K

    for i in range(K):
        x[i],y[i],v[i] = map(int, input().split())
    
    ans = 0
    
    for k in range(K):
        for i in range(1,H+1):
            for j in range(1,W+1):
                if x[k]+y[k] >= i+j and x[k]-y[k] >= i-j:
                    ans += v[k]
                ans %= mod2
    
    print(ans)
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
if __name__ == '__main__':
    main()
0