結果

問題 No.1611 Minimum Multiple with Double Divisors
ユーザー H3PO4
提出日時 2023-05-06 14:27:54
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 404 bytes
コンパイル時間 680 ms
コンパイル使用メモリ 66,812 KB
最終ジャッジ日時 2025-02-12 20:32:10
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘long int solve(long int)’:
main.cpp:10:1: warning: control reaches end of non-void function [-Wreturn-type]
   10 | }
      | ^

ソースコード

diff #

#include <iostream>

long solve(long x) {
    constexpr int arr[] = {2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32};
    for (const auto &a: arr) {
        if (x % a != 0) {
            return x * a;
        }
    }
}

int main() {
    int T;
    std::cin >> T;
    for (int i = 0; i < T; ++i) {
        long x;
        std::cin >> x;
        std::cout << solve(x) << std::endl;
    }
}
0