Submission #62412

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
624122018-07-28 11:25:09TenuunHorses (IOI15_horses)C++11
37 / 100
1581 ms43048 KiB
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
using namespace std;
int n, tr[2000000], id[500001];
ll bit[500001];
ll now=1;
vector<int>x, y;
set<int>a;
void update(int ind, int val){
if(ind==0) return;
while(ind<=500000){
bit[ind]*=val;
bit[ind]%=mod;
ind+=ind&-ind;
}
}
ll get(int ind){
if(ind<0) return 1;
ll ans=1;
while(ind>0){
ans*=bit[ind];
ans%=mod;
ind-=ind&-ind;
}
return ans;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'long long int find()':
horses.cpp:74:8: warning: declaration of 'now' shadows a global declaration [-Wshadow]
     ll now=t;
        ^~~
horses.cpp:9:4: note: shadowed declaration is here
 ll now=1;
    ^~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:101:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return find();
            ~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:115:40: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     if(x[pos]==1 && val==1) return find();
                                    ~~~~^~
horses.cpp:117:45: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         update(pos+1, (val*pw(x[pos], mod-2)%mod));
                       ~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:119:20: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         return find();
                ~~~~^~
horses.cpp:128:25: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         update(pos+1, pw(x[pos], mod-2));
                       ~~^~~~~~~~~~~~~~~
horses.cpp:131:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return find();
            ~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:137:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return find();
            ~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...