| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 919719 | AnasAAF | Advertisement 2 (JOI23_ho_t2) | C++14 | 2059 ms | 11240 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
#define float double
int main(){
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n;cin>>n;
    vector<pair<ll, ll>>v(n);
    vector<pair<ll, pair<ll, ll>>>vp(n);
    set<int>st;
    for(int i=0;i<n;i++){
        ll a, b;cin>>a>>b;
        v[i] = {a, b};
        vp[i] = {b, {a, i}};
        st.insert(a);
    }
    sort(vp.rbegin(), vp.rend());
    vector<int>vis(n+1);
    int ans(0);
    queue<int>q;
    for(int i=0;i<n;i++){
        int a = vp[i].second.first, b = vp[i].first, ind = vp[i].second.second;
        if(!vis[ind]){
            ans++;
            q.push(ind);
        }
        while(!q.empty()){
            int in = q.front();
            int x = v[in].first, y=v[in].second;
            q.pop();
            for(int j=0;j<n;j++){
                if(vis[j])continue;
                int m = v[j].first, n=v[j].second;
                if(abs(x-m)<=y-n){
                    q.push(j);
                    vis[j]=1;
                }
            }
        }
    }
    cout<<min(ans, (int)st.size())<<endl;
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
