Submission #640019

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6400192022-09-13 09:48:40ggohHorses (IOI15_horses)C++14
100 / 100
1237 ms62760 KiB
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
#define sz(v) ((int)(v).size())
typedef long long lint;
typedef pair<int,int> pii;
int Z=1e9+7;
int n;
int po(int p,int q)
{
if(q==0)return 1;
if(q==1)return p;
int o=po(p,q/2);
o=1ll*o*o%Z;
if(q%2)o=1ll*o*p%Z;
return o;
}
struct Tree{
long double l;
int v;
}seg[1<<20];
long double lazyL[1<<20];
int lazyV[1<<20];
int XX[500005],YY[500005];
void push(int num,int s,int e)
{
seg[num].l+=lazyL[num];
if(s!=e)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int po(int, int)':
horses.cpp:15:11: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   15 |  o=1ll*o*o%Z;
      |    ~~~~~~~^~
horses.cpp:16:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   16 |  if(q%2)o=1ll*o*p%Z;
      |           ~~~~~~~^~
horses.cpp: In function 'void push(int, int, int)':
horses.cpp:36:38: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   36 |  seg[num].v=1ll*seg[num].v*lazyV[num]%Z;
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp:39:43: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   39 |   lazyV[2*num]=1ll*lazyV[2*num]*lazyV[num]%Z;
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp:40:47: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   40 |   lazyV[2*num+1]=1ll*lazyV[2*num+1]*lazyV[num]%Z;
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp: In function 'void update(int, int, int, int, int, long double, int)':
horses.cpp:51:30: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   51 |   seg[num].v=1ll*seg[num].v*z%Z;
      |              ~~~~~~~~~~~~~~~~^~
horses.cpp:56:35: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   56 |    lazyV[num*2]=1ll*lazyV[num*2]*z%Z;
      |                 ~~~~~~~~~~~~~~~~~~^~
horses.cpp:57:39: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   57 |    lazyV[num*2+1]=1ll*lazyV[num*2+1]*z%Z;
      |                   ~~~~~~~~~~~~~~~~~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:93:33: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   93 |  int mul=1ll*po(XX[pos],Z-2)*val%Z;
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:102:33: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  102 |  int mul=1ll*po(YY[pos],Z-2)*val%Z;
      |          ~~~~~~~~~~~~~~~~~~~~~~~^~
#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...