Submission #206329

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2063292020-03-03 01:25:36okoHorses (IOI15_horses)C++14
0 / 100
467 ms52960 KiB
#include "horses.h"
#include <stdio.h>
#include <stdlib.h>
#include <bits/stdc++.h>
using namespace std;
long long n,a[500500],b[500500],mod=1e9+7,tree[2005000],mxtree[2005000];
multiset<int>ms;
long long qrx(int nod,int l,int r,int x,int y)
{
if(x<=l&&r<=y)return tree[nod];
else if(r<x||y<l)return 1ll;
int mid=(l+r)/2;
return (qrx(nod*2,l,mid,x,y)*qrx(nod*2+1,mid+1,r,x,y))%mod;
}
long long qry(int nod,int l,int r,int x,int y)
{
if(x<=l&&r<=y)return mxtree[nod];
else if(r<x||y<l)return 0ll;
int mid=(l+r)/2;
return max(qry(nod*2,l,mid,x,y),qry(nod*2+1,mid+1,r,x,y));
}
long long slov()
{
long long x=1,ans=0,st;
multiset<int>::iterator it=--ms.end(),its;
while(1)
{
int i=*it;
x*=a[i];
if(x>(long long)2e9)break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'long long int slov()':
horses.cpp:38:12: warning: statement has no effect [-Wunused-value]
     for(its;its!=ms.end();its++)
            ^
horses.cpp:41:32: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         if(its==--ms.end())nxt=n;
                                ^
horses.cpp:40:20: warning: variable 'nxt' set but not used [-Wunused-but-set-variable]
         int i=*its,nxt;
                    ^~~
horses.cpp:51:19: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     ans*=qrx(1,0,n+5,0,st-1);
                  ~^~
horses.cpp:51:26: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     ans*=qrx(1,0,n+5,0,st-1);
                        ~~^~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:88:18: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         upx(1,0,n+5,i,a[i]);
                 ~^~
horses.cpp:89:18: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
         upy(1,0,n+5,i,b[i]);
                 ~^~
horses.cpp:91:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return slov();
            ~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:96:14: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     upx(1,0,n+5,pos,val);
             ~^~
horses.cpp:97:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return slov();
            ~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:102:14: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     upy(1,0,n+5,pos,val);
             ~^~
horses.cpp:103:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return slov();
            ~~~~^~
#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...