제출 #886293

#제출 시각아이디문제언어결과실행 시간메모리
886293boris_mihovSimple game (IZhO17_game)C++17
0 / 100
1 ms604 KiB
#include <algorithm> #include <iostream> #include <numeric> #include <cassert> #include <bitset> #include <vector> typedef long long llong; const int MAXS = 250000 + 10; const int MAXN = 500 + 10; const int MOD = 1e9 + 13; int n, q; int a[MAXN]; void solve() { for (int i = 1 ; i <= n ; ++i) { int qType, pos, val; std::cin >> qType; if (qType == 1) { std::cin >> pos >> a[pos]; continue; } int count = 0; std::cin >> val; for (int j = 2 ; j <= n ; ++j) { if ((a[j] >= val) ^ (a[j - 1] >= val)) { count++; } } std::cout << count << '\n'; } } void input() { std::cin >> n >> q; for (int i = 1 ; i <= n ; ++i) { std::cin >> a[i]; } } void fastIOI() { std::ios_base :: sync_with_stdio(0); std::cout.tie(nullptr); std::cin.tie(nullptr); } int main() { fastIOI(); input(); solve(); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...