Submission details
Task:Distances
Sender:MRiekasius
Submission time:2026-04-17 11:29:23 +0300
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:8:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    8 |     if(nk = {1, 0}) cout << "0 0";
      |        ~~~^~~~~~~~
input/code.cpp:8:11: error: could not convert 'nk.std::pair<int, int>::operator=(std::pair<int, int>(1, 0))' from 'std::pair<int, int>' to 'bool'
    8 |     if(nk = {1, 0}) cout << "0 0";
      |        ~~~^~~~~~~~
      |           |
      |           std::pair<int, int>
input/code.cpp:9:11: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    9 |     if(nk = {2, 0}) cout << "0 0 1 1";
      |        ~~~^~~~~~~~
input/code.cpp:9:11: error: could not convert 'nk.std::pair<int, int>::operator=(std::pair<int, int>(2, 0))' from 'std::pair<int, int>' to 'bool'
    9 |     if(nk = {2, 0}) cout << "0 0 1 1";
      |        ~~~^~~~~~~~
      |           |
      |           std::pair<int, int>
input/code.cpp:10:11: warning: suggest parentheses aro...

Code

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

int main()
{
    pair<int, int> nk;
    cin >> nk.first >> nk.second;
    if(nk = {1, 0}) cout << "0 0";
    if(nk = {2, 0}) cout << "0 0 1 1";
    if(nk = {2, 1}) cout << "0 0 0 1";
    if(nk = {3, 0}) cout << "0 0 1 1 2 2";
    if(nk = {3, 1}) cout << "0 0 0 1 1000 1000";
    if(nk = {3, 2}) cout << "0 0 0 1 1 1";
    if(nk = {3, 3}) cout << "0 0 0 1 0 2";
    if(nk = {4, 0}) cout << "0 0 1 1 2 2 3 3";
    if(nk = {4, 1}) cout << "0 0 0 1 1000 1000 2000 2000";
    if(nk = {4, 2}) cout << "0 0 0 1 1 1 1000 1000";
    if(nk = {4, 3}) cout << "0 0 1 1 2 2 1000 1000";
    if(nk = {4, 4}) cout << "0 0 0 1 2 2 2 1";
    if(nk = {4, 5}) cout << "0 0 0 1 0 2 4 1";
    if(nk = {4, 6}) cout << "0 0 0 1 0 2 0 3";
}