Submission #541202

#TimeUsernameProblemLanguageResultExecution timeMemory
541202new_accHorses (IOI15_horses)C++14
0 / 100
29 ms8188 KiB
#include "horses.h"
#include<bits/stdc++.h>
#define fi first
#define se second
#define pitem item*
using namespace std;
typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=5e5+10;
const ll mod=1e9+7;
int t[N];
int init(int n,int x[],int y[]){
    int g=0;
    ll curr=0,akt=1;
    for(int i=0;i<n;i++){
        if(akt*(ll)y[i]>curr){
            curr=y[i],akt=1;
            g=i;
        }else akt*=(ll)x[i];
    }
    ll res=1;
    for(int i=0;i<=g;i++) (res=res*(ll)x[i])%=mod;
    (res*=(ll)y[g])%=mod;
    return res;
}
int updateX(int pos,int val){
    return 0;
}
int updateY(int pos,int val){
    return 0;
}

Compilation message (stderr)

horses.cpp: In function 'int init(int, int*, int*)':
horses.cpp:25:12: warning: conversion from 'll' {aka 'long long unsigned int'} to 'int' may change value [-Wconversion]
   25 |     return res;
      |            ^~~
horses.cpp: In function 'int updateX(int, int)':
horses.cpp:27:17: warning: unused parameter 'pos' [-Wunused-parameter]
   27 | int updateX(int pos,int val){
      |             ~~~~^~~
horses.cpp:27:25: warning: unused parameter 'val' [-Wunused-parameter]
   27 | int updateX(int pos,int val){
      |                     ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:30:17: warning: unused parameter 'pos' [-Wunused-parameter]
   30 | int updateY(int pos,int val){
      |             ~~~~^~~
horses.cpp:30:25: warning: unused parameter 'val' [-Wunused-parameter]
   30 | 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...