제출 #1039456

#제출 시각아이디문제언어결과실행 시간메모리
1039456HappyCapybaraHorses (IOI15_horses)C++17
0 / 100
1558 ms8028 KiB
#include "horses.h" #include<bits/stdc++.h> using namespace std; #define ll long long int n; vector<int> x, y; int init(int N, int X[], int Y[]){ n = N; x.resize(N); y.resize(N); for (int i=0; i<N; i++){ y[i] = Y[i]; x[i] = X[i]; } double curd = 0, bsfd = 0; ll cur = 1, bsf = 0; for (int i=0; i<N; i++){ curd += log(x[i]); cur = (cur*x[i]) % 1000000007; if (curd+log(Y[i]) > bsfd){ bsfd = curd+log(Y[i]); bsf = (cur*y[i]) % 1000000007; } } return bsf; } int updateX(int pos, int val){ x[pos] = val; double curd = 0, bsfd = 0; ll cur = 1, bsf = 0; for (int i=0; i<n; i++){ curd += log(x[i]); cur = (cur*x[i]) % 1000000007; if (curd+log(y[i]) > bsfd){ bsfd = curd+log(y[i]); bsf = (cur*y[i]) % 1000000007; } } return bsf; } int updateY(int pos, int val){ y[pos] = val; double curd = 0, bsfd = 0; ll cur = 1, bsf = 0; for (int i=0; i<n; i++){ curd += log(x[i]); cur = (cur*x[i]) % 1000000007; if (curd+log(y[i]) > bsfd){ bsfd = curd+log(y[i]); bsf = (cur*y[i]) % 1000000007; } } return bsf; }

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:29:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   29 |  return bsf;
      |         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:45:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   45 |  return bsf;
      |         ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:61:9: warning: conversion from 'long long int' to 'int' may change value [-Wconversion]
   61 |  return bsf;
      |         ^~~
#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...