結果

問題 No.219 巨大数の概算
ユーザー pekempey
提出日時 2015-08-12 14:14:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 584 bytes
コンパイル時間 1,338 ms
コンパイル使用メモリ 159,180 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-18 06:56:19
合計ジャッジ時間 11,902 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other WA * 51
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:21:27: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
   21 |         printf("%d %d %I64d\n", r / 10 % 10, r % 10, e);
      |                       ~~~~^                          ~
      |                           |                          |
      |                           int                        ll {aka long long int}
      |                       %I64lld

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, a) for (int i = 0; i < (a); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define repr(i, a) for (int i = (a) - 1; i >= 0; i--)
#define repr2(i, a, b) for (int i = (b) - 1; i >= (a); i--)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    while (N--) {
        ll A, B;
        cin >> A >> B;
        double l = B * log10(A);
        ll e = l;
        int r = pow(10, fmod(l, 1)) * 10;

        printf("%d %d %I64d\n", r / 10 % 10, r % 10, e);
    }
}
0