結果
| 問題 |
No.350 d=vt
|
| コンテスト | |
| ユーザー |
nCk_cv
|
| 提出日時 | 2017-09-01 02:02:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,089 bytes |
| コンパイル時間 | 652 ms |
| コンパイル使用メモリ | 79,404 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-05 05:33:19 |
| 合計ジャッジ時間 | 1,173 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 11 |
ソースコード
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <cmath>
#define AS(a) (sizeof(a)/sizeof(a[0]))
using namespace std;
long long int MOD = 1000000007;
long long int INF = 1000000007;
int main() {
int out[20];
int t;
char v[6];
for(int i = 0; i < 20; i++) {
out[i] = 0;
}
cin >> v >> t;
for(int i = 2; i < 6; i++) {
out[i + 14] = (int)(v[i] - '0');
}
int next[20];
for(int i = 0; i < 20; i++) {
next[i] = 0;
}
for(int i = 19; i >= 0; i--) {
int tt = out[i] * t;
string k = to_string(tt);
for(int j = (int)k.length()-1; j >= 0; j--) {
int id = (int)k.length() - 1 - j;
next[i - id] += (int)(k[j] - '0');
if(next[i - id] >= 10) {
next[i - id - 1] += next[i - id] / 10;
next[i - id] %= 10;
}
}
}
string k = "";
bool al = false;
for(int i = 0; i < 16; i++) {
if(!al && next[i] == 0) continue;
al = true;
k += to_string(next[i]);
}
if(k.length() == 0) k = "0";
cout << k << endl;
}
nCk_cv