Submission #348799

#TimeUsernameProblemLanguageResultExecution timeMemory
348799SprdaloHorses (IOI15_horses)C++17
0 / 100
32 ms18728 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pi> vp;
typedef vector<pl> vpl;

const int mod = 1e9 + 7;

void f(ll& x){
    if (x >= mod)
        x %= mod;
}

ll g(ll x){
    f(x);
    return x;
}

vi x, y;

ll init(int n, int X[], int Y[]){
    x = vi(n); y = vi(n);
    for (int i = 0; i < n; ++i){
        x[i] = X[i];
        y[i] = Y[i];
    }

    ll s = 1, sol = 0;
    for (int i = 0; i < n; ++i){
        sol = max(sol, g(s*y[i]));
        s *= x[i];
        f(s);
    }

    return sol;
}

int updateX(int pos, int val){

}

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

    int n;
    cin >> n;

    int x[n], y[n];
    for (int i = 0; i < n; ++i)
        cin >> x[i] >> y[i];

    cout << init(n,x,y) << '\n';
}*/

Compilation message (stderr)

horses.cpp: In function 'int updateX(int, int)':
horses.cpp:51:1: warning: no return statement in function returning non-void [-Wreturn-type]
   51 | }
      | ^
horses.cpp:49:17: warning: unused parameter 'pos' [-Wunused-parameter]
   49 | int updateX(int pos, int val){
      |             ~~~~^~~
horses.cpp:49:26: warning: unused parameter 'val' [-Wunused-parameter]
   49 | int updateX(int pos, int val){
      |                      ~~~~^~~
horses.cpp: In function 'int updateY(int, int)':
horses.cpp:55:1: warning: no return statement in function returning non-void [-Wreturn-type]
   55 | }
      | ^
horses.cpp:53:17: warning: unused parameter 'pos' [-Wunused-parameter]
   53 | int updateY(int pos, int val){
      |             ~~~~^~~
horses.cpp:53:26: warning: unused parameter 'val' [-Wunused-parameter]
   53 | 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...