Submission #222939

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2229392020-04-14 11:38:50ngot23Deda (COCI17_deda)C++11
120 / 140
1067 ms8056 KiB
#include <bits/stdc++.h>
using namespace std;
const int N=200005;
int t[N*4], n, Q;
void update(int l, int r, int id, int u, int val) {
if(u<l || u>r) return;
if(l==r) {t[id]=val;return;}
int mid=(r+l)>>1;
update(l, mid, id*2, u, val);
update(mid+1, r, id*2+1, u, val);
t[id]=min(t[id*2], t[id*2+1]);
}
int get(int l, int r, int id, int u, int v) {
if(v<l || r<u) return int(1e9+1);
if(u<=l && r<=v) return t[id];
int mid=(r+l)>>1;
return min(get(l, mid, id*2, u, v), get(mid+1, r, id*2+1, u, v));
}
int main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
if(fopen(".inp", "r")) freopen(".inp", "r", stdin);
cin >> n >> Q;
for(int i=0 ; i<=n*4 ; ++i) t[i]=1e9+1;
for(int i=1 ; i<=Q ; ++i) {
int c, d; char x;
cin >> x >> c >> d;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

deda.cpp: In function 'int main()':
deda.cpp:36:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
                 int mid=r+l >> 1;
                         ~^~
deda.cpp:25:35: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     if(fopen(".inp", "r")) freopen(".inp", "r", stdin);
                            ~~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...