結果
問題 | No.1819 Mirrored 2 |
ユーザー |
![]() |
提出日時 | 2022-01-21 23:08:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
OLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 553 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 67,700 KB |
最終ジャッジ日時 | 2025-01-27 14:25:44 |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 25 OLE * 1 |
ソースコード
#include <iostream> #include <string> using namespace std; typedef long long ll; ll solve(ll x){ string s; while(x){ s.push_back((char)('0' + x%10)); x /= 10; } ll ret = 0; for(int i=0;i<s.size();i++){ ret *= 10; ret += (s[i] - '0'); } return ret; } int main(){ ll i,p,q,x,y; cin >> p >> q >> x >> y; ll revn = y; while(revn%10==0) revn += q; ll n = solve(revn); cout << n; n %= p; while(n!=x){ cout << 0; (n *= 10) %= p; } cout << endl; }