Submission #307259

#TimeUsernameProblemLanguageResultExecution timeMemory
307259vipghn2003말 (IOI15_horses)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>

using namespace std;

long long init(int N,int X[],int Y[])
{
    long long res;
    for(int i=0;i<N;i++)
    {
        long long cur=1;
        int id=-1;
        for(int j=i+1;j<N;j++)
        {
            cur*=X[j];
            if(cur*Y[j]>=Y[i])
            {
                id=j;
                break;
            }
        }
        if(id==-1)
        {
            res=y[i];
            for(int j=0;j<=i;j++) res*=x[i];
        }
        else i=j-1;
    }
    return res;
}

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

long long updateY(int pos,int val)
{
    return 0;
}
/*
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

}
*/

Compilation message (stderr)

horses.cpp: In function 'long long int init(int, int*, int*)':
horses.cpp:23:17: error: 'y' was not declared in this scope
   23 |             res=y[i];
      |                 ^
horses.cpp:24:40: error: 'x' was not declared in this scope
   24 |             for(int j=0;j<=i;j++) res*=x[i];
      |                                        ^
horses.cpp:26:16: error: 'j' was not declared in this scope
   26 |         else i=j-1;
      |                ^
horses.cpp: In function 'long long int updateX(int, int)':
horses.cpp:31:23: warning: unused parameter 'pos' [-Wunused-parameter]
   31 | long long updateX(int pos,int val)
      |                   ~~~~^~~
horses.cpp:31:31: warning: unused parameter 'val' [-Wunused-parameter]
   31 | long long updateX(int pos,int val)
      |                           ~~~~^~~
horses.cpp: In function 'long long int updateY(int, int)':
horses.cpp:36:23: warning: unused parameter 'pos' [-Wunused-parameter]
   36 | long long updateY(int pos,int val)
      |                   ~~~~^~~
horses.cpp:36:31: warning: unused parameter 'val' [-Wunused-parameter]
   36 | long long updateY(int pos,int val)
      |                           ~~~~^~~