Submission #965187

#TimeUsernameProblemLanguageResultExecution timeMemory
965187efedmrlrHomework (CEOI22_homework)C++17
100 / 100
169 ms148180 KiB
// #pragma GCC optimize("O3,Ofast,unroll-loops") // #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt") #include <bits/stdc++.h> using namespace std; #define lli long long int #define MP make_pair #define pb push_back #define REP(i,n) for(int i = 0; (i) < (n); (i)++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); } const double EPS = 0.00001; const int INF = 1e9+500; const int N = 3e5+5; const int ALPH = 26; const int LGN = 25; constexpr int MOD = 1e9+7; int n,m,q; array<int,3> get_inp() { // mn, mx, sub char x; cin >> x; if(x == '?') { return {0, 0, 1}; } cin >> x; bool f1 = (x == 'i'); cin >> x; cin >> x; array<int,3> l, r; l = get_inp(); cin >> x; r = get_inp(); cin >> x; array<int,3> ret; if(f1) { // min ret[0] = min(l[0], r[0]); ret[1] = l[1] + r[1]; ret[2] = l[2] + r[2]; } else { // max ret[0] = l[0] + r[0] + 1; ret[1] = max(l[2] + r[1], r[2] + l[1]); ret[2] = l[2] + r[2]; } return ret; } inline void solve() { array<int,3> res = get_inp(); cout << res[1] - res[0] + 1 << "\n"; } signed main() { fastio(); int test = 1; //cin>>test; while(test--) { solve(); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...