結果
問題 |
No.2797 Square Tile
|
ユーザー |
|
提出日時 | 2024-06-28 23:44:41 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 5,558 ms |
コンパイル使用メモリ | 307,360 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 23:44:49 |
合計ジャッジ時間 | 8,094 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 7 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll=long long; int gcd(int a,int b){ if(b==0)return a; else return gcd(b,a%b); } int main() { int a,b; cin>>a>>b; int g=gcd(a,b); a/=g;b/=g; int m=a*a+b*b; int n=m*g*g; for(int i=0;i<g;i++){ for(int j=0;j<g;j++){ for(int k=0;k<m;k++){ int x=i*g+b*k,y=j*g+a*k; cout<<x*g%n<<" "<<y*g%n<<endl; } } } for(int i=0;i<g;i++){ for(int j=0;j<g;j++){ for(int k=0;k<m;k++){ int x=i*g+b*k,y=j*g+a*k+a; cout<<x*g%n<<" "<<y*g%n<<endl; } } } return 0; }