제출 #466786

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

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:23:12: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   23 |     return ans;
      |            ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:29:17: warning: conversion from 'std::vector<long long int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   29 |     int n=x.size();
      |           ~~~~~~^~
horses.cpp:35:12: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   35 |     return ans;
      |            ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:41:17: warning: conversion from 'std::vector<long long int>::size_type' {aka 'long unsigned int'} to 'int' may change value [-Wconversion]
   41 |     int n=x.size();
      |           ~~~~~~^~
horses.cpp:48:12: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   48 |     return ans;
      |            ^~~
#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...