Submission #225567

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2255672020-04-20 21:38:48nickmet2004Horses (IOI15_horses)C++11
100 / 100
780 ms40576 KiB
#include "horses.h"
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 500005;
const ll mod = 1e9 + 7;
int n;
set<int> changes;
vector<int> x , y;
ll xmult = 1;
int T[1 << 20];
ll Pow(ll a, ll p)
{
if (p == 0) return 1;
if (p & 1) return (a * Pow(a, p - 1)) % mod;
return Pow((a * a) % mod, p / 2);
}
inline ll Inv(ll a) {return Pow(a % mod, mod - 2);}
void upd(int idx , int v , int l = 0 , int r = n - 1 , int pos = 0){
if(l == r){
T[pos] = v;
return;
}
int mid = (l + r) >> 1;
if(idx <= mid) upd(idx , v , l , mid , pos * 2 + 1);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

horses.cpp: In function 'int solve()':
horses.cpp:57:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     return res = (res * xmult) % mod;
            ~~~~^~~~~~~~~~~~~~~~~~~~~
horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:59:35: warning: declaration of 'N' shadows a global declaration [-Wshadow]
 int init(int N , int X[] , int Y[]){
                                   ^
horses.cpp:7:11: note: shadowed declaration is here
 const int N = 500005;
           ^
#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...