結果
問題 | No.2644 Iro Iro-Iro |
ユーザー | noya2 |
提出日時 | 2024-02-18 23:35:59 |
言語 | C++23 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,233 bytes |
コンパイル時間 | 9,635 ms |
コンパイル使用メモリ | 338,236 KB |
実行使用メモリ | 35,676 KB |
最終ジャッジ日時 | 2024-09-29 00:56:33 |
合計ジャッジ時間 | 12,540 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
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 | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
ソースコード
#include<bits/stdc++.h> #include"testlib.h" using namespace std; using ll = long long; const ll Nmin = 1, Nmax = 200'000; const ll Mmin = 1, Mmax = 200'000; const ll ABCmin = 0, ABCmax = 100; const ll XYZmin = -100, XYZmax = 100; const ll linf = 1e18; template<typename T> bool chmax(T &a, const T &b){ if (a >= b) return false; a = b; return true; } template<typename T> bool chmin(T &a, const T &b){ if (a <= b) return false; a = b; return true; } int main(){ registerValidation(); ll n = inf.readLong(Nmin,Nmax); inf.readSpace(); ll m = inf.readLong(Mmin,Mmax); inf.readEoln(); set<tuple<ll,ll,ll>> abc; ll al = linf, ar = -linf; ll bl = linf, br = -linf; ll cl = linf, cr = -linf; for (ll i = 0; i < n; i++){ ll a = inf.readLong(ABCmin,ABCmax); inf.readSpace(); ll b = inf.readLong(ABCmin,ABCmax); inf.readSpace(); ll c = inf.readLong(ABCmin,ABCmax); inf.readEoln(); abc.insert(make_tuple(a,b,c)); chmax(ar,a); chmin(al,a); chmax(br,b); chmin(bl,b); chmax(cr,c); chmin(cl,c); } ensuref((ll)(abc.size()) == n, "(A,B,C) must be distinct"); set<tuple<ll,ll,ll>> xyz; ll xl = linf, xr = -linf; ll yl = linf, yr = -linf; ll zl = linf, zr = -linf; for (ll i = 0; i < m; i++){ ll x = inf.readLong(XYZmin,XYZmax); inf.readSpace(); ll y = inf.readLong(XYZmin,XYZmax); inf.readSpace(); ll z = inf.readLong(XYZmin,XYZmax); inf.readEoln(); xyz.insert(make_tuple(x,y,z)); chmax(xr,x); chmin(xl,x); chmax(yr,y); chmin(yl,y); chmax(zr,z); chmin(zl,z); } ensuref((ll)(xyz.size()) == m, "(X,Y,Z) must be discinct"); // for (auto [a, b, c] : abc) for (auto [x, y, z] : xyz){ // ensure(ABCmin <= a+x && a+x <= ABCmax); // ensure(ABCmin <= b+y && b+y <= ABCmax); // ensure(ABCmin <= c+z && c+z <= ABCmax); // } ensure(ABCmin <= al+xl); ensure(ar+xr <= ABCmax); ensure(ABCmin <= bl+yl); ensure(br+yr <= ABCmax); ensure(ABCmin <= cl+zl); ensure(cr+zr <= ABCmax); inf.readEof(); }