結果
問題 | No.2797 Square Tile |
ユーザー | Red_Black_GPGPU |
提出日時 | 2024-09-22 22:31:06 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,980 bytes |
コンパイル時間 | 1,929 ms |
コンパイル使用メモリ | 175,548 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 22:31:10 |
合計ジャッジ時間 | 3,345 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,948 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
コンパイルメッセージ
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 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; } string ans1=""; string ans2=""; ll x=0,y=0; ll aa=a,bb=b; if (b>a)swap(aa,bb); ll x2=aa,y2=aa-bb; REP(i,n){ ans1+=""+to_string(y)+" "+to_string(x)+"\n"; ans2+=""+to_string(y2)+" "+to_string(x2)+"\n"; x=(x+bb)%n; y=(y+aa)%n; x2=(x2+bb)%n; y2=(y2+aa)%n; } if (b>a)swap(ans1,ans2); cout<<ans1<<ans2<<endl; return 0; }