結果
問題 | No.2978 Lexicographically Smallest and Largest Subarray |
ユーザー | tko919 |
提出日時 | 2024-12-02 00:08:10 |
言語 | C++23(gcc13) (gcc 13.2.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,611 bytes |
コンパイル時間 | 5,625 ms |
コンパイル使用メモリ | 276,676 KB |
実行使用メモリ | 25,728 KB |
平均クエリ数 | 1499.00 |
最終ジャッジ日時 | 2024-12-02 00:08:30 |
合計ジャッジ時間 | 18,828 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 160 ms
25,452 KB |
testcase_01 | AC | 167 ms
24,812 KB |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 157 ms
24,568 KB |
testcase_08 | AC | 161 ms
24,824 KB |
testcase_09 | AC | 165 ms
25,208 KB |
testcase_10 | AC | 153 ms
25,064 KB |
testcase_11 | AC | 159 ms
25,208 KB |
testcase_12 | AC | 153 ms
25,208 KB |
testcase_13 | AC | 159 ms
24,824 KB |
testcase_14 | AC | 158 ms
24,824 KB |
testcase_15 | AC | 153 ms
24,824 KB |
testcase_16 | AC | 160 ms
25,208 KB |
testcase_17 | AC | 154 ms
25,208 KB |
testcase_18 | AC | 182 ms
24,824 KB |
testcase_19 | AC | 160 ms
24,568 KB |
testcase_20 | AC | 156 ms
25,208 KB |
testcase_21 | AC | 157 ms
24,824 KB |
testcase_22 | AC | 158 ms
25,208 KB |
testcase_23 | AC | 160 ms
24,808 KB |
testcase_24 | AC | 187 ms
25,208 KB |
testcase_25 | AC | 160 ms
25,064 KB |
testcase_26 | AC | 158 ms
24,824 KB |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | WA | - |
testcase_37 | AC | 160 ms
24,824 KB |
testcase_38 | AC | 166 ms
25,208 KB |
testcase_39 | AC | 156 ms
24,568 KB |
testcase_40 | AC | 160 ms
24,812 KB |
testcase_41 | AC | 156 ms
24,568 KB |
testcase_42 | AC | 183 ms
25,592 KB |
testcase_43 | AC | 161 ms
25,208 KB |
testcase_44 | WA | - |
testcase_45 | AC | 157 ms
24,824 KB |
testcase_46 | AC | 159 ms
24,836 KB |
testcase_47 | WA | - |
testcase_48 | WA | - |
testcase_49 | AC | 159 ms
24,568 KB |
testcase_50 | AC | 156 ms
25,220 KB |
testcase_51 | AC | 159 ms
25,476 KB |
testcase_52 | AC | 159 ms
25,220 KB |
testcase_53 | AC | 170 ms
25,220 KB |
testcase_54 | AC | 185 ms
24,836 KB |
testcase_55 | AC | 155 ms
24,836 KB |
testcase_56 | AC | 159 ms
25,220 KB |
ソースコード
#line 1 "library/Template/template.hpp" #include <bits/stdc++.h> using namespace std; #define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--) #define ALL(v) (v).begin(), (v).end() #define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end()) #define SZ(v) (int)v.size() #define MIN(v) *min_element(ALL(v)) #define MAX(v) *max_element(ALL(v)) #define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin()) #define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin()) using uint = unsigned int; using ll = long long int; using ull = unsigned long long; using i128 = __int128_t; using u128 = __uint128_t; const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; template <typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; } template <typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; } template <typename T, typename U> T ceil(T x, U y) { assert(y != 0); if (y < 0) x = -x, y = -y; return (x > 0 ? (x + y - 1) / y : x / y); } template <typename T, typename U> T floor(T x, U y) { assert(y != 0); if (y < 0) x = -x, y = -y; return (x > 0 ? x / y : (x - y + 1) / y); } template <typename T> int popcnt(T x) { return __builtin_popcountll(x); } template <typename T> int topbit(T x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } template <typename T> int lowbit(T x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << "P(" << p.first << ", " << p.second << ")"; return os; } template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) { os << "{"; for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : ", "); } os << "}"; return os; } template <typename T, typename U> ostream &operator<<(ostream &os, const map<T, U> &map_var) { os << "{"; for (auto itr = map_var.begin(); itr != map_var.end(); itr++) { os << "(" << itr->first << ", " << itr->second << ")"; itr++; if (itr != map_var.end()) os << ", "; itr--; } os << "}"; return os; } template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) { os << "{"; for (auto itr = set_var.begin(); itr != set_var.end(); itr++) { os << *itr; ++itr; if (itr != set_var.end()) os << ", "; itr--; } os << "}"; return os; } #ifdef LOCAL #define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__) #else #define show(...) true #endif template <typename T> void _show(int i, T name) { cerr << '\n'; } template <typename T1, typename T2, typename... T3> void _show(int i, const T1 &a, const T2 &b, const T3 &...c) { for (; a[i] != ',' && a[i] != '\0'; i++) cerr << a[i]; cerr << ":" << b << " "; _show(i + 1, a, c...); } #line 2 "sol.cpp" // #include "Utility/fastio.hpp" bool ask(int L1, int R1, int L2, int R2) { cout << "? " << L1 + 1 << ' ' << R1 << ' ' << L2 + 1 << ' ' << R2 << endl; int x; cin >> x; return x; } int main() { int n, Q; cin >> n >> Q; vector<int> a(n); iota(ALL(a), 0); auto [_mi, _ma] = minmax_element( ALL(a), [&](int i, int j) { return ask(i, i + 1, j, j + 1); }); int mi = *_mi, ma = *_ma; cout << "! " << mi + 1 << ' ' << mi + 1 << ' ' << ma + 1 << ' ' << n << endl; return 0; }