結果
問題 | No.2797 Square Tile |
ユーザー | Red_Black_GPGPU |
提出日時 | 2024-09-22 22:47:35 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 3,105 bytes |
コンパイル時間 | 1,971 ms |
コンパイル使用メモリ | 175,708 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 22:47:43 |
合計ジャッジ時間 | 4,097 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,812 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,940 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 7 ms
6,944 KB |
testcase_05 | AC | 6 ms
6,944 KB |
testcase_06 | AC | 4 ms
6,944 KB |
testcase_07 | RE | - |
testcase_08 | AC | 3 ms
6,940 KB |
testcase_09 | AC | 4 ms
6,940 KB |
testcase_10 | AC | 5 ms
6,944 KB |
testcase_11 | AC | 4 ms
6,944 KB |
testcase_12 | AC | 3 ms
6,940 KB |
testcase_13 | RE | - |
testcase_14 | AC | 4 ms
6,944 KB |
testcase_15 | RE | - |
testcase_16 | RE | - |
testcase_17 | AC | 2 ms
6,944 KB |
testcase_18 | RE | - |
testcase_19 | AC | 4 ms
6,940 KB |
testcase_20 | RE | - |
testcase_21 | RE | - |
testcase_22 | AC | 2 ms
6,944 KB |
コンパイルメッセージ
main.cpp:20:17: warning: integer constant is so large that it is unsigned 20 | const ll llMIN=-9223372036854775808LL; | ^~~~~~~~~~~~~~~~~~~~~
ソースコード
#include "bits/stdc++.h" #include <atcoder/modint> using namespace std; using namespace atcoder; #define REP(i, n) for(ll i = 0;i < n;i++) #define ll long long //#define MOD 998244353LL #define MOD 1000000007LL //using mint = modint998244353; //using mint = modint1000000007; #define chmax(a,b) if ((a)<(b))a=(b); #define chmin(a,b) if ((a)>(b))a=(b); #define doublecout(a) cout<<setprecision(16)<<a<<endl; using vi = vector<ll>; // intの1次元の型に vi という別名をつける using vvi = vector<vi>; // intの2次元の型に vvi という別名をつける using vvvi = vector<vvi>; // intの2次元の型に vvi という別名をつける const ll llMAX=9223372036854775807LL; const ll llMIN=-9223372036854775808LL; #ifdef LOCAL #define dbg(x_) cerr << "?" << __LINE__ << ":" << #x_ << ":\t" << x_ << endl; #define print1(a0_) cerr << "?" << __LINE__ << ":" << #a0_ << "=" << a0_ << endl; #define print2(a0_,a1_) cerr << "?" << __LINE__ << ":" << #a0_ << "=" << a0_ << "," << #a1_ << "=" << a1_ << endl; #define print3(a0_,a1_,a2_) cerr << "?" << __LINE__ << ":" << #a0_ << "=" << a0_ << "," << #a1_ << "=" << a1_ << "," << #a2_ << "=" << a2_ << endl; #define print4(a0_,a1_,a2_,a3_) cerr << "?" << __LINE__ << ":" << #a0_ << "=" << a0_ << "," << #a1_ << "=" << a1_ << "," << #a2_ << "=" << a2_ << "," << #a3_ << "=" << a3_ << endl; #define print5(a0_,a1_,a2_,a3_,a4_) cerr << "?" << __LINE__ << ":" << #a0_ << "=" << a0_ << "," << #a1_ << "=" << a1_ << "," << #a2_ << "=" << a2_ << "," << #a3_ << "=" << a3_ << "," << #a4_ << "=" << a4_ << endl; #else #define dbg(...) #define print1(...) #define print2(...) #define print3(...) #define print4(...) #define print5(...) #endif template<typename T1, typename T2> ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<","<<p.second<<")"; } // vector template<typename T> ostream &operator<<(ostream &s, const vector<T> &v) { int len=v.size(); for(int i=0; i<len; ++i) { s<<v[i]; if (i<len-1) s<<"\t"; } return s; } // 2 dimentional vector template<typename T> ostream &operator<<(ostream &s, const vector<vector<T> > &vv) { s<<endl; int len=vv.size(); for(int i=0; i<len; ++i) s<<vv[i]<<endl; return s; } template<typename T1, typename T2> ostream &operator<<(ostream &s, const map<T1,T2> &mp) { int len=mp.size(); for(auto t:mp) s<<t<<" "; return s; } void No() { cout << "-1" << endl; exit(0); } ll gcd(ll a,ll b){ ll r = a % b; while(r!=0LL){ a = b; b = r; r = a % b; } return b; } ll n,k,x,y; int main(){ ll ans=0,a,b; cin >> a >> b; ll n=a*a+b*b; if (a==b){ REP(i,a*2){ REP(j,a*2){ cout<<a*i<<" "<<a*j<<endl; } } return 0; } assert(gcd(a,b)==1); string ans1=""; string ans2=""; ll x=0,y=0; ll aa=a,bb=b; if (b>a)swap(aa,bb); ll x2=aa-bb,y2=aa; REP(i,n){ ans1+=""+to_string(x)+" "+to_string(y)+"\n"; ans2+=""+to_string(x2)+" "+to_string(y2)+"\n"; x=(x+aa)%n; y=(y+bb)%n; x2=(x2+aa)%n; y2=(y2+bb)%n; } if (b>a)swap(ans1,ans2); cout<<ans1<<ans2; return 0; }