結果
問題 |
No.1819 Mirrored 2
|
ユーザー |
|
提出日時 | 2022-05-14 18:18:38 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,327 bytes |
コンパイル時間 | 2,130 ms |
コンパイル使用メモリ | 195,792 KB |
最終ジャッジ日時 | 2025-01-29 08:08:29 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 23 WA * 2 TLE * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; //#include<atcoder/all> //using namespace atcoder; using ll = long long int; using ull = unsigned long long int; using ld = long double; constexpr ll MAX = 2000000000000000000; constexpr ld PI = 3.14159265358979; constexpr ll MOD = 0;//2024948111; ld dotorad(ld K){return PI * K / 180.0;} ld radtodo(ld K){return K * 180.0 / PI;} mt19937 mt; void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());} int main(){ ll P,Q,X,Y; cin >> P >> Q >> X >> Y; string y = to_string(Y); string S = y; reverse(S.begin(),S.end()); ll f = stol(S) % P; while(1){ if(f == X){ cout << S << endl; { ll p = 0; for(ll i = 0;i < (ll)S.size();i++){ p = (p * 10) % P; p += S[i] - '0'; p %= P; } if(p != X) cout << "Error" << endl; } { ll p = 0; for(ll i = (ll)S.size() - 1;i >= 0;i--){ p = (p * 10) % Q; p += S[i] - '0'; p %= Q; } if(p != Y) cout << "Error" << endl; } return 0; } S += "0"; f = (f * 10) % P; } }