結果

問題 No.220 世界のなんとか2
ユーザー Pachicobue
提出日時 2017-12-31 20:44:40
言語 C90
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 295 bytes
コンパイル時間 254 ms
コンパイル使用メモリ 20,352 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-21 15:33:46
合計ジャッジ時間 1,015 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d", &P);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
typedef unsigned long long ull;
int main(void)
{
    int P;
    scanf("%d", &P);
    P--;
    ull ans1 = 10;
    ull ans2 = 6;
    while (P) {
        ans1 *= 10;
        ans2 *= 9;
        P--;
    }
    ans1 -= ans2;
    ans1--;
    printf("%llu\n", ans1);
    return 0;
}

0