Submission
Status:
P-PPPP-PPP
Subtask/Task Score:
80/100
Score: 80
User: Folk_DIWA
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-14 00:33:57
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
cin.tie(0)->sync_with_stdio(0);
int n; cin >> n;
vector <int> v(n);
for(int i=0; i<n; i++) cin >> v[i];
int t; cin >> t;
bool check = 0;
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
if(v[i] + v[j] == t){
cout << v[i] << ' ' << v[j] << '\n';
check = 1;
}
}
}
if(!check) cout << "no";
return 0;
}