Submission #472015

# Submission time Handle Problem Language Result Execution time Memory
472015 2021-09-12T11:08:30 Z hjc4vr Baloni (COCI15_baloni) C++14
0 / 100
187 ms 26936 KB
#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 time Memory Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Incorrect 1 ms 476 KB Output isn't correct
4 Incorrect 1 ms 460 KB Output isn't correct
5 Incorrect 176 ms 25072 KB Output isn't correct
6 Incorrect 176 ms 26936 KB Output isn't correct
7 Incorrect 137 ms 23216 KB Output isn't correct
8 Incorrect 137 ms 22956 KB Output isn't correct
9 Incorrect 187 ms 24152 KB Output isn't correct
10 Incorrect 155 ms 24720 KB Output isn't correct