제출 #174615

#제출 시각아이디문제언어결과실행 시간메모리
174615mat_v말 (IOI15_horses)C++14
17 / 100
35 ms16184 KiB
#include <bits/stdc++.h>
#include "horses.h"
#define mod 1000000007
#define maxn 500005
using namespace std;
typedef long long ll;
ll add(ll x, ll y){
    return (x + y)%mod;
}
ll mul(ll x, ll y){
    return (x * y)%mod;
}
ll power(ll x, ll y){
    if(y == 0)return 1;
    ll pola = power(x, y / 2);
    pola = mul(pola, pola);
    if(y%2 == 1)pola = mul(pola, x);
    return pola;
}

int n;
ll x[maxn];
ll y[maxn];


int init(int N, int X[], int Y[]) {
	n = N;
    for(int i=1; i<=n; i++){
        x[i] = X[i - 1];
        y[i] = Y[i - 1];
    }
    ll res = 0;
    ll p = 1;
    for(int i=1; i<=n; i++){
        p *= x[i];
        res = max(res, p * y[i]);
    }
	return res;
}

int updateX(int pos, int val) {
	return 0;
}

int updateY(int pos, int val) {
	return 0;
}

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

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:38:9: warning: conversion to 'int' from 'll {aka long long int}' may alter its value [-Wconversion]
  return res;
         ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:41:17: warning: unused parameter 'pos' [-Wunused-parameter]
 int updateX(int pos, int val) {
                 ^~~
horses.cpp:41:26: warning: unused parameter 'val' [-Wunused-parameter]
 int updateX(int pos, int val) {
                          ^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:45:17: warning: unused parameter 'pos' [-Wunused-parameter]
 int updateY(int pos, int val) {
                 ^~~
horses.cpp:45:26: warning: unused parameter 'val' [-Wunused-parameter]
 int updateY(int pos, int val) {
                          ^~~
#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...