제출 #1250512

#제출 시각아이디문제언어결과실행 시간메모리
1250512SoMotThanhXuanEaster Eggs (info1cup17_eastereggs)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
/*
I might never be your knight in shining armor
I might never be the one you take home to mother
And I might never be the one who brings you flowers
But I can be the one, be the one tonight

When I first saw you
From across the room
I could tell that you were curious
Oh, yeah

Girl, I hope you're sure
What you're looking for
'Cause I'm not good at making promises

But if you like causing trouble up in hotel rooms
And if you like having secret little rendezvous
If you like to do the things you know that we shouldn't do
Then, baby, I'm perfect
Baby, I'm perfect for you

And if you like midnight driving with the windows down
And if you like going places we can't even pronounce
If you like to do whatever you've been dreaming about
Then, baby, you're perfect
Baby, you're perfect
So let's start right now

I might never be the hands you put your heart in
Or the arms that hold you any time you want them
But that don't mean that we can't live here in the moment
'Cause I can be the one you love from time to time

When I first saw you
From across the room
I could tell that you were curious
Oh, yeah

Girl, I hope you're sure
What you're looking for
'Cause I'm not good at making promises

But if you like causing trouble up in hotel rooms
And if you like having secret little rendezvous
If you like to do the things you know that we shouldn't do
Then, baby, I'm perfect
Baby, I'm perfect for you

And if you like midnight driving with the windows down
And if you like going places we can't even pronounce
If you like to do whatever you've been dreaming about
Then, baby, you're perfect
Baby, you're perfect
So let's start right now

And if you like cameras flashing every time we go out
Oh, yeah
And if you're looking for someone to write your break-up songs about
Baby, I'm perfect
And, baby, we're perfect

If you like causing trouble up in hotel rooms
And if you like having secret little rendezvous
If you like to do the things you know that we shouldn't do
Then, baby, I'm perfect
Baby, I'm perfect for you

And if you like midnight driving with the windows down
And if you like going places we can't even pronounce
If you like to do whatever you've been dreaming about
Then, baby, you're perfect
Baby, you're perfect
So let's start right now
*/
using namespace std;
#define F first
#define S second
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; ++i)
#define REP(i, a, b) for(int i = (a), _b = (b); i >= _b; --i)
#define mp make_pair
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define Bit(x, i) ((x >> (i)) & 1)
#define Mask(i) (1 << (i))
#define Cnt(x) __builtin_popcount(x)
#define Cntll(x) __builtin_popcountll(x)
#define Ctz(x) __builtin_ctz(x) // so luong so 0 tinh tu ben phai
#define Ctzll(x) __builtin_ctzll(x)
#define Clz(x) __builtin_clz(x) // so luong so 0 tinh tu ben trai
#define Clzll(x) __builtin_clzll(x)
inline bool maximize(int &u, int v){
    return v > u ? u = v, true : false;
}
inline bool minimize(int &u, int v){
    return v < u ? u = v, true : false;
}
inline bool maximizell(long long &u, long long v){
    return v > u ? u = v, true : false;
}
inline bool minimizell(long long &u, long long v){
    return v < u ? u = v, true : false;
}
const int mod = 1e9 + 7;
inline int fastPow(int a, int n){
    if(n == 0) return 1;
    int t = fastPow(a, n >> 1);
    t = 1ll * t * t % mod;
    if(n & 1) t = 1ll * t * a % mod;
    return t;
}
inline void add(int &u, int v){
    u += v;
    if(u >= mod) u -= mod;
}
inline void sub(int &u, int v){
    u -= v;
    if(u < 0) u += mod;
}
const int maxN = 2e5 + 5;
const int inf = 1e9;
const long long infll = 1e18;
vector<int> adj[513];
vector<int> order;
void dfs(int u = 1, int p = 0){
    order.emplace_back(u);
    for(int v : adj[u]){
        if(v != p) dfs(v, u);
    }
}
int findEgg(int n, vector<pair<int, int>> bridges){
    FOR(i, 1, n)adj[i].clear();
    order.clear();
    for(auto[u, v] : bridges){
        adj[u].emplace_back(v);
        adj[v].emplace_back(u);
    }
    dfs();
    int l = 0, r = n - 1;
    int res = 0;
    while(l <= r){
        int mid = l + r >> 1;
        if(query(vector<int> (order.begin(), order.begin() + mid))){
            res = mid;
            r = mid - 1;
        }else l = mid + 1;
    }
    return order[res];
}
//void process(){
//
//}
//#define LOVE ""
//int main(){
//    if(fopen(LOVE".inp", "r")){
//        freopen(LOVE".inp", "r", stdin);
//        freopen(LOVE".out", "w", stdout);
//    }
//    ios_base::sync_with_stdio(false);
//    cin.tie(0);
//    cout.tie(0);
//
//    int t = 1;
////    cin >> t;
//    while(t--)
//        process();
////    cerr << '\n' << "Time elapsed: " << (1.0 * clock() / CLOCKS_PER_SEC) << " s\n" ;
//    return 0;
//}





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

eastereggs.cpp: In function 'int findEgg(int, std::vector<std::pair<int, int> >)':
eastereggs.cpp:143:12: error: 'query' was not declared in this scope
  143 |         if(query(vector<int> (order.begin(), order.begin() + mid))){
      |            ^~~~~