結果
問題 |
No.3250 最小公倍数
|
ユーザー |
![]() |
提出日時 | 2025-08-29 22:15:35 |
言語 | cLay (20241019-1) |
結果 |
CE
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 2,342 ms |
コンパイル使用メモリ | 174,580 KB |
最終ジャッジ日時 | 2025-08-29 22:15:40 |
合計ジャッジ時間 | 3,673 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:252:3: error: ‘wmem’ was not declared in this scope 252 | wmem = memarr; | ^~~~ main.cpp:252:10: error: ‘memarr’ was not declared in this scope; did you mean ‘memchr’? 252 | wmem = memarr; | ^~~~~~ | memchr main.cpp:257:30: error: a function-definition is not allowed here before ‘{’ token 257 | map<int,int> f(int i,int p){ | ^
ソースコード
#define MD 998244353 int d[1d6+1]; int a[5d5]; Mint z[5d5]; graph g; map<int,int> f(int i,int p){ map<int,int>m; int b=a[i]; while(b>1){ ++m[d[b]]; b/=d[b]; } rep[g.edge[i]](j,g.es[i]){ if(j!=p){ map<int,int>c=f(j,i); if(c.size()>m.size()){ swap(c,m); } for(auto x:c){ if(x.second>m[x.first]){ m[x.first]=x.second; } } } } z[i]=1; for(auto x:m){ z[i]*=Mint(x.first)**x.second; } return m; }