제출 #707038

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
7070382023-03-08 10:17:44marvinthangHorses (IOI15_horses)C++17
100 / 100
578 ms51352 KiB
/*************************************
* author: marvinthang *
* created: 08.03.2023 15:25:43 *
*************************************/
#include "horses.h"
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0, _n = (n); i < _n; ++i)
template <class T> T invGeneral(T a, T b) {
a %= b;
if (!a) return b == 1 ? 0 : -1;
T x = invGeneral(b, a);
return x == -1 ? -1 : ((1 - 1LL * b * x) / a + b) % b;
}
const int MOD = 1e9 + 7;
const int MAX = 5e5 + 5;
int N, X[MAX], Y[MAX], bit[MAX], st[MAX << 2];
set <int, greater <int>> pos;
void build(int i, int l, int r) {
if (r - l == 1) {
st[i] = Y[l];
return;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

horses.cpp: In function 'void build(int, int, int)':
horses.cpp:31:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   31 |  int m = l + r >> 1;
      |          ~~^~~
horses.cpp: In function 'void update(int, int, int, int)':
horses.cpp:42:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   42 |  int m = l + r >> 1;
      |          ~~^~~
horses.cpp: In function 'int getMax(int, int, int, int, int)':
horses.cpp:51:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   51 |  int m = l + r >> 1;
      |          ~~^~~
horses.cpp: In function 'void update(int, int)':
horses.cpp:56:59: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   56 |  for (++i; i <= N; i += i & -i) bit[i] = 1LL * bit[i] * v % MOD;
      |                                          ~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int getMul(int)':
horses.cpp:61:56: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   61 |  for (++i; i > 0; i &= i - 1) res = 1LL * res * bit[i] % MOD;
      |                                     ~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int solve()':
horses.cpp:72:31: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   72 |    res = 1LL * getMul(l) * ca % MOD;
      |          ~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:73:18: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   73 |    ma = ca; mb = cb;
      |                  ^~
horses.cpp: In instantiation of 'T invGeneral(T, T) [with T = int]':
horses.cpp:98:33:   required from here
horses.cpp:17:20: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   17 |     return x == -1 ? -1 : ((1 - 1LL * b * x) / a + b) % b;
      |            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#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...