제출 #74339

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
743392018-08-31 10:50:52imeimi2000Horses (IOI15_horses)C++14
100 / 100
704 ms276804 KiB
#include "horses.h"
#include <set>
using namespace std;
typedef long long llong;
int n;
int x[500001];
int y[500001];
set<int> mp;
int seg[1 << 20];
void initSeg(int i, int s, int e) {
if (s == e) {
seg[i] = y[s];
return;
}
int m = (s + e) / 2;
initSeg(i << 1, s, m);
initSeg(i << 1 | 1, m + 1, e);
seg[i] = max(seg[i << 1], seg[i << 1 | 1]);
}
void update(int i, int s, int e, int x) {
if (s == e) {
seg[i] = y[x];
return;
}
int m = (s + e) / 2;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

horses.cpp: In function 'void update(int, int, int, int)':
horses.cpp:25:39: warning: declaration of 'x' shadows a global declaration [-Wshadow]
 void update(int i, int s, int e, int x) {
                                       ^
horses.cpp:8:5: note: shadowed declaration is here
 int x[500001];
     ^
horses.cpp: In function 'int query(int, int, int, int, int)':
horses.cpp:36:44: warning: declaration of 'y' shadows a global declaration [-Wshadow]
 int query(int i, int s, int e, int x, int y) {
                                            ^
horses.cpp:9:5: note: shadowed declaration is here
 int y[500001];
     ^
horses.cpp:36:44: warning: declaration of 'x' shadows a global declaration [-Wshadow]
 int query(int i, int s, int e, int x, int y) {
                                            ^
horses.cpp:8:5: note: shadowed declaration is here
 int x[500001];
     ^
horses.cpp: In function 'int pw(int, int)':
horses.cpp:45:20: warning: declaration of 'x' shadows a global declaration [-Wshadow]
 int pw(int x, int p) {
                    ^
horses.cpp:8:5: note: shadowed declaration is here
 int x[500001];
     ^
horses.cpp:48:41: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
         if (p & 1) ret = (llong)ret * x % mod;
                          ~~~~~~~~~~~~~~~^~~~~
horses.cpp:49:26: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
         x = (llong)x * x % mod;
             ~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'void init()':
horses.cpp:59:53: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
         if (j <= n) fen[j] = (llong)fen[j] * fen[i] % mod;
                              ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'void update(int, int)':
horses.cpp:63:25: warning: declaration of 'x' shadows a global declaration [-Wshadow]
 void update(int i, int x) {
                         ^
horses.cpp:8:5: note: shadowed declaration is here
 int x[500001];
     ^
horses.cpp:65:36: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
         fen[i] = (llong)fen[i] * x % mod;
                  ~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int query(int)':
horses.cpp:73:35: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
         ret = (llong)ret * fen[i] % mod;
               ~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int get()':
horses.cpp:94:55: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
     return (llong)query(mxi) * query(1, 1, n, mxi, n) % mod;
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:110:50: warning: conversion to 'int' from 'llong {aka long long int}' may alter its value [-Wconversion]
     update(pos, (llong)val * pw(x[pos], mod - 2) % mod);
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp: In function 'int get()':
horses.cpp:94:37: warning: 'mxi' may be used uninitialized in this function [-Wmaybe-uninitialized]
     return (llong)query(mxi) * query(1, 1, n, mxi, n) % mod;
                                ~~~~~^~~~~~~~~~~~~~~~~
#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...