제출 #167385

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
1673852019-12-07 20:13:37kostia244말 (IOI15_horses)C++17
100 / 100
477 ms50336 KiB
#include "horses.h"
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
const int mod = 1e9 + 7;
const int maxn = 1<<21;
int n, t[maxn], ans = 0;
set<int> chk;
ll mulal = 1;
vi x, ix, y;
void upd(int p, int v) {
for(t[p += n] = v; p>>=1;)
t[p] = max(t[p<<1], t[p<<1|1]);
}
int get(int l, int r) {
// cout << l << " " << r << " " << n << "q\n";
int ans = 0;
for(l+=n, r+=n+1; l < r; l>>=1, r>>=1) {
if(l&1) ans = max(ans, t[l++]);
if(r&1) ans = max(ans, t[--r]);
}
// cout << ans << "q\n";
return ans;
}
int bp(int a, int p) {
int r = 1;
while(p) {
if(p&1) r = (r*1ll*a)%mod;
a = (a*1ll*a)%mod;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

horses.cpp: In function 'int get(int, int)':
horses.cpp:18:6: warning: declaration of 'ans' shadows a global declaration [-Wshadow]
  int ans = 0;
      ^~~
horses.cpp:8:17: note: shadowed declaration is here
 int n, t[maxn], ans = 0;
                 ^~~
horses.cpp: In function 'int bp(int, int)':
horses.cpp:29:24: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
   if(p&1) r = (r*1ll*a)%mod;
               ~~~~~~~~~^~~~
horses.cpp:30:16: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
   a = (a*1ll*a)%mod;
       ~~~~~~~~~^~~~
horses.cpp: In function 'int calc()':
horses.cpp:45:24: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
    ans = (tmp*1ll*pref)%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...