Submission
Status:
PPP--PPP--
Subtask/Task Score:
60/100
Score: 60
User: Some1258
Problemset: จับคู่เลขมงคล
Language: cpp
Time: 0.002 second
Submitted On: 2026-07-23 10:02:05
#include<bits/stdc++.h>
using namespace std;
int main(){
int N,L;
cin>>N;
int birthday[N];
int cnt[31]={0};
bool found =false;
for(int i=0;i<N;i++){
cin>>birthday[i];
}
cin>>L;
for(int i=0;i<N;i++){
int other=L-birthday[i];
if(other>=1&&other<=30&&cnt[other]>0){
cout<<other<<" "<<birthday[i]<<'\n';
found=true;
}
cnt[birthday[i]]++;
}
if(!found){
cout<<"No";
}
}