結果

問題 No.2610 Decreasing LCMs
ユーザー suisen
提出日時 2024-01-19 23:21:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 216 bytes
コンパイル時間 338 ms
コンパイル使用メモリ 27,136 KB
最終ジャッジ日時 2025-02-18 21:32:56
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%d", &n);
      |     ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main() {
    int n, i, a;
    scanf("%d", &n);
    a = (1 << (n - 1)) + 1;
    for (i = 0; i < n; ++i) {
        printf("%d", a), putchar(i == n - 1 ? '\n' : ' ');
        a += 1 << i;
    }
}
0