結果

問題 No.2797 Square Tile
ユーザー kokosei
提出日時 2024-07-06 11:06:09
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 692 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 77,724 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 11:06:12
合計ジャッジ時間 2,343 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

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 * (A - B) % L << "\n";
        }
        for(int i = 0;i < L;i++){
            cout << (i + 1) * A % L << " " << i * (A - B) % L << "\n";
        }
    }else{
        for(int i = 0;i < L;i++){
            cout << (i + 1) * B % L << " " << i * (B - A) % L << "\n";
        }
        for(int i = 0;i < L;i++){
            cout << i * B % L << " " << i * (B - A) % L << "\n";
        }
    }
    return 0;
}
0