結果

問題 No.1819 Mirrored 2
ユーザー 蜜蜂蜜蜂
提出日時 2022-01-21 23:44:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,035 bytes
コンパイル時間 3,853 ms
コンパイル使用メモリ 228,320 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-17 10:02:59
合計ジャッジ時間 6,054 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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(true){
    string s=to_string(rev);
    reverse(all(s));
    ll ans=stoll(s);

    if(ans%p==x){
      cout<<ans<<endl;
      return 0;
    }

    rev+=q;
  }
}
0