Language: C++

#include <iostream>
#include <vector>
#include <string>

//using namespace std;

int main()
{
    uint32_t nn;
    /* nn <= 3 so nn is smaller than 1000 */
    uint32_t mm;
    uint32_t tar;
    uint32_t dig1 = 0;
    uint32_t dig2 = 0;
    uint32_t dig3 = 0;

    std::cin >> nn >> mm;

    std::vector<std::vector<int>> vv(2, std::vector<int>(mm, 0));
    
    for(int i = 0; i < mm; i++){
        for(int j = 0; j < 2; j++){
            std::cin >> vv[j][i];
        }
    }
    
    for(int i = 0; i < mm; i++){
        for(int j = 0; j < 2; j++){
            std::cout << vv[j][i];
        }
        std::cout << std::endl;
    }
    /* N桁目の数字になるかでプローブ領域を変える */

    if(nn == 1){
        std::cout << "1des" << std::endl;
        for(int i = 0; i < 10; i++){
        /* s_i桁目の数字 */
            dig3 = i;
            for(int k = 0; k < mm; k++){
                if(vv[0][k] != 1){
                    break;
                }
                if(dig3 != vv[1][k]){
                    break;
                }
                std::cout << i << std::endl;
                return 0;
            }
        }

    }else if(nn == 2){
        std::cout << "2des" << std::endl;
        for(int i = 10; i < 100; i++){
        /* s_i桁目の数字 */
            dig3 = i % 10;
            dig2 = i / 10;
            for(int k = 0; k < mm; k++){
                if(vv[0][k] == 3){
                    break;
                }else if(vv[0][k] == 1){
                    if(dig2 != vv[1][k]){
                        break;
                    }
                }else if(vv[0][k] == 2){
                    if(dig3 != vv[1][k]){
                        break;
                    }
                }
                std::cout << i << std::endl;
                return 0;
            }
        }

    }else if(nn == 3){
        std::cout << "3des" << std::endl;
        for(int i = 100; i < 1000; i++){
            dig3 = (i % 100) % 10;
            dig2 = (i % 100) /10;
            dig1 = i / 100;
            for(int k = 0; k < mm; k++){
                if(vv[0][k] == 1){
                    if(dig1 != vv[1][k]){
                        std::cout << "noi " << i << std::endl;
                        break;
                    }
                }

                if(vv[0][k] == 2){
                    if(dig2 != vv[1][k]){
                        break;
                    }
                }
                
                if(vv[0][k] == 3){
                    std::cout << i << std::endl;
                    if(dig3 != vv[1][k]){
                        break;
                    }
                }
            }
            
        }
        std::cout << i << std::endl;
            return 0;
    }

    std::cout << "aho" << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'uint32_t' was not declared in this scope
    9 |     uint32_t nn;
      |     ^~~~~~~~
a.cc:3:1: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    2 | #include <vector>
  +++ |+#include <cstdint>
    3 | #include <string>
a.cc:11:13: error: expected ';' before 'mm'
   11 |     uint32_t mm;
      |             ^~~
      |             ;
a.cc:12:13: error: expected ';' before 'tar'
   12 |     uint32_t tar;
      |             ^~~~
      |             ;
a.cc:13:13: error: expected ';' before 'dig1'
   13 |     uint32_t dig1 = 0;
      |             ^~~~~
      |             ;
a.cc:14:13: error: expected ';' before 'dig2'
   14 |     uint32_t dig2 = 0;
      |             ^~~~~
      |             ;
a.cc:15:13: error: expected ';' before 'dig3'
   15 |     uint32_t dig3 = 0;
      |             ^~~~~
      |             ;
a.cc:17:17: error: 'nn' was not declared in this scope
   17 |     std::cin >> nn >> mm;
      |                 ^~
a.cc:17:23: error: 'mm' was not declared in this scope; did you mean 'tm'?
   17 |     std::cin >> nn >> mm;
      |                       ^~
      |                       tm
a.cc:39:13: error: 'dig3' was not declared in this scope
   39 |             dig3 = i;
      |             ^~~~
a.cc:56:13: error: 'dig3' was not declared in this scope
   56 |             dig3 = i % 10;
      |             ^~~~
a.cc:57:13: error: 'dig2' was not declared in this scope
   57 |             dig2 = i / 10;
      |             ^~~~
a.cc:78:13: error: 'dig3' was not declared in this scope
   78 |             dig3 = (i % 100) % 10;
      |             ^~~~
a.cc:79:13: error: 'dig2' was not declared in this scope
   79 |             dig2 = (i % 100) /10;
      |             ^~~~
a.cc:80:13: error: 'dig1' was not declared in this scope
   80 |             dig1 = i / 100;
      |             ^~~~
a.cc:104:22: error: 'i' was not declared in this scope
  104 |         std::cout << i << std::endl;
      |                      ^