結果

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

ソースコード

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