Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: chs_14

Problemset: จับคู่เลขมงคล

Language: cpp

Time: 0.002 second

Submitted On: 2026-01-20 15:28:03

#include <bits/stdc++.h>
using namespace std;

int main() {
    cin.tie(0)->sync_with_stdio();

    int n, luckynum;
    cin >> n;
    vector<int> birthday(n);
    for (int i = 0; i < n; i++)
    {
        cin >> birthday[i];
    }
    cin >> luckynum;

    bool notfound = true;
    for (int i = 0; i < n; i++)
    {
        for (int j = i+1; j < n; j++)
        {
            if (birthday[i]+birthday[j]==luckynum) {
                notfound = false;
                cout << birthday[i] << ' ' << birthday[j] << '\n';
            }
        }

    }

    if (notfound) cout << "No\n";

    return 0;
}