結果

問題 No.350 d=vt
ユーザー nCk_cvnCk_cv
提出日時 2017-09-01 02:02:13
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,089 bytes
コンパイル時間 892 ms
コンパイル使用メモリ 80,256 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 10:51:03
合計ジャッジ時間 1,546 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
5,376 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;




}
0