제출 #91397

#제출 시각아이디문제언어결과실행 시간메모리
91397emil_physmathSimple game (IZhO17_game)C++14
22 / 100
1066 ms1644 KiB
#include <iostream> #include <stdio.h> using namespace std; int h[100005]; int main() { int n, m; cin>>n>>m; for (int i=0; i<n; i++) cin>>h[i]; while (m--) { int type; cin>>type; if (type==1) { int pos, val; cin>>pos>>val; h[pos-1]=val; } else { int H, ans=0; cin>>H; char curState='0'; for (int i=0; i<n; i++) if (h[i]<H) { if (curState=='>') ans++; curState='<'; } else { if (curState=='<') ans++; curState='>'; } cout<<ans<<'\n'; } } char I; cin >> I; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...