Submission #698416

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6984162023-02-13 12:24:06amunduzbaev유괴 2 (JOI17_abduction2)C++17
44 / 100
1547 ms20728 KiB
#include "bits/stdc++.h"
using namespace std;
#define ar array
typedef long long ll;
//~ #define int ll
const int N = 5e4 + 5;
const int M = 16;
vector<ar<int, 2>> tot[N + N];
int a[2][N], pos[2][N];
int L[2][N][M], R[2][N][M];
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
ar<int, 2> n; int q;
cin >> n[0] >> n[1] >> q;
for(int t=0;t<2;t++){
a[t][0] = a[t][n[t] + 1] = 2e9;
for(int i=1;i<=n[t];i++){
cin >> a[t][i];
}
vector<int> ss; ss.push_back(0);
for(int i=1;i<=n[t];i++){
while(!ss.empty() && a[t][ss.back()] < a[t][i]){
ss.pop_back();
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

abduction2.cpp: In function 'int main()':
abduction2.cpp:115:7: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
  115 |   int res = max(res, solve(i, j));
      |       ^~~
#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...