結果
問題 |
No.1819 Mirrored 2
|
ユーザー |
![]() |
提出日時 | 2022-01-21 23:07:18 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 579 bytes |
コンパイル時間 | 658 ms |
コンパイル使用メモリ | 68,520 KB |
最終ジャッジ日時 | 2025-01-27 14:25:25 |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | WA * 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 << revn << endl; cout << n; n %= p; while(n!=x){ cout << 0; (n *= 10) %= p; } cout << endl; }