제출 #340206

#제출 시각아이디문제언어결과실행 시간메모리
340206SprdaloSimple game (IZhO17_game)C++17
22 / 100
1091 ms1672 KiB
#include <bits/stdc++.h> using namespace std; #define int ll typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<double> vd; typedef vector<bool> vb; typedef vector<char> vc; typedef vector<string> vs; typedef vector<pi> vp; typedef vector<pl> vpl; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); cerr.tie(nullptr); int n, m; cin >> n >> m; vi a(n); for (auto& i : a) cin >> i; for (int e = 0; e < m; ++e){ int z; cin >> z; if (z == 1){ int pos, val; cin >> pos >> val; a[pos-1]=val; } else { int h, sol = 0; cin >> h; for (int i = 1; i < n; ++i){ if (h >= min(a[i], a[i-1]) && h <= max(a[i], a[i-1])) ++sol; } cout << sol << '\n'; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...