結果

問題 No.2797 Square Tile
ユーザー kentikenti
提出日時 2024-06-28 22:55:57
言語 C++23(gcc13)
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 728 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 22:56:00
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 55 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 28 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 7 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 36 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 22 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 27 ms
5,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 25 ms
5,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
typedef pair<int, int> P;

const int MAX_N = 20000;
int A, B;
P ans1[MAX_N], ans2[MAX_N];

int main() {
    cin >> A >> B;
    int sq = A * A + B * B;
    if (A > B)
        swap(A, B);
    for (int i = 0; i < sq; i++) {
        ans2[i].first = B * i % sq;
        ans2[i].second = A * i % sq;
    }
    for (int i = 0; i < sq; i++) {
        ans1[i].first = ans2[i].first;
        ans1[i].second = (ans2[i].second + sq - A) % sq;
    }
    if (A > B)
        swap(ans1, ans2);
    for (int i = 0; i < sq; i++)
        cout << ans1[i].first << " " << ans1[i].second << endl;
    for (int i = 0; i < sq; i++)
        cout << ans2[i].first << " " << ans2[i].second << endl;
    return 0;
}
0