# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1004458 | 2024-06-21T09:12:51 Z | vjudge1 | 말 (IOI15_horses) | C++17 | 1500 ms | 10392 KB |
#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; ll cnt = 0, left = 0; ll prev =1; ll ccnt, cleft, cl; for(int i = 1; i <= n; i++){ have = ((have* x[i-1])); if(have>=mod){ ccnt++; have %=mod; } while(y[i-1]>=mod){ cl++; y[i-1]%mod; } ll hold = have*y[i-1]; if(hold >=mod){ ccnt++; } if(ccnt> cnt){ cnt = ccnt+cl; left = hold; } else if(ccnt==cnt && hold> left){ cnt = ccnt+cl; left = hold; } } return left; } 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; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Incorrect | 1 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1533 ms | 10392 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 344 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 428 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |