Submission #472015

#TimeUsernameProblemLanguageResultExecution timeMemory
472015hjc4vrBaloni (COCI15_baloni)C++14
0 / 100
187 ms26936 KiB
#include <bits/stdc++.h> #define int long long #define pp pair <bool,int> #define ppi pair <int,int> #define tp tuple <int,int,int,bool> #define c1(x) cin >> x #define c2(x,y) cin >> x >> y #define c3(x,y,z) cin >> x >> y >> z #define c4(x,y,z,f) cin>> x >> y >> z >> f #define mp(a,b) make_pair(a,b) //typedef long long ll; int power(int a,int b){ int result=1; while (b>0){ if (b%2==1) result *= a; a = a*a; b /= 2; } return result; } // power(2,3) = 8; using namespace std; int dp[200000]; struct func{ int m,c; int operator () (int x) const{ return m*x + c; } func (int mm,int cc){ m=mm,c=cc; } }; struct node{ // how to delay int s,e; func f={0,1000000009}; node *l,*r; node(int ss,int ee){ s = ss, e =ee; int m = (s+e)/2; if (s==e){ l=r=NULL; }else{ l = new node(s,m); r = new node(m+1,e); } } int query(int x){ if (s==e) return f(x); int m=(s+e)/2; int ans = f(x); if (x>m) ans = min(ans,r->query(x)); else if (x<=m) ans = min(ans,l->query(x)); return ans; } void update(func n){ int m = (s+e)/2; bool mid = n(m) < f(m); bool start = n(s) < f(s); if (mid){ swap(n,f); } if (s==e) return; if (!mid==start){ l->update(n); }else{ r->update(n); } } } *root; bool yea[100005]; int parent[100005]; string ans=""; int n,k; void findp(int x){ if (parent[x]==x){ if (yea[x]){ ans += to_string(k); }else{ ans += "0"; } return; } findp(parent[x]); if (yea[x]){ ans += to_string(k); }else{ ans += "0"; } } int LOG=19; int spt[500005][20]; int ps[500005],ps1[500005]; int query(int l,int r){ int length = r-l+1; int le = log2(length); //2 return max(spt[l][le],spt[r-(1<<(le))+1][le]); } struct fraction{ int a,b,car1,car2; // a = (x2-x1), b = (v2-v1) bool operator > (const fraction &f) const { return (a)*(f.b) > (f.a)*(b); } }; multiset<fraction,greater<fraction>> st; pair<int,ppi> arr[250005]; int pos[250005]; void solve(){ int n;cin>>n; unordered_map<int,bool> mp; for (int i=0;i<n;++i){ int a;cin>>a; mp[a+i] = true; } cout << mp.size(); } int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...