結果
問題 |
No.2797 Square Tile
|
ユーザー |
|
提出日時 | 2024-06-28 23:52:04 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 763 bytes |
コンパイル時間 | 5,273 ms |
コンパイル使用メモリ | 308,000 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-28 23:52:11 |
合計ジャッジ時間 | 6,041 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 7 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; #define int long long using ll=long long; int gcd(int a,int b){ if(b==0)return a; else return gcd(b,a%b); } signed 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; }