結果

問題 No.2797 Square Tile
ユーザー kokoseikokosei
提出日時 2024-07-06 11:10:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 668 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 77,568 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 11:11:00
合計ジャッジ時間 1,996 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
using ll = long long;

int A, B;
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> A >> B;
    int L = A * A + B * B;
    if(A >= B){
        for(int i = 0;i < L;i++){
            cout << i * A % L << " " << i * B % L << "\n";
        }
        for(int i = 0;i < L;i++){
            cout << (i + 1) * A % L << " " << i * B % L << "\n";
        }
    }else{
        for(int i = 0;i < L;i++){
            cout << (i + 1) * B % L << " " << i * A % L << "\n";
        }
        for(int i = 0;i < L;i++){
            cout << i * B % L << " " << i * A % L << "\n";
        }
    }
    return 0;
}
0