結果
問題 |
No.2797 Square Tile
|
ユーザー |
|
提出日時 | 2024-06-28 22:35:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 991 bytes |
コンパイル時間 | 2,825 ms |
コンパイル使用メモリ | 243,028 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 22:35:25 |
合計ジャッジ時間 | 4,220 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 13 WA * 8 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int INF = 1<<30; const long long INFLL = 1LL<<60; const int MOD = 998244353; int a, b; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> a >> b; int c = a * a + b * b; int x = 0; int y = 0; if (a >= b){ for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + a) % c; y = (y + b) % c; } x = a; y = 0; for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + a) % c; y = (y + b) % c; } } else{ for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + b) % c; y = (y + a) % c; } x = 0; y = a; for (int i = 0; i < c; i++){ cout << x << " " << y << '\n'; x = (x + b) % c; y = (y + a) % c; } } }