제출 #418580

#제출 시각아이디문제언어결과실행 시간메모리
418580Chaska말 (IOI15_horses)C++11
17 / 100
1581 ms8116 KiB
#include "horses.h" #include <bits/stdc++.h> #define fo(a,b,c) for (int a=b;a<=c;a++) using namespace std; const int MAXN = 5e5+5,mod = 1e9+7; typedef long long ll; int n,x[MAXN],y[MAXN]; int sol() { ll k = 0; ll res = -1; ll q=1; fo(i,max(0,n-1-35),n-1) { q *= x[i]; if (k<=q) { res = i; k = y[i]; q = 1; } else { q *= y[i]; if (k<=q) { res = i; k = y[i]; q = 1; } else { q /= y[i]; } } } ll r = 1; fo(i,0,res) { r *= x[i]; r %= mod; } r *= y[res]; r %= mod; return r; } int init(int N, int X[], int Y[]) { n = N; fo(i,0,n-1) x[i] = X[i]; fo(i,0,n-1) y[i] = Y[i]; return sol(); } int updateX(int pos, int val) { x[pos] = val; return sol(); } int updateY(int pos, int val) { y[pos] = val; return sol(); }

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

horses.cpp: In function 'int sol()':
horses.cpp:37:9: warning: conversion from 'll' {aka 'long long int'} to 'int' may change value [-Wconversion]
   37 |  return r;
      |         ^
#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...