結果
| 問題 |
No.428 小数から逃げる夢
|
| コンテスト | |
| ユーザー |
moyashi_senpai
|
| 提出日時 | 2016-10-02 22:55:12 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,324 bytes |
| コンパイル時間 | 801 ms |
| コンパイル使用メモリ | 86,540 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 13:25:41 |
| 合計ジャッジ時間 | 3,270 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 65 WA * 35 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:35:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
35 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
ソースコード
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <bitset>
#include <stack>
#include <cstdlib>
#include <complex>
#include <unordered_map>
#define REP(i,n) for(int i = 0; n > i; i++)
#define MODU 33
#define Range(x,a,b) ((a) <= (x) && (x) <= (b))
#define POWT(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define C_D(c) ((c) - '0')
#define D_C(d) ((d) + '0')
using namespace std;
typedef vector<int> Ivec;
typedef pair<int, int> pii;
typedef long long int ll;
int main() {
int n;
char d[1000] = { "1998979695949392919099888786858483828180897877767574737271707968676665646362616069585756555453525150594847464544434241404938373635343332313039282726252423222120291817161514131211101987654321" };
int an[1000] = {};
scanf("%d", &n);
REP(i, 200) {
if (!d[i])continue;
an[i] += (C_D(d[i]) * n);
}
REP(i, 200) {
if (!d[i])continue;
if (an[i] > 10) {
an[i + 1] += an[i] / 10;
an[i] = an[i] % 10;
}
}
bool f = 0;
for (int i = 200; 189 < i; i--) {
f = an[i];
if (f) {
printf("%d", an[i]);
}
}
printf(".");
for(int i = 189; 0 <= i; i--) {
printf("%d", an[i]);
}
printf("\n");
return 0;
}
moyashi_senpai