Submission #135417

#TimeUsernameProblemLanguageResultExecution timeMemory
135417BoxworldHorses (IOI15_horses)C++14
0 / 100
1566 ms8204 KiB
#include "horses.h" #include <bits/stdc++.h> using namespace std; const long long bignum=1e9+7; struct year{int x,y;}a[500100]; int n; int cnt(){ long long ans=0,m=0,ho=1,tmp=1; ans=a[0].x*a[0].y%bignum; for (int i=0;i<n;i++){ ho=ho*a[i].x%bignum; tmp=tmp*a[i].x&bignum; if (a[m].y<a[i].y*tmp){ ans=ho*a[i].y%bignum; m=i;tmp=1; } } return ans; } int init(int N, int X[], int Y[]){ n=N; for (int i=0;i<n;i++){a[i].x=X[i];a[i].y=Y[i];} return cnt(); } int updateX(int pos, int val) { a[pos].x=val; return cnt(); } int updateY(int pos, int val) { a[pos].y=val; return cnt(); }

Compilation message (stderr)

horses.cpp: In function 'int cnt()':
horses.cpp:18:12: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
     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...