제출 #206106

#제출 시각아이디문제언어결과실행 시간메모리
206106Segtree말 (IOI15_horses)C++14
0 / 100
1595 ms12152 KiB
#include"horses.h" #include<iostream> #include<algorithm> #include<vector> #include<queue> using namespace std; typedef long long ll; #define chmin(a,b) a=min(a,b) #define chmax(a,b) a=max(a,b) #define all(x) x,begin(),x.end() #define rep(i,n) for(int i=0;i<n;i++) #define mod 1000000007 #define mad(a,b) a=(a+b)%mod ll N,X[500010],Y[500010]; int solve(){ ll rui=1,p; ll id=N-1; for(int i=N-1;i>0;i--){ rui*=X[i]; if(rui*Y[id]<Y[i])id=i; if(rui>(ll)2e9)break; } ll ans=1; for(int i=0;i<=id;i++)ans=ans*X[i]%mod; ans=ans*Y[id]%mod; return ans; } int init(int n,int x[],int y[]){ N=n; rep(i,N)X[i]=x[i],Y[i]=y[i]; return solve(); } int updateX(int pos,int val){ X[pos]=val; return solve(); } int updateY(int pos,int val){ Y[pos]=val; return solve(); }/* int main(){ cin>>N; rep(i,N)cin>>X[i]; rep(i,N)cin>>Y[i]; N=1000; rep(i,N)X[i]=1; rep(i,N)Y[i]=rand()%(ll)1e9+1; cout<<init(N,X,Y)<<endl; while(1){ string type; ll pos,val; cin>>type>>pos>>val; if(type=="X")cout<<updateX(pos,val)<<endl; if(type=="Y")cout<<updateY(pos,val)<<endl; } }*/

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

horses.cpp: In function 'int solve()':
horses.cpp:18:13: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  for(int i=N-1;i>0;i--){
            ~^~
horses.cpp:26:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return ans;
         ^~~
horses.cpp:16:11: warning: unused variable 'p' [-Wunused-variable]
  ll rui=1,p;
           ^
#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...