結果
| 問題 | No.219 巨大数の概算 |
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2016-03-07 22:20:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 917 bytes |
| 記録 | |
| コンパイル時間 | 573 ms |
| コンパイル使用メモリ | 60,360 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 11:37:09 |
| 合計ジャッジ時間 | 9,402 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 50 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define RREP(i,s,e) for (i = e-1; i >= s; i--)
#define rrep(i,n) RREP(i,0,n)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 1e8
typedef long long ll;
int main() {
int i, n;
cin >> n;
rep (i,n) {
ll a, b, num, z1, z2;
cin >> a >> b;
z1 = 0;
z2 = 0;
num = 1e8;
while (b > 0) {
while (a >= 1e9) {
a /= 10;
z1++;
}
if (b % 2 == 1) {
num *= a;
z2 += z1;
}
a *= a;
z1 *= 2;
b /= 2;
while (num >= 1e9) {
num /= 10;
z2++;
}
}
cout << num / 100000000 << " " << num / 10000000 % 10 << " " << z2 << endl;;
}
return 0;
}
h_noson