結果
問題 | No.2797 Square Tile |
ユーザー | Red_Black_GPGPU |
提出日時 | 2024-09-22 22:43:02 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,974 bytes |
コンパイル時間 | 1,858 ms |
コンパイル使用メモリ | 175,744 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-22 22:43:12 |
合計ジャッジ時間 | 3,631 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 6 ms
6,940 KB |
testcase_05 | AC | 6 ms
6,948 KB |
testcase_06 | AC | 4 ms
6,940 KB |
testcase_07 | WA | - |
testcase_08 | AC | 2 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 | 4 ms
6,940 KB |
testcase_13 | WA | - |
testcase_14 | AC | 4 ms
6,944 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | AC | 2 ms
6,944 KB |
testcase_18 | WA | - |
testcase_19 | AC | 4 ms
6,944 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | AC | 3 ms
6,940 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 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<<"x"<<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-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; }