Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int A, B, M;
    cin >> A >> B >> M;

    int As[A], Bs[B], Xs[M], Ys[M], Cs[M], minsX, minsY, cont = 0;

    for (int i = 0; i < A; i++)
    {
        int l;
        cin >> l;
        As[i] = l;
    }

    for (int i = 0; i < B; i++)
    {
        int l;
        cin >> l;
        Bs[i] = l;
    }

    for (int i = 0; i < M; i++)
    {
        int l;
        cin >> l;
        Xs[i] = l;
        cin >> l;
        Ys[i] = l;
        cin >> l;
        Cs[i] = l;
    }
    int asd = 0;
    int pos;
    for (int i = 0; i < M; i++)
    {
        if (Cs[i] > asd)
        {
            pos = i;
            asd = Cs[i];
        }
    }
    int asd2 = 9999999;
    for (int i = 0; i < A; i++)
    {
        if (As[i] < asd2)
        {
            minsX = As[i];
            asd2 = As[i];
        }
            minsY = Bs[i];
            asd3 = Bs[i];
        }
    }
    /* for (int i = 0; i < M; i++)
    {
        cout << "Xs: " << Xs[i] << " Ys: " << Ys[i] << endl;
    }
    cout << "Min A " << minsX << " Min B " << minsY << endl;
    cout << "Pos max C " << pos << endl;
    cout << " X de mayor C " << Xs[pos] << "Max C " << asd << " Resta de los dos " << As[Xs[pos]] - asd << endl; */
    int h = Xs[pos] - 1, h2 = Ys[pos] - 1;

    int cont1 = As[h] + Bs[h] - asd;
    int cont2 = minsX + minsY;

    if (cont1 <= cont2)
    {
        cont = cont1;
    }
    else
    {
        cont = cont2;
    }
    cout << cont;
}  }
    int asd3 = 9999999;
    for (int i = 0; i < B; i++)
    {
        if (Bs[i] < asd3)
        {
            minsY = Bs[i];
            asd3 = Bs[i];
        }
    }
    /* for (int i = 0; i < M; i++)
    {
        cout << "Xs: " << Xs[i] << " Ys: " << Ys[i] << endl;
    }
    cout << "Min A " << minsX << " Min B " << minsY << endl;
    cout << "Pos max C " << pos << endl;
    cout << " X de mayor C " << Xs[pos] << "Max C " << asd << " Resta de los dos " << As[Xs[pos]] - asd << endl; */
    int h = Xs[pos] - 1, h2 = Ys[pos] - 1;

    int cont1 = As[h] + Bs[h] - asd;
    int cont2 = minsX + minsY;

    if (cont1 <= cont2)
    {
        cont = cont1;
    }
    else
    {
        cont = cont2;
    }
    cout << cont;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:13: error: 'asd3' was not declared in this scope; did you mean 'asd2'?
   55 |             asd3 = Bs[i];
      |             ^~~~
      |             asd2
a.cc: At global scope:
a.cc:65:13: error: 'Xs' was not declared in this scope
   65 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |             ^~
a.cc:65:16: error: 'pos' was not declared in this scope; did you mean 'pow'?
   65 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |                ^~~
      |                pow
a.cc:67:17: error: 'As' was not declared in this scope
   67 |     int cont1 = As[h] + Bs[h] - asd;
      |                 ^~
a.cc:67:25: error: 'Bs' was not declared in this scope
   67 |     int cont1 = As[h] + Bs[h] - asd;
      |                         ^~
a.cc:67:33: error: 'asd' was not declared in this scope
   67 |     int cont1 = As[h] + Bs[h] - asd;
      |                                 ^~~
a.cc:68:17: error: 'minsX' was not declared in this scope
   68 |     int cont2 = minsX + minsY;
      |                 ^~~~~
a.cc:68:25: error: 'minsY' was not declared in this scope
   68 |     int cont2 = minsX + minsY;
      |                         ^~~~~
a.cc:70:5: error: expected unqualified-id before 'if'
   70 |     if (cont1 <= cont2)
      |     ^~
a.cc:74:5: error: expected unqualified-id before 'else'
   74 |     else
      |     ^~~~
a.cc:78:5: error: 'cout' does not name a type
   78 |     cout << cont;
      |     ^~~~
a.cc:79:1: error: expected declaration before '}' token
   79 | }  }
      | ^
a.cc:79:4: error: expected declaration before '}' token
   79 | }  }
      |    ^
a.cc:81:5: error: expected unqualified-id before 'for'
   81 |     for (int i = 0; i < B; i++)
      |     ^~~
a.cc:81:21: error: 'i' does not name a type
   81 |     for (int i = 0; i < B; i++)
      |                     ^
a.cc:81:28: error: 'i' does not name a type
   81 |     for (int i = 0; i < B; i++)
      |                            ^
a.cc:96:9: error: redefinition of 'int h'
   96 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |         ^
a.cc:65:9: note: 'int h' previously defined here
   65 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |         ^
a.cc:96:13: error: 'Xs' was not declared in this scope
   96 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |             ^~
a.cc:96:16: error: 'pos' was not declared in this scope; did you mean 'pow'?
   96 |     int h = Xs[pos] - 1, h2 = Ys[pos] - 1;
      |                ^~~
      |                pow
a.cc:98:9: error: redefinition of 'int cont1'
   98 |     int cont1 = As[h] + Bs[h] - asd;
      |         ^~~~~
a.cc:67:9: note: 'int cont1' previously defined here
   67 |     int cont1 = As[h] + Bs[h] - asd;
      |         ^~~~~
a.cc:98:17: error: 'As' was not declared in this scope
   98 |     int cont1 = As[h] + Bs[h] - asd;
      |                 ^~
a.cc:98:25: error: 'Bs' was not declared in this scope
   98 |     int cont1 = As[h] + Bs[h] - asd;
      |                         ^~
a.cc:98:33: error: 'asd' was not declared in this scope; did you mean 'asd3'?
   98 |     int cont1 = As[h] + Bs[h] - asd;
      |                                 ^~~
      |                                 asd3
a.cc:99:9: error: redefinition of 'int cont2'
   99 |     int cont2 = minsX + minsY;
      |         ^~~~~
a.cc:68:9: note: 'int cont2' previously defined here
   68 |     int cont2 = minsX + minsY;
      |         ^~~~~
a.cc:99:17: error: 'minsX' was not declared in this scope
   99 |     int cont2 = minsX + minsY;
      |                 ^~~~~
a.cc:99:25: error: 'minsY' was not declared in this scope
   99 |     int cont2 = minsX + minsY;
      |                         ^~~~~
a.cc:101:5: error: expected unqualified-id before 'if'
  101 |     if (cont1 <= cont2)
      |     ^~
a.cc:105:5: error: expected unqualified-id before 'else'
  105 |     else
      |     ^~~~
a.cc:109:5: error: 'cout' does not name a type
  109 |     cout << cont;
      |     ^~~~
a.cc:110:1: error: expected declaration before '}' token
  110 | }
      | ^