結果
| 問題 | No.3689 LCM Sum (Easy Version) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-06 18:03:36 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 150 ms / 2,000 ms |
| + 853µs | |
| コード長 | 3,167 bytes |
| 記録 | |
| コンパイル時間 | 229 ms |
| コンパイル使用メモリ | 96,192 KB |
| 実行使用メモリ | 84,352 KB |
| 最終ジャッジ日時 | 2026-09-06 18:04:17 |
| 合計ジャッジ時間 | 3,239 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
import sys
import heapq # 優先度付きキュー
from bisect import bisect_left, bisect_right
from collections import deque
from itertools import combinations
from itertools import permutations
from math import*
def input():return sys.stdin.readline().strip()
heap = heapq.heapify
push = heapq.heappush
pop = heapq.heappop
mod9 = 10**9 + 7
mod998 = 998244353
INF = 10e36
move8 = [(-1,-1),(-1,0),(-1, 1),(0 ,-1),( 0, 1),(1 ,-1),( 1, 0),(1, 1)]
move4 = [(0,-1),(0,1),(-1,0),(1,0)]
move4c = [(-1,-1),(-1,1),(1,-1),(1,1)]
dirc = {"U":(-1,0),"D":(1,0),"L":(0,-1),"R":(0,1)}
Yes = 'Yes'
No = "No"
def lint():return list(map(int,input().split()))
def lstr():return list(map(str,input().split()))
def mint():return map(int,input().split())
def mstr():return map(str,input().split())
def mgrid(h,w,ind=1):return [[0]*(w+ind) for i in range(h+ind)]
def mgraf(n):return [[]for i in range(n+1)]
def bsl(l,n):return bisect_left(l,n)# n以上の要素数
def bsr(l,n):return bisect_right(l,n) # n以下の要素数
def bs(l,n):return (bisect_left(l,n),bisect_right(l,n)) # 二分探索
def manhat(T1,T2):return sum(abs(a-b) for a,b in zip(T1,T2))
def ugread(T1,T2):return dist(T1,T2)
def ps(a:list): #累積和
s = [0]
for x in a:s.append(s[-1] + x)
return s #list
def ps_2d(g): # 二次元累積和
h = len(g)
w = len(g[0])
m = [[0]*(w+1) for _ in range(h+1)]
for i in range(1,h+1):
for j in range(1,w+1):m[i][j] = (m[i-1][j]+m[i][j-1]-m[i-1][j-1]+g[i-1][j-1])
return m
def ps_2dm(g:list,pos:tuple):
a,b,c,d=pos
g[a][b]+=1
g[c+1][d+1]+=1
g[a][d+1]-=1
g[b][c+1]-=1
return g
def alpha_id(c):
if'a'<=c<='z':return ord(c)-96
if'A'<=c<='Z':return ord(c)-38
raise ValueError("alphabet only")
def rle(s): # ランレングス圧縮
res = []
cur = s[0]
cnt = 1
for i in range(1, len(s)):
if s[i] == cur:cnt += 1
else:
res.append((cur, cnt))
cur = s[i]
cnt = 1
res.append((cur, cnt))
return res
def rotate(l,c=1): # 90度回転
for i in range(c%4):l = [list(row) for row in zip(*l[::-1])]
return l
def ncr(n, r):return comb(n, r)
def enu(S):return (enumerate(S))
def get_kv(d:dict):return d.items()
def get_k(d:dict):return d.keys()
def get_v(d:dict):return d.values()
def contdic(l):
d = {}
for i in l:
if i not in d:
d[i] = 1
else:
d[i] += 1
return d
def _deque():
""" this fanc in deque template"""
# from collections import deque
x = None
_ = deque()
_.append(x) # xを右に追加
_.appendleft(x) # xを左に追加
_.pop() # 右側を削除し返り値として持つ
_.popleft() # 左側を削除し返り値として持つ
_.clear() # 初期化
_.copy() # コピー
# def dic():return dict()
# def circle(x:tuple,y:tuple):
# def emu(l:list):
# # return is (index, name)*len(l)
# return enumerate(l)
enu = enumerate
combi = combinations
permi = permutations
"""
bit temp
for bit in range(1<<n):
if bit >> i & 1:
# check
"""
n,m = mint()
ans = 0
for i in range(1,n+1):
for j in range(1,m+1):
ans += lcm(i,j)
ans %=mod998
print(ans)