結果
| 問題 | No.3689 LCM Sum (Easy Version) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-09-06 22:52:16 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 443 ms / 2,000 ms |
| + 637µs | |
| コード長 | 426 bytes |
| 記録 | |
| コンパイル時間 | 1,048 ms |
| コンパイル使用メモリ | 154,332 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-06 22:52:30 |
| 合計ジャッジ時間 | 4,162 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
コンパイルメッセージ
main.cpp: In function 'int func(int, int)':
main.cpp:18:1: warning: control reaches end of non-void function [-Wreturn-type]
18 | }
| ^
ソースコード
#include <iostream>
using namespace std;
int func(int a, int b){
int min, max;
if(a < b){
min = a;
max = b;
}else{
min = b;
max = a;
}
for(int i = 1; i <= 2000; i++){
int t = max * i;
if(t % min == 0){
return t;
}
}
}
int main(){
int n, m, sum = 0;
cin >> n >> m;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
sum += func(i, j);
sum %= 998244353;
}
}
cout << sum;
return 0;
}