Submission #714705

# Submission time Handle Problem Language Result Execution time Memory
714705 2023-03-25T08:11:25 Z dsyz Fortune Telling 2 (JOI14_fortune_telling2) C++17
0 / 100
14 ms 23768 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define MAXN (1000005)
int main() {
	ios_base::sync_with_stdio(false);cin.tie(0);
	ll N,K;
	cin>>N>>K;
	ll A[N], B[N], a[N], b[N];
	vector<ll> d;
	for(ll i = 0;i < N;i++){
		cin>>A[i]>>B[i];
		a[i] = A[i];
		b[i] = B[i];
		d.push_back(A[i]);
		d.push_back(B[i]);
	}
	ll T[K];
	for(ll i = 0;i < K;i++){
		cin>>T[i];
		d.push_back(T[i]);
	}
	sort(d.begin(),d.end());
	d.resize(unique(d.begin(),d.end()) - d.begin());
	for(ll i = 0;i < N;i++){
		A[i] = lower_bound(d.begin(),d.end(),A[i]) - d.begin();
		B[i] = lower_bound(d.begin(),d.end(),B[i]) - d.begin();
	}
	for(ll i = 0;i < K;i++){
		T[i] = lower_bound(d.begin(),d.end(),T[i]) - d.begin();
	}
	vector<ll> v[MAXN]; //stores the i
	for(ll i = 0;i < N;i++){
		v[A[i]].push_back(i);
		v[B[i]].push_back(i);
	}
	ll sum = 0;
	cout<<sum<<'\n';
}

Compilation message

fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:9:17: warning: variable 'a' set but not used [-Wunused-but-set-variable]
    9 |  ll A[N], B[N], a[N], b[N];
      |                 ^
fortune_telling2.cpp:9:23: warning: variable 'b' set but not used [-Wunused-but-set-variable]
    9 |  ll A[N], B[N], a[N], b[N];
      |                       ^
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 23768 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 23768 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 14 ms 23768 KB Output isn't correct
2 Halted 0 ms 0 KB -