Submission details
Task:Blocks
Sender:12bater
Submission time:2026-04-16 11:57:26 +0300
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp:5:7: error: expected nested-name-specifier before 'namesapce'
    5 | using namesapce std;
      |       ^~~~~~~~~
input/code.cpp: In function 'void solve()':
input/code.cpp:10:15: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |     int n, k; cin >> n >> k;
      |               ^~~
      |               std::cin
In file included from input/code.cpp:1:
/usr/include/c++/13/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
input/code.cpp:12:5: error: 'vector' was not declared in this scope
   12 |     vector<int> v(n);
      |     ^~~~~~
input/code.cpp:12:5: note: suggested alternatives:
In file included from /usr/include/c++/13/vector:66,
                 from input/code.cpp:2:
/usr/include/c++/13/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/...

Code

#include <iostream>
#include <vector>


using namesapce std;
typedef long long ll;


void solve() {
    int n, k; cin >> n >> k;

    vector<int> v(n);
    vector<int> counts(k+2, 0);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
        counts[v[i]]++;
    }

    if (k == 1) {
        cout << "YES\n";
        cout << "1 1 1\n";
    } else {
        cout << "NO\n";
    }
}

int main() {
    cin.tie(0);
    io_base::sync_with_stdio(0);

    int t = 0; cin >> t;

    while (t--) {
        solve();
    }
}