結果
| 問題 |
No.219 巨大数の概算
|
| コンテスト | |
| ユーザー |
kakira9618
|
| 提出日時 | 2015-05-29 22:37:46 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,585 bytes |
| コンパイル時間 | 704 ms |
| コンパイル使用メモリ | 84,176 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-07-06 11:38:55 |
| 合計ジャッジ時間 | 14,058 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | WA * 51 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:67:40: warning: ‘ansY’ may be used uninitialized in this function [-Wmaybe-uninitialized]
67 | cout << ansX << " " << ansY << " " << ((int)l) << endl;
| ^~~
main.cpp:67:25: warning: ‘ansX’ may be used uninitialized in this function [-Wmaybe-uninitialized]
67 | cout << ansX << " " << ansY << " " << ((int)l) << endl;
| ^~~
ソースコード
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
const int INF=1<<29;
const double EPS=1e-9;
const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};
int main() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
double l = ((double)b) * log10(a);
double ll = l - ((int)l);
int ansX, ansY;
for (int X = 1; X <= 9; X++) {
for (int Y = 0; Y <= 9; Y++) {
for (int Z = 0; Z < 9; Z++) {
double now = X + ((double)Y) / 10.0 + ((double)Z) / 100.0;
if (log10(now) >= ll) {
ansX = X;
ansY = Y;
goto en;
}
}
}
}
en:
cout << ansX << " " << ansY << " " << ((int)l) << endl;
}
return 0;
}
kakira9618