結果
| 問題 | No.3454 Zodiac |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-28 13:42:09 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 569 bytes |
| 記録 | |
| コンパイル時間 | 3,026 ms |
| コンパイル使用メモリ | 332,516 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-02-28 13:42:13 |
| 合計ジャッジ時間 | 3,959 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bool chmax(auto &a, auto b) { return a < b ? a = b, 1 : 0; }
bool chmin(auto &a, auto b) { return a > b ? a = b, 1 : 0; }
int main() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
int P, Q, y, p, q, Y;
cin >> P >> Q >> y >> p >> q >> Y;
--p, --q;
int d = Y - y;
if (d >= 0) {
cout << (p + d) % P + 1 << ' ' << (q + d) % Q + 1 << '\n';
} else {
d = -d;
cout << (p + P - (d % P)) % P + 1 << ' ' << (q + Q - (d % Q)) % Q + 1 << '\n';
}
}