제출 #1004503

#제출 시각아이디문제언어결과실행 시간메모리
1004503vjudge1말 (IOI15_horses)C++17
17 / 100
1551 ms8268 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define f first
#define s second
#define pb push_back
#define pf push_front
#define pi pair<int,int>
#define vi vector<int>

int n ;
vi x, y;

const int mod = 1e9+7;

ll init(int N, int X[], int Y[]){
    n = N;
    x.resize(N);
    y.resize(N);
    for(int i =0; i < n; i++){
        x[i] =X[i];
        y[i] = Y[i];
    }
    
    ll final = 0;
    
  
    ll ans = 0;
    ll have = 1;
   for(int i = 1; i <= n; i++){
        have *= x[i-1];
        ans = max(ans, have*(y[i-1]));
         
   }
   return ans%mod;

}


ll updateX(int pos, int val){
    
    x[pos]=val;
      ll ans = 0;
    ll have = 1;
   for(int i = 1; i <= n; i++){
        have *= x[i-1];
        ans = max(ans, have*(y[i-1]));
         
   }
   return ans%mod;
}

ll updateY(int pos, int val){
     y[pos]=val;
      ll ans = 0;
    ll have = 1;
   for(int i = 1; i <= n; i++){
        have *= x[i-1];
        ans = max(ans, have*(y[i-1]));
         
   }
   return ans%mod;
   
}

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

horses.cpp: In function 'long long int init(int, int*, int*)':
horses.cpp:25:8: warning: unused variable 'final' [-Wunused-variable]
   25 |     ll final = 0;
      |        ^~~~~
#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...