結果

問題 No.3003 多項式の割り算 〜hard〜
ユーザー Today03
提出日時 2025-01-17 21:52:38
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 4,459 ms
コンパイル使用メモリ 302,372 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-17 21:52:44
合計ジャッジ時間 5,221 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9 + 10;
const ll INFL = 4e18;

#include <atcoder/convolution>

int main() {
    ll A, B;
    cin >> A >> B;

    if (A == 0) {
        cout << 0 << ' ' << 0 << endl;
        return 0;
    }

    if (B % 3 == 0) {
        cout << 0 << ' ' << A << endl;
    } else if (B % 3 == 1) {
        cout << A << ' ' << 0 << endl;
    } else {
        cout << -A << ' ' << -A << endl;
    }
}
0