結果

問題 No.1819 Mirrored 2
ユーザー 蜜蜂蜜蜂
提出日時 2022-01-21 22:14:30
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
OLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,070 bytes
コンパイル時間 3,631 ms
コンパイル使用メモリ 227,812 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2023-08-17 09:24:18
合計ジャッジ時間 9,594 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,716 KB
testcase_01 AC 3 ms
4,376 KB
testcase_02 AC 5 ms
4,380 KB
testcase_03 AC 4 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 4 ms
4,380 KB
testcase_06 AC 5 ms
4,376 KB
testcase_07 AC 5 ms
4,376 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 5 ms
4,376 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 AC 6 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 AC 5 ms
4,376 KB
testcase_18 AC 4 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
testcase_22 AC 4 ms
4,376 KB
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 5 ms
4,500 KB
testcase_25 AC 3 ms
4,380 KB
testcase_26 OLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

//g++ 2.cpp -std=c++14 -O2 -I .
#include <bits/stdc++.h>
using namespace std;

#include <atcoder/all>
using namespace atcoder;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vst = vector<string>;
using vvst = vector<vst>;

#define fi first
#define se second
#define pb push_back
#define pq_big(T) priority_queue<T,vector<T>,less<T>>
#define pq_small(T) priority_queue<T,vector<T>,greater<T>>
#define all(a) a.begin(),a.end()
#define rep(i,start,end) for(ll i=start;i<(ll)(end);i++)
#define per(i,start,end) for(ll i=start;i>=(ll)(end);i--)
#define uniq(a) sort(all(a));a.erase(unique(all(a)),a.end())

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  ll p,q,x,y;
  cin>>p>>q>>x>>y;

  ll rev=y;
  while(rev%10==0){
    rev+=q;
  }

  string s=to_string(rev);
  reverse(all(s));
  ll ans=stoll(s);

  ll md=ans%p;

  cout<<ans;
  while(md!=x){
    md*=10;
    cout<<0;
    md%=p;
  }
  cout<<endl;
}
0