제출 #466837

#제출 시각아이디문제언어결과실행 시간메모리
466837Carmel_Ab1말 (IOI15_horses)C++17
17 / 100
1584 ms11976 KiB
#include "horses.h" #include<bits/stdc++.h> using namespace std; typedef unsigned long long ll; typedef vector<ll> vl; //#include "grader.cpp" vl x,y; void chkmax(ll& ans,ll has,ll p){ ll mod=1e9+7; if(ans/p<has && ans/has<p) ans=((has)%mod*(p%mod))%mod; } int init(int n, int X[], int Y[]) { x.resize(n); y.resize(n); const ll mod=1e9+7; ll has=1,ans=0; for(int i=0; i<n; i++) x[i]=ll(1ll*X[i]),y[i]=ll(1ll*Y[i]); for(int i=0; i<n; i++){ has*=x[i]; chkmax(ans,has,y[i]); assert(ans<mod); } return int(ans); } int updateX(int pos, int val) { const ll mod=1e9+7; ll has=1,ans=0; x[pos]=ll(val); int n=x.size(); for(int i=0; i<n; i++){ has*=x[i]; chkmax(ans,has,y[i]); assert(ans<mod); } return int(ans); } int updateY(int pos, int val) { const ll mod=1e9+7; ll has=1,ans=0; y[pos]=ll(val); int n=x.size(); for(int i=0; i<n; i++){ has*=x[i]; chkmax(ans,has,y[i]); assert(ans<mod); } return int(ans); }

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

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:37:17: warning: conversion from 'std::vector<long long unsigned int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   37 |     int n=x.size();
      |           ~~~~~~^~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:50:17: warning: conversion from 'std::vector<long long unsigned int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   50 |     int n=x.size();
      |           ~~~~~~^~
#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...