criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<array>
#include<vector>
using namespace std;

int main()
{
	array<long long, 4000> ar;
	vector<long long> ans;
	long long n;
	int e,p,q;
	
	while (true) {
		cin >> n;
		ar.fill(0);
		if (!n) {
			break;
		}

		bool isNA = true;
		for (int i = 0; i < n; ++i) {
			cin >> e >> p >> q;
			ar[e] += p*q;
		}
		for (int i = 0; i < 4000;++i) {
			if (ar[i] >= 1000000) {
				auto it = ans.begin();
				it = find(it, ans.end(), i);
				if (it == ans.end()) {
					ans.push_back(i);
				}
				isNA = false;
			}
		}
		if (isNA) {
			ans.push_back(-1);
		}

	}

	for (auto it : ans) {
		if (it != -1) {
			cout << it << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:42: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >&, std::vector<long long int>::iterator, int&)'
   28 |                                 it = find(it, ans.end(), i);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:28:42: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   28 |                                 it = find(it, ans.end(), i);
      |                                      ~~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<array>
#include<vector>
using namespace std;

int main()
{
	array<long long, 4000> ar;
	vector<long long> ans;
	long long n;
	int e,p,q;
	
	while (true) {
		cin >> n;
		ar.fill(0);
		if (!n) {
			break;
		}

		bool isNA = true;
		for (int i = 0; i < n; ++i) {
			cin >> e >> p >> q;
			ar[e] += p*q;
		}
		for (int i = 0; i < 4000;++i) {
			if (ar[i] >= 1000000) {
				auto it = ans.begin();
				it = std::find(it, ans.end(), i);
				if (it == ans.end()) {
					ans.push_back(i);
				}
				isNA = false;
			}
		}
		if (isNA) {
			ans.push_back(-1);
		}

	}

	for (auto it : ans) {
		if (it != -1) {
			cout << it << endl;
		}
		else {
			cout << "NA" << endl;
		}
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:47: error: no matching function for call to 'find(__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >&, std::vector<long long int>::iterator, int&)'
   28 |                                 it = std::find(it, ans.end(), i);
      |                                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:28:47: note:   '__gnu_cxx::__normal_iterator<long long int*, std::vector<long long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   28 |                                 it = std::find(it, ans.end(), i);
      |                                      ~~~~~~~~~^~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int N, M;

int main() {
	int goal = 1000000;

	for (; cin >> N;) {
		if (!N) break;
		int v[4000];
		memset(v, 0, sizeof(v));
		for (int i = 0; i < N; i++) {
			int e, p, q;
			cin >> e >> p >> q;
			v[e - 1] += p*q;
		}
		bool flag = false;
		for (int i = 0; i < 4000; i++) {
			if (v[i] >= goal) {
				flag = true;
				cout << i + 1 << endl;

			}
		}
		if (!flag) cout << "NA" << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
   13 |                 memset(v, 0, sizeof(v));
      |                 ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 |
Language: C++

#include <iostream>
#include <string.h>
#include <queue>

using namespace std;

int N, M;

int main() {
	long long  goal = 1000000;

	for (; cin >> N;) {
		if (!N) break;
		long long  v[4000];
		queue<int> que;
		memset(v, 0, sizeof(v));
		for (int i = 0; i < N; i++) {
			long long  e, p, q;
			cin >> e >> p >> q;
			que.push(e);
			v[e - 1] += p*q;
		}
		bool flag = false;
		while(!que.empty()){
			if (v[que.front()] >= goal) {
				flag = true;
				v[que.front()] = 0;
				cout << que.front + 1 << endl;
			}
			que.pop();
		}
		if (!flag) cout << "NA" << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:51: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   28 |                                 cout << que.front + 1 << endl;
      |                                         ~~~~~~~~~ ^ ~
      |                                             |       |
      |                                             |       int
      |                                             <unresolved overloaded function type>
Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) FOR(i,1,n)
using namespace std;
 /*temp*/

int main(){
    int e, p, q;
    while(cin >> n, n != 0) {
        ll m[4001] = {};
        int a[1000] = {};
        REP(i, n){
            cin >> e >> p >> q;
            m[e] += p * q;
            a[i] = e;
        }
        bool f = true;
        REP(i, n){
            if(m[a[i]] >= 1000000){
                cout << a[i] << '\n';
                m[a[i]] = 0;
                f = false;
            }
        }
        if(f) cout << "NA\n";
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: 'n' was not declared in this scope
   11 |     while(cin >> n, n != 0) {
      |                  ^
Language: C++

#include <iostream>
using namespace std;
typedef long long ll;
//vector<pair<bool, ll>> v(4001);
unsigned ll a[4001];

int main(){
	int n, num, p, q;
	while(cin >> n, n){
		fill(a, a+4001, 0);
		for(int i = 0;i < n;i++){
			cin >> num >> p >> q;
			a[num] += p * q;
		}
		int f = 1;
		for(int i = 1;i <= 4000;i++)if(a[i] >= 1000000)cout << i << endl, f = 0;
		if(f)cout << "NA" << endl;
	}
	return 0;
}

/*
4
1001 2000 520
1002 1800 450
1003 1600 625
1001 200 1220
*/

Compiler output:
a.cc:5:13: error: expected initializer before 'a'
    5 | unsigned ll a[4001];
      |             ^
a.cc: In function 'int main()':
a.cc:10:22: error: 'a' was not declared in this scope
   10 |                 fill(a, a+4001, 0);
      |                      ^
Language: C++

while True:
    n = int(input())
    if n == 0:
        break
    d = dict()
    sep = []
    for _ in range(n):
        i, p, q = map(int, input().split())
        if i in d:
            d[i] += p*q
        else:
            d[i] = p*q
            sep.append(i)
    tmp = list(filter(lambda x: x[1] >= 1000000, d.items()))
    if len(tmp):
        for s in sep:
            if s in tmp:
                print(s)
    else:
        print("NA")

Compiler output:
a.cc:1:1: error: expected unqualified-id before 'while'
    1 | while True:
      | ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
using namespace std;
void shoki();
void henkan(string);
int tansaku(int);
pair<string,long long> num[4001];
int n,ban,tanka,kazu,i,j,memo;
bool dp[4001]={false};
int main(){
	int al=0;
	bool y=false;
	while(1){
		shoki();
		cin>>n;
		if(n==0){
			break;
		}
		int count=0;
		for(i=0;i<n;i++){
			cin>>num[i].first>>tanka>>kazu;
			henkan(num[i].first);
			if(dp[memo]==true){
				num[tansaku(i)].second+=tanka*kazu;
			}
			else{
			num[i].second+=tanka*kazu;
			}
			dp[memo]=true;
			memo=0;
		}
		for(int k=0;k<=i;k++){
			if(num[k].second==0){
				continue;
			}
			if(num[k].second>=1000000){
				y=true;
				cout<<num[k].first<<endl;
			}
		}
		if(y==false){
			cout<<"NA"<<endl;
		}
		y=false;
		shoki();
		memset(dp,false,sizeof(dp));
	}
	return 0;
}
void shoki(){
	for(int i=0;i<4001;i++){
		num[i].first="0";
		num[i].second=0;
	}
	return;
}
void henkan(string str1){
	long long kake=1;
	for(int i=0;i<str1.size();i++){
		memo+=str1[i]*i;
		i*=10;
	}
	return;
}
int tansaku(int rec){
	int res;
	for(int l=0;l<rec;l++){
		if(num[rec].first==num[l].first){
			return res=l;
		}
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:17: error: 'memset' was not declared in this scope
   49 |                 memset(dp,false,sizeof(dp));
      |                 ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include<utility>
  +++ |+#include <cstring>
    6 | using namespace std;
a.cc: In function 'int tansaku(int)':
a.cc:75:1: warning: control reaches end of non-void function [-Wreturn-type]
   75 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

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

    vector<pair<int, long>> vec;
    int n;
    while (cin >> n && n > 0) {
        for (int i = 0; i < n; i++) {
            int id;
            long p, q;
            cin >> id >> p >> q;

            auto pre = find_if(
                vec.begin(), vec.end(),
                [&](const pair<int, long> &tar) { return tar.first == id; });
            if (pre != vec.end())
                pre->second += p * q;
            else
                vec.push_back(make_pair(id, p * q));
        }
        int count = 0;
        for (auto v : vec) {
            if (v.second >= 1000000) {
                cout << v.first << endl;
                count++;
            }
        }
        if (count == 0) cout << "NA" << endl;
        vec.clear();
    }
    return EXIT_SUCCESS;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:24: error: 'find_if' was not declared in this scope
   17 |             auto pre = find_if(
      |                        ^~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
    int n;
    long int array[n][3];
    int count=0;

    cin>>n;

    if(n==0) goto Exit;
    for(int i=0;i<n;i++){
        cin>>array[i][0]>>array[i][1]>>array[i][2];
    }
    
    for(int i=0;i<n;i++){
        for(int j=1;i+j<n;j++){
            if(array[i][0]==array[i+j][0]){
                array[i][1]+=array[i+j][1];
                array[i][2]+=array[i+j][2];
                array[i+j][1]=0;
                array[i+j][2]=0;
            }
        }
    }

    for(int i=0;i<n;i++){
        if(array[i][1]*array[i][2]>=1000000){
            cout<<array[i][0]<<"\n";
            count++;
        }
    }

    Exit;

    if(count==0){
        cout<<"NA\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:5: error: 'Exit' was not declared in this scope; did you mean 'exit'?
   34 |     Exit;
      |     ^~~~
      |     exit
a.cc:11:19: error: label 'Exit' used but not defined
   11 |     if(n==0) goto Exit;
      |                   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long sum[10000];
int main(){
    long long int n, a[10000], b, c;
    while(true){
        scanf("%lld", &n);
        if(n==0)break;
        bool na = true;
        for(int i = 0; i < n; i++){
            scanf("%lld%lld%lld", &a[i], &b, &c);
            sum[a] += b*c;
            /*if(b*c>=1000000){
                na = false;
                printf("%lld\n", a);
            }*/
        }
        for(int i = 0; i < n; i++){
            if(sum[a[i]] >= 1000000){
                na = false;
                printf("%lld\n", a);
            }
        }
        
        if(na) puts("NA");
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: invalid types 'long long int [10000][long long int [10000]]' for array subscript
   12 |             sum[a] += b*c;
      |                ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long sum[10000];
int main(){
    int a[10000];
    long long int n, b, c;
    while(true){
        scanf("%lld", &n);
        if(n==0)break;
        bool na = true;
        for(int i = 0; i < n; i++){
            scanf("%d%lld%lld", &a[i], &b, &c);
            sum[a] += b*c;
            /*if(b*c>=1000000){
                na = false;
                printf("%lld\n", a);
            }*/
        }
        for(int i = 0; i < n; i++){
            if(sum[a[i]] >= 1000000){
                na = false;
                printf("%lld\n", a);
            }
        }
        
        if(na) puts("NA");
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: invalid types 'long long int [10000][int [10000]]' for array subscript
   13 |             sum[a] += b*c;
      |                ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main()
{
  while(1){
    int n;
    cin>>n;
    if(n == 0){
      break;
    }

    vector<pair<int,int>> data;
    vector<int> nanum;
    for(int i = 0;i < n;++i){
      int num,sa,ko;
      cin>>num;
      cin>>sa;
      cin>>ko;

      int sum = sa * ko;

      if(i == 0){
        nanum.push_back(num);
        data.push_back(make_pair(num,sum));
      }
      else{
        auto a = find(nanum.begin(),nanum.end(),num);
        int b = *a
        if(b == 0){
          nanum.push_back(num);
          data.push_back(make_pair(num,sum));
        }
      }
    }

    int check = 0;
    for(pair<int,int> e : data){
      if(e.second >= 1000000){
        check = 1;
        cout<<e.first<<endl;
      }
    }
    if(check == 0){
      cout<<"NA"<<endl;
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: expected ',' or ';' before 'if'
   31 |         if(b == 0){
      |         ^~
Language: C++

(n == 0) {break;};
    unsigned long int price[4000], value[4000];
    for (int i = 0; i < 4000; i++) {
      price[i] = 0;
      value[i] = 0;
    }
    
    for (int i = 0; i < n; i++) {
      int a,b,c;
      cin >> a >> b >> c;
      price[a-1] += b;
      value[a-1] += c;
    }
    
    bool NA =


Compiler output:
a.cc:1:3: error: expected ')' before '==' token
    1 | (n == 0) {break;};
      | ~ ^~~
      |   )
a.cc:3:5: error: expected unqualified-id before 'for'
    3 |     for (int i = 0; i < 4000; i++) {
      |     ^~~
a.cc:3:21: error: 'i' does not name a type
    3 |     for (int i = 0; i < 4000; i++) {
      |                     ^
a.cc:3:31: error: 'i' does not name a type
    3 |     for (int i = 0; i < 4000; i++) {
      |                               ^
a.cc:8:5: error: expected unqualified-id before 'for'
    8 |     for (int i = 0; i < n; i++) {
      |     ^~~
a.cc:8:21: error: 'i' does not name a type
    8 |     for (int i = 0; i < n; i++) {
      |                     ^
a.cc:8:28: error: 'i' does not name a type
    8 |     for (int i = 0; i < n; i++) {
      |                            ^
a.cc:15:14: error: expected primary-expression at end of input
   15 |     bool NA =
      |              ^
Language: C++

#include <iostream>

int main(){
  int i, n, q;
  long long int p;
  while(cin >> n, n){
    bool NfAlg = false;
    while(n--){
      cin >> i >> p >> q;
      if((p * q) >= static_cast<int>(1e6)){
	cout << i << endl;
	NAflg = true;
      }
    }
    if(NAflg)
      cout << "NA" << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   while(cin >> n, n){
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 |         cout << i << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   11 |         cout << i << endl;
      |                      ^~~~
      |                      std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:12:9: error: 'NAflg' was not declared in this scope; did you mean 'NfAlg'?
   12 |         NAflg = true;
      |         ^~~~~
      |         NfAlg
a.cc:15:8: error: 'NAflg' was not declared in this scope; did you mean 'NfAlg'?
   15 |     if(NAflg)
      |        ^~~~~
      |        NfAlg
a.cc:16:7: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   16 |       cout << "NA" << endl;
      |       ^~~~
      |       std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:16:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   16 |       cout << "NA" << endl;
      |                       ^~~~
      |                       std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<cstdio>

int main(){
int a,i;
bool fl;
unsigned long int b,c;
while(1){
scanf("%d",&i);
fl=false;
for(;i>0;i--){


 scanf("%d",&a);
 if(a==0){
 return 0;
}
 scanf("%d",&b);
 scanf("%d",&c);
if(a*c>=1000000) {
 fl=true;
 printf("%d\n",a);
}
if(fl==false) pritnf("NA\n");
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   23 | if(fl==false) pritnf("NA\n");
      |               ^~~~~~
      |               printf
Language: C++

#include<cstdio>

int main(){
int a,i;
bool fl;
unsigned long int b,c;
while(1){
scanf("%d",&i);
fl=false;
for(int j=0;j<i;j++){


 scanf("%d",&a);
 if(a==0){
 return 0;
}
 scanf("%d",&b);
 scanf("%d",&c);
if(a*c>=1000000) {
 fl=true;
 printf("%d\n",a);
}
if(fl==false) pritnf("NA\n");
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   23 | if(fl==false) pritnf("NA\n");
      |               ^~~~~~
      |               printf
Language: C++

#include<cstdio>

int main(){
int a,i,fl;
unsigned long int b,c;
while(1){
scanf("%d",&i);
fl=0;
for(int j=0;j<i;j++){


 scanf("%d",&a);
 if(a==0){
 return 0;
}
 scanf("%d",&b);
 scanf("%d",&c);
if(a*c>=1000000) {
 fl=1;
 printf("%d\n",a);
}
if(fl==false) pritnf("NA\n");
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   22 | if(fl==false) pritnf("NA\n");
      |               ^~~~~~
      |               printf
Language: C++

#include<cstdio>

int main(){
int a,i,fl;
unsigned long int b,c;
while(1){
scanf("%d",&i);
fl=0;
for(int j=0;j<i;j++){


 scanf("%d",&a);
 if(a==0){
 return 0;
}
 scanf("%ld",&b);
 scanf("%ld",&c);
if(a*c>=1000000) {
 fl=1;
 printf("%d\n",a);
}
if(fl==false) pritnf("NA\n");
}
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:15: error: 'pritnf' was not declared in this scope; did you mean 'printf'?
   22 | if(fl==false) pritnf("NA\n");
      |               ^~~~~~
      |               printf
Language: C++

#include <iostream>
#include <algorithim>

using namespace std;
class MAN{
public:
	unsigned int uriage;
	short number;
};

int main(int argc, char const* argv[])
{
	MAN *person;
	int n;
	bool flag;

	while( cin >> n && n != 0 ){
		person  = new MAN[n];
		for( int i = 0;i < n;i++ ){
			int target;
			int a,b;
			cin >> target >> a >> b;

			int j;
			for( j = 0;j < i;j++ ){
				if( person[j].number == target ){
					person[j].uriage += a*b;
					break;
				}
			}
			if( j == i ){
				person[i].number = target;
				person[i].uriage = a * b;
			}
		}
		flag = false;
		for( int i = 0;i < n;i++ ){
			if( person[i].uriage >= 1000000 ){
				cout << person[i].number << endl;
				flag = true;
			}
		}
		if( flag == false ) cout << "NA" << endl;
		delete[] person;
	}

	return 0;
}

Compiler output:
a.cc:2:10: fatal error: algorithim: No such file or directory
    2 | #include <algorithim>
      |          ^~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    for(;;){
        int n;
        cin >> n;
        if(n == 0)
            return 0;

        bool na = true;
        for(int i=0; i<n; ++i){
            int a, b, c;
            cin >> a >> b >> c;
            if(long long(b) * c >= 1000000){
                cout << a << endl;
                na = false;
            }
        }
        if(na)
            cout << "NA" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: expected primary-expression before 'long'
   31 |             if(long long(b) * c >= 1000000){
      |                ^~~~
a.cc:31:16: error: expected ')' before 'long'
   31 |             if(long long(b) * c >= 1000000){
      |               ~^~~~
      |                )
Language: C++

#include <iostream>
#include <vector>

int main(){
  int n,sn,p,c;
  std::vector<int> v;
  while(std::cin>>n){
    if(!n)return 0;
    for(;n;n--){
      std::cin>>sn>>p>>c;
      std::vector<int>::iterator it=find(v.begin(),v.end(),sn);
      if(p*c>=1000000){
	if(it==v.end()){
	  v.push_back(sn);
	}
    }
    if(v.empty())std::cout<<"NA"<<std::endl;
    else{
    std::vector<int>::iterator it = v.begin();
    while(it!=v.end()){
      std::cout<<*it<<std::endl;
      it++;
    }
    v.clear();
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:41: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   11 |       std::vector<int>::iterator it=find(v.begin(),v.end(),sn);
      |                                     ~~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:11:41: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   11 |       std::vector<int>::iterator it=find(v.begin(),v.end(),sn);
      |                                     ~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include<cstdio>
#include<cstring>

int main(){
long long int data[4000],n;
scanf("%d",&n);
if(n==0) return 0;
memset(data,0,sizeof(data));
while(n--){
int a
long long int b,c;
scanf("%d%lld%lld",&a,&b,&c);
data[a-1]+=b*c;
}
int k=0;
for(int i=0;i<4000;i++){
if(data[i]>=1000000){
 printf("%d\n",i+1);
 k=1;
  } 
}
if(k==0) printf("NA\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:1: error: expected initializer before 'long'
   11 | long long int b,c;
      | ^~~~
a.cc:12:21: error: 'a' was not declared in this scope
   12 | scanf("%d%lld%lld",&a,&b,&c);
      |                     ^
a.cc:12:24: error: 'b' was not declared in this scope
   12 | scanf("%d%lld%lld",&a,&b,&c);
      |                        ^
a.cc:12:27: error: 'c' was not declared in this scope
   12 | scanf("%d%lld%lld",&a,&b,&c);
      |                           ^
Language: C++

#include<iostream>
using namespace std;




int n;


void solve()
{
	bool ok=false;
	int total[4000];
	bool check[4000];
	memset(check,false,sizeof(check));
	memset(total,0,sizeof(total));
	for(int i=0;i<n;i++){
		int num,a,b;
		cin>>num>>a>>b;
		total[num]+=a*b;
		if(total[num]>=1000000 && !check[num]){
			cout<<num<<endl;
			check[num]=true;
			ok=true;
		}
	}
	if(!ok) cout<<"NA"<<endl;
}

int main()
{
	while(cin>>n){
		if(n==0) break;
		solve();
	}
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:15:9: error: 'memset' was not declared in this scope
   15 |         memset(check,false,sizeof(check));
      |         ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include<iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
main(){
  //mlÛ¶vÛ¶
  long long a,b,c,n,f;
  //aÔbP¿cÊ
  while(cin>>n,n){
		map<int,long long> m;
		vector<int> v;
		f=1;
    for(;n;n--){
			cin>>a>>b>>c
      if(!m[a])v.push_back(a);
      m[a] += b*c;
    }
    
    for(int i=0;i<v.size();i++)
      if(m[v[i]]>999999)f=0;cout<<v[i]<<endl;
    if(f)cout<<"NA"<<endl;
  }
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:37: error: expected ';' before 'if'
   14 |                         cin>>a>>b>>c
      |                                     ^
      |                                     ;
   15 |       if(!m[a])v.push_back(a);
      |       ~~                             
a.cc:20:37: error: 'i' was not declared in this scope
   20 |       if(m[v[i]]>999999)f=0;cout<<v[i]<<endl;
      |                                     ^
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
main(){
  //mlÛ¶vÛ¶
  long long a,b,c,n,f;
  //aÔbP¿cÊ
  while(cin>>n,n){
		map<int,long long> m;
		vector<int> v;
		f=1;
    for(;n;n--){
			cin>>a>>b>>c
      if(!m[a])v.push_back(a);
      m[a] += b*c;
    }
    
    for(int i=0;i<v.size();i++)if(m[v[i]]>999999)f=0;cout<<v[i]<<endl;
    if(f)cout<<"NA"<<endl;
  }
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:37: error: expected ';' before 'if'
   14 |                         cin>>a>>b>>c
      |                                     ^
      |                                     ;
   15 |       if(!m[a])v.push_back(a);
      |       ~~                             
a.cc:19:62: error: 'i' was not declared in this scope
   19 |     for(int i=0;i<v.size();i++)if(m[v[i]]>999999)f=0;cout<<v[i]<<endl;
      |                                                              ^
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
main(){
  //mlÛ¶vÛ¶
  long long a,b,c,n,f;
  //aÔbP¿cÊ
  while(cin>>n,n){
		map<int,long long> m;
		vector<int> v;
		f=1;
    for(;n;n--){
			cin>>a>>b>>c
      if(!m[a])v.push_back(a);
      m[a] += b*c;
    }
    
    for(int i=0;i<v.size();i++){
			if(m[v[i]]>999999)f=0,cout<<v[i]<<endl;}
    if(f)cout<<"NA"<<endl;
  }
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:14:37: error: expected ';' before 'if'
   14 |                         cin>>a>>b>>c
      |                                     ^
      |                                     ;
   15 |       if(!m[a])v.push_back(a);
      |       ~~
Language: C++

#include<iostream>
#include<vector>
#include<map>
using namespace std;
main(){
  //mlÛ¶vÛ¶
  long long a,b,c,n,f;
  //aÔbP¿cÊ
  while(cin>>n,n){
		map<int,long long> m;
		vector<int> v;
		f=1;
    for(;n;n--){
			cin>>a>>b>>c;
      if(!m[a])v.push_back(a);
      m[a] += b*c;
    }
    
    for(int i=0;i<v.size();i++)
			if(m[v[i]]>999999)f=0,cout<<v[i]<<endl;
    f?:cout<<"NA"<<endl;
  }
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:21:6: error: operands to '?:' have different types 'long long int' and 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'}
   21 |     f?:cout<<"NA"<<endl;
      |     ~^~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <stdio.h>

using namespace std;

typedef long long ll;

int n, id, p, q;

const ll MAX = 1000000;

struct Mem {
    int id;
    ll c;

    Mem() {}
    Mem(int _id, ll _c) { id = _id; _c = c; }
};

Mem array[40010];

int main(void) {
    while(cin >> n && n)) {
        for(int i = 0; i < n; i++) {
            scanf("%d %d %d", &id, &p, &q);
            array[i].c = p * q;
            array[i].id = id;
        }
        for(int i = 0; i < n; i++) {
            for(int j = i + 1; j < n; j++) {
                if(array[i].id == array[j].id && array[j].id) {
                    array[i].c += array[j].c;
                    array[j].id = 0;
                }
            }
        }
        bool hap = false;
        for(int i = 0; i < n; i++) {
            if(array[i].id && array[i].c >= MAX) {
                cout << array[i].id << endl;
                hap = true;
            }
        }
        if(!hap) {
            cout << "NA" << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before ')' token
   26 |     while(cin >> n && n)) {
      |                         ^
Language: C++

#include <vector>
#include <map>
#include <algorithm>
#include <stdio.h>

#include<iostream>

using namespace std;

typedef long long ll;

struct data{
  int id;
  ll sum;
};

int main(void)
{

  int n;
  lll num, cost;
  data d[10000];

  while(cin >> n && n){
    int flag = true;
    for(int i = 0; i < n; i++){
      cin >> d[i].id >> cost >> num;
      d[i].sum = cost*num;
    }

    for(int i = 0; i < n-1; i++){
      for(int j = i+1; j < n; j++){
        if(d[i].id == d[j].id && d[j].id){
          d[i].sum += d[j].sum;
          d[j].id = false;
        }
      }
    }

    for(int i = 0; i < n; i++){
      if(d[i].sum >= 1000000 && d[i].id){
        cout << d[i].id << endl;
        flag = false;
      }
    }
    if(flag){
        cout << "NA" << endl;
    }
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'lll' was not declared in this scope; did you mean 'll'?
   21 |   lll num, cost;
      |   ^~~
      |   ll
a.cc:22:3: error: reference to 'data' is ambiguous
   22 |   data d[10000];
      |   ^~~~
In file included from /usr/include/c++/14/vector:69,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:12:8: note:                 'struct data'
   12 | struct data{
      |        ^~~~
a.cc:27:14: error: 'd' was not declared in this scope
   27 |       cin >> d[i].id >> cost >> num;
      |              ^
a.cc:27:25: error: 'cost' was not declared in this scope; did you mean 'const'?
   27 |       cin >> d[i].id >> cost >> num;
      |                         ^~~~
      |                         const
a.cc:27:33: error: 'num' was not declared in this scope; did you mean 'enum'?
   27 |       cin >> d[i].id >> cost >> num;
      |                                 ^~~
      |                                 enum
a.cc:33:12: error: 'd' was not declared in this scope
   33 |         if(d[i].id == d[j].id && d[j].id){
      |            ^
a.cc:41:10: error: 'd' was not declared in this scope
   41 |       if(d[i].sum >= 1000000 && d[i].id){
      |          ^
Language: C++

main()
{
  int kaisuu[100],syain[4000],n=1,tanka[4000],suuryou[4000];
  int i=0,j,flag=0,a=0;
  scanf("%d",&n);
  while(n!=0){
    
    
    for(i=0;i<n;i++){
      scanf("%d %d %d",&syain[i],&tanka[i],&suuryou[i]);
    }

    for(i=0;i<n;i++){
      if(1000000<=tanka[i] * suuryou[i]){
	printf("%d\n",syain[i]);
	flag=1;
      }
    }
    if(flag==0){
      printf("NA\n");
    }
    scanf("%d",&n);
  }
  return 0;
}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'scanf' was not declared in this scope
    5 |   scanf("%d",&n);
      |   ^~~~~
a.cc:15:9: error: 'printf' was not declared in this scope
   15 |         printf("%d\n",syain[i]);
      |         ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | main()
a.cc:20:7: error: 'printf' was not declared in this scope
   20 |       printf("NA\n");
      |       ^~~~~~
a.cc:20:7: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include "stdio.h"
#include "string.h"
long long N[4001];
int f[4001];
int main(){
    int x,n,p,i,j,c=0;
    scanf("%d",&i);
    while(i!=0){
        c=0;
        for(j=0;j<i;j++){
            scanf("%d%d%d",&x,&n,&p);
            N[x]+=n*p;
                if(N[x]>=1000000){
                    f[c]=x;
                    c++;
                    N[x]=-10000000000000;
                }
            }
        }
        if(c==0)
            printf("NA\n");
        else 
            for(j=0;j<c;j++)printf("%d\n",f[j]);
        memset(N,0L,4001);
        memset(f,0,4001);
        scanf("%d",&i);
    }
    return 0;
}

Compiler output:
a.cc:28:5: error: expected unqualified-id before 'return'
   28 |     return 0;
      |     ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
   29 | }
      | ^
Language: C++

#include <iostream>

using namespace std;

int main() {
  for (;;) {
    int n;
    cin >> n;
    if (!n) return 0;
    pair<int, pair<int, long long> > es[4001];
    for (int i = 1; i <= 4000; i++) {
      es[i].first = 5000;
      es[i].second.first = i;
      es[i].second.second = 0;
    }
    for (int i = 0; i < n; i++) {
      int id;
      long long v, c;
      cin >> id >> v >> c;
      es[id].first = min(es[id].first, i);
      es[id].second.second += v * c;
    }
    sort(es+1, es+4001);
    bool f = false;
    for (int i = 1; i <= 4000; i++)
      if (es[i].second.second >= 1000000) {
        f = true;
        cout << es[i].second.first << endl;
      }
    if (!f)
      cout << "NA" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   23 |     sort(es+1, es+4001);
      |     ^~~~
      |     short
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
	int n,num,price,amount;
	while(cin>>n&&n){
		vector<int> v;
		while(n--){
			cin>>num>>price>>amount;
			long long sum = price*amount;
			if(sum>=1000000) v.push_back(num);
		}
		if(v.size!=0) for(int i=0;i<v.size();++i)cout<<v[i]<<"\n";
		else cout<<"NA\n";
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:22: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   13 |                 if(v.size!=0) for(int i=0;i<v.size();++i)cout<<v[i]<<"\n";
      |                    ~~^~~~
      |                          ()
Language: C++

#include<iostream>
#include <sstream>
using namespace std;

struct Saler
{
	int Number;
	int Saled;
};

int main(){
	struct Saler* sl;
	int n, a, b, c, i;
	bool isFound;
	
loop:
	scanf("%d\n", &n);		// データ個数
	if(n == 0) goto end_scope;
	sl = (struct Saler*)malloc(sizeof(struct Saler) * n);
	memcpy(sl, 0, sizeof(struct Saler)*n);
	for(int j = 0; j < n; j++)
	{
		scanf("%d %d %d\n", &a, &b, &c);
		for(i = 0; i < n; i++)
		{
			if(sl[i].Number == 0)
			{
				sl[i].Number = a;
				sl[i].Saled = b * c;
				break;
			}
			if(sl[i].Number == a)
			{
				sl[i].Saled += b * c;
				break;
			}
		}
	}
	isFound = false;
	for(int j = 0; j < n; j++)
	{
		if(sl[i].Saled >= 1000000)
		{
			cout << sl[i].Number << endl;
			isFound = true;
		}
	}
	!isFound && (cout << "NA" << endl);
end_scope:
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'memcpy' was not declared in this scope
   20 |         memcpy(sl, 0, sizeof(struct Saler)*n);
      |         ^~~~~~
a.cc:3:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <sstream>
  +++ |+#include <cstring>
    3 | using namespace std;
Language: C++

#include<iostream>
#include <sstream>
#include <cstdlib>
using namespace std;

struct Saler
{
	int Number;
	int Saled;
};

int main(){
	struct Saler* sl;
	int n, a, b, c, i;
	bool isFound;
	
loop:
	scanf("%d\n", &n);		// データ個数
	if(n == 0) goto end_scope;
	sl = (struct Saler*)malloc(sizeof(struct Saler) * n);
	memcpy(sl, 0, sizeof(struct Saler)*n);
	for(int j = 0; j < n; j++)
	{
		scanf("%d %d %d\n", &a, &b, &c);
		for(i = 0; i < n; i++)
		{
			if(sl[i].Number == 0)
			{
				sl[i].Number = a;
				sl[i].Saled = b * c;
				break;
			}
			if(sl[i].Number == a)
			{
				sl[i].Saled += b * c;
				break;
			}
		}
	}
	isFound = false;
	for(int j = 0; j < n; j++)
	{
		if(sl[i].Saled >= 1000000)
		{
			cout << sl[i].Number << endl;
			isFound = true;
		}
	}
	!isFound && (cout << "NA" << endl);
end_scope:
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'memcpy' was not declared in this scope
   21 |         memcpy(sl, 0, sizeof(struct Saler)*n);
      |         ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <cstdlib>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<stdio.h>


int main(){
	int n;
	int id[4000],cid;
	long long int price,num,sale[4000];
	bool f;
	int i,j,idcount;
	while(scanf("%d",&n),n){

		f=true;
		idcount=0;

		for(i=0;i<n;i++){
			printf("data_id = %d\n",i);
			cid=int (0);
			price=num=long long int (0);
			scanf("%d",&cid);
			scanf("%lld",&price);
			scanf("%lld",&num);

			for(j=0;j<idcount;j++){
				if(id[j]==cid){
					sale[j]=sale[j]+price*num;
				}
			}

			if(j==idcount){
				id[idcount]=cid;
				sale[idcount]=price*num;
				idcount++;
			}
			for(j=0;j<idcount;j++){
				printf("%d %lld\n",id[j],sale[j]);
			}
		}



		for(i=0;i<idcount;i++){
			if(sale[i]>1000000){
				printf("%d\n",id[i]);
				f=false;
			}
		}
		if(f!=false)printf("NA\n");
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:35: error: expected primary-expression before 'long'
   18 |                         price=num=long long int (0);
      |                                   ^~~~
Language: C++

#include <stdio.h>
 
 

 
int main(void){
	int i,j,k;
	int n,num[4000];
	long long int tanka[4000],sale_num[4000],sale_all[4001];
	bool judge[4001];
	
	while(scanf("%d",&n),n){[
		k=0;
		for(j=0;j<=4001;j++){
			judge[j]=0;
			sale_all[j]=0;
		}
		
		for(i=0;i<n;i++){
			scanf("%d%lld%lld",&num[i],&tanka[i],&sale_num[i]);
		}
		
		//初期化

		
		//idに対応したsaleに+
		for(i=0;i<n;i++){
			sale_all[num[i]] = sale_all[num[i]] + tanka[i]*sale_num[i];
		}
		
		for(i=0;i<n;i++){
			if((sale_all[num[i]] >= 1000000)&&(judge[num[i]]==0)){
				printf("%d\n",num[i]);
				judge[num[i]]=1;
				k=1;
			}
		}
		
		if(k!=1)printf("NA\n");
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: expected ',' before ';' token
   13 |                 k=0;
      |                    ^
      |                    ,
a.cc:13:20: error: expected identifier before ';' token
a.cc:13:20: error: expected ']' before ';' token
   13 |                 k=0;
      |                    ^
      |                    ]
a.cc: In lambda function:
a.cc:13:20: error: expected '{' before ';' token
Language: C++

/*****include*****/
#include <iostream>
#include <fstream>

/*****デバッグ定義*****/
//#define DEBUG
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return 0;
	}
#endif
	/*****変数置き場*****/
	int n;
	int num[4000];
	bool appear[4001];
	int howmany;
	int number;
	long int in_price;
	long int in_sales;
	long int price[4000];
	long int sales[4000];
	/*****処理部*****/
	while(1){
		memset(appear,false,sizeof(appear));
		memset(price,0,sizeof(price));
		memset(sales,0,sizeof(sales));
		memset(num,0,sizeof(num));
		howmany = 0;
		cin >> n;
		if(n==0)	break;
		for(int i=0;i<n;i++){
			cin >> number;
			cin >> in_price;
			cin >> in_sales;
			price[number] += in_price;
			sales[number] += in_sales;
			if(!appear[number])	num[i] = number;
			appear[number] = true;
		}
		for(int i=0;i<n;i++){
			if(num[i] != 0){
				if(price[num[i]] * sales[num[i]] >= 1000000){
					cout << num[i] << endl;
					howmany++;
				}
				//cout << i << " " << price[num[i]] << " " << sales[num[i]] << endl;
			}
		}
		if(howmany == 0)	cout << "NA" << endl;
	}
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: 'memset' was not declared in this scope
   39 |                 memset(appear,false,sizeof(appear));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <fstream>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>
#include<set>
#include<string.h>

int main()
{
	int n;
	__int64 v[4001];
	std::vector<int> vec;
	
	while( 1 ){
		std::cin >> n;
	
		if( !n ) break;
		
		memset( v, 0, sizeof( v ) );
		vec.clear();
		
		while( n-- ){
			int num;
			int a, b;
		 	std::cin >> num >> a >> b;
			
			v[num] += (__int64)( a * b );
			vec.push_back( num );
		}
		
		for( int i = 1; i <= 4000; i++ ){
			if( v[i] < 1000000 ) v[i] = 0;
			else v[i] = 1;
		}
		
		if( std::count( v + 1, v + 4001, 1 ) == 0 ){
		 	std::cout << "NA" << std::endl;
		}
		else{
			std::set<int> s;
		
			for( std::vector<int>::iterator it = vec.begin(); it != vec.end(); it++ ){
				if( v[*it] && s.find( *it ) == s.end() ){
				 	std::cout << *it << std::endl;
				}
				
				s.insert( *it );
			}
		}
	}

 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
   10 |         __int64 v[4001];
      |         ^~~~~~~
      |         __int64_t
a.cc:18:25: error: 'v' was not declared in this scope
   18 |                 memset( v, 0, sizeof( v ) );
      |                         ^
Language: C++

#include <iostream>
#include <vector>

typedef long long __int64;
#define NOS (4000)

int main()
{
	const __int64 threshold = 1000000;
//	const __int64 NOS = 4000;
	int n;
	
	while (std::cin >> n, n) {
		std::vector<int> inputStaff(n);
		__int64 staff[NOS] = {0};
		
		while (n--) {
			int id;
			__int64 unit, quantity;
			std::cin >> id >> unit >> quantity;
			staff[id - 1] += unit * quantity;
			if (std::find(inputStaff.begin(), inputStaff.end(), id) == inputStaff.end()) inputStaff.push_back(id);
		}
		
		bool naFlag = true;
		std::vector<int>::iterator it = inputStaff.begin(), eit = inputStaff.end();
		for (; it != eit; ++it) {
			if (staff[*it - 1] >= threshold)  {
				naFlag = false;
				std::cout << *it << std::endl;
			}
		}
		if (naFlag) std::cout << "NA" << std::endl;
	}
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:38: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)'
   22 |                         if (std::find(inputStaff.begin(), inputStaff.end(), id) == inputStaff.end()) inputStaff.push_back(id);
      |                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:22:38: note:   '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   22 |                         if (std::find(inputStaff.begin(), inputStaff.end(), id) == inputStaff.end()) inputStaff.push_back(id);
      |                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~