Submission #898337

# Submission time Handle Problem Language Result Execution time Memory
898337 2024-01-04T14:03:35 Z vjudge1 Passport (JOI23_passport) C++17
Compilation error
0 ms 0 KB
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define str string
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define F first
#define S second
#define all(x) x.begin() , x.end()
#define setpr(x) cout << fixed << setprecision(x) 
#define endl '\n'
 
const int inf = INT_MAX;
const ld eps = 1e-9 , pi = acos(-1.0);
const ll mod = 1e9 + 7; // 998244353;
const int dx[4]{1 , 0 , -1 , 0} , dy[4]{0 , 1 , 0 , -1};

vector<pair<int , int>> bu;
vector<vector<int>> a;
int n;

// int pas_tep(int x){
//     int h = 0 , r = 1;
//     for(int i = 0 ; i < n ; i ++){
//         h ++;
//         if(a[r].back() >= bu[x].F) return h;
//         if(r == a[r].back()) return -1;
//         r = a[r].back();
//     }
//     return -1;
// }

void solution(){
    cin >> n;
    bu.resize(n);
    for(int i = 0 ; i < n ; i ++) cin >> bu[i].F >> bu[i].S;
    a.resize(n + 1);
    for(int i = 0 ; i < n ; i ++){
        for(int j = bu[i].F ; j <= bu[i].S ; j ++){
            a[j].pb(i + 1);
        }
    }
    for(int i = 0 ; i <= n ; i ++) sort(all(a[i]));
    int q; cin >> q;
    while(q --){
        int x; cin >> x;
        if(bu[x - 1].F == bu[x - 1].S){
            cout << -1 << endl; continue;
        }
        // cout << pas_tep(x - 1) << endl;
        int l = bu[x - 1].F , r = bu[x - 1].S , h = 1 , p = 0 , mx = 0;
        for(int i = 0 ; i < n ; i ++){
            for(int j = 0 ; j < n ; j ++){
                if(h >= bu[j].F && h <= bu[j].S && j + 1 <= r && mx < j + 1){
                    mx = j + 1;
                }
            }
            if(mx <=)
        }
    }
    
}  
 
signed main(){
    IOS;
    int t = 1; // cin >> t;
    while(t --) solution();
}   

Compilation message

passport.cpp: In function 'void solution()':
passport.cpp:64:21: error: expected primary-expression before ')' token
   64 |             if(mx <=)
      |                     ^
passport.cpp:65:9: error: expected primary-expression before '}' token
   65 |         }
      |         ^
passport.cpp:57:13: warning: unused variable 'l' [-Wunused-variable]
   57 |         int l = bu[x - 1].F , r = bu[x - 1].S , h = 1 , p = 0 , mx = 0;
      |             ^
passport.cpp:57:57: warning: unused variable 'p' [-Wunused-variable]
   57 |         int l = bu[x - 1].F , r = bu[x - 1].S , h = 1 , p = 0 , mx = 0;
      |                                                         ^