結果
| 問題 | No.1819 Mirrored 2 | 
| コンテスト | |
| ユーザー |  Nachia | 
| 提出日時 | 2022-01-21 23:43:12 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 27 ms / 2,000 ms | 
| コード長 | 841 bytes | 
| コンパイル時間 | 737 ms | 
| コンパイル使用メモリ | 74,732 KB | 
| 最終ジャッジ日時 | 2025-01-27 14:36:01 | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 26 | 
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using i32 = int;
using u32 = unsigned int;
#define rep(i,n) for(int i=0; i<(n); i++)
u64 rev_int(u64 x){
    string a = to_string(x);
    reverse(a.begin(), a.end());
    u64 ans = 0;
    for(auto c : a) ans = ans * 10 + (c - '0');
    return ans;
}
int main() {
    u64 P,Q,x,y; cin >> P >> Q >> x >> y;
    for(u64 i=1; i<10000000; i++){
        u64 revans = Q * i + y;
        if(revans % 10 == 0) continue;
        if(rev_int(revans) % 90007 != x) continue;
        cout << rev_int(revans) << endl;
        return 0;
    }
    return 0;
}
struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
            
            
            
        