Submission #620828

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6208282022-08-03 09:32:53HazemHorses (IOI15_horses)C++14
0 / 100
296 ms44740 KiB
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int M = 5e5+10;
const int MOD = 1e9+7;
LL add(LL a,LL b){
return (a+b)%MOD;
}
LL mult(LL a,LL b){
return (a*b)%MOD;
}
LL fastpow(LL n,LL k){
LL ret = 1;
while(k){
if(k&1)ret = mult(ret,n);
k /= 2;
n = mult(n,n);
}
return ret;
}
LL divide(LL a,LL b){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'long long int calc()':
horses.cpp:70:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   70 |  int last = n+1;
      |             ~^~
horses.cpp:78:29: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   78 |    vec.push_back({1,get(1,1,n,idx+1,last-1)});
      |                             ^
horses.cpp:86:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   86 |  for(int i = 1;i<vec.size();i++){
      |                ~^~~~~~~~~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:112:14: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  112 |   update(1,1,n,i,b[i]);
      |              ^
horses.cpp:112:21: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  112 |   update(1,1,n,i,b[i]);
      |                  ~~~^
horses.cpp:118:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  118 |  return calc();
      |         ~~~~^~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:130:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  130 |  return calc();
      |         ~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:136:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  136 |  update(1,1,n,pos+1,b[pos+1]);
      |             ^
horses.cpp:136:28: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  136 |  update(1,1,n,pos+1,b[pos+1]);
      |                     ~~~~~~~^
horses.cpp:138:13: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
  138 |  return calc();
      |         ~~~~^~
#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...