submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s238302693
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<int> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str,' '); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:29:14: error: no matching function for call to 'std::vector<int>::push_back(__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type&)' 29 | res.push_back(ref[0]); | ~~~~~~~~~~~~~^~~~~~~~ In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'const std::vector<int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'std::vector<int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s329892010
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num; std::string str; std::vector<std::string> ref; std::vector<std::string> res; std::cin >> it_num; while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str,' '); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } } std::cin >> it_num } for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:32:19: error: expected ';' before '}' token 32 | std::cin >> it_num | ^ | ; 33 | } | ~
s034835574
p00100
C++
#include <iostream> #include <string> #include <vector> std::vector<std::string> split(const std::string& ref,char c){ std::vector<std::string> res; size_t current=0, found; while((found=ref.find_first_of(c,current))!=std::string::npos){ res.push_back(std::string(ref,current,found-current)); current=found+1; } res.push_back(std::string(ref,current,ref.size()-current)); return res; } int main(void){ int it_num=0; std::string str=""; std::vector<std::string> ref; std::vector<std::string> res; std::cin >> str; if(str!="") it_num=std::stoi(str); while(it_num!=0){ for(int i=0;i<it_num;i++){ std::getline(std::cin,str); ref=split(str,' '); if((std::stoi(ref[1])*std::stoi(ref[2]))>=1000000){ res.push_back(ref[0]); } if(res.size()==0){ std::cout << "NA" << std::endl; }else{ for(int j=0;j<res.size();j++){ std::cout << res[j] << std::endl; } } } res.clear() std::cin >> it_num; } return 0; }
a.cc: In function 'int main()': a.cc:41:12: error: expected ';' before 'std' 41 | res.clear() | ^ | ; 42 | std::cin >> it_num; | ~~~
s216662568
p00100
C++
using namespace std; typedef long long ll; ll em[4000]; int flag[4000]; int main(){ int n; while(true){ int id,p,q; cin >> n; if(!n) return 0; for(int i = 0; i < n; i++){ cin>>id>>p>>q; em[id-1] += (ll)p * q; flag[i] = id; } int f = 1; for(int i = 0; i < n; i++){ if(em[flag[i]-1] >= 1000000){ cout << flag[i] << endl; f = 0; } em[flag[i]-1] = 0; } if(f) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:17: error: 'cin' was not declared in this scope 11 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:21:33: error: 'cout' was not declared in this scope 21 | cout << flag[i] << endl; | ^~~~ a.cc:21:33: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:21:52: error: 'endl' was not declared in this scope 21 | cout << flag[i] << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:26:23: error: 'cout' was not declared in this scope 26 | if(f) cout << "NA" << endl; | ^~~~ a.cc:26:23: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:26:39: error: 'endl' was not declared in this scope 26 | if(f) cout << "NA" << endl; | ^~~~ a.cc:26:39: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s946582969
p00100
C++
#include<iostream> using namespace std; #define SHINE_MAX 4000 #define ELITE 1000000 #define AHO "NA" int shineN,eliteN; long int shineU[SHINE_MAX]; //?£?????????? int num,tanka,suryo; int i; int main(){ white(1){ cin>>shineN; if(shineN==0){break;} for(i=0;i<SHINE_MAX;i++){shineU[i]=0;} for(i=0;i<shineN;i++){ cin>>num,tanka,suryo; shineU[num]+=tanka*suryo; } //??¨?????????????????¨ eliteN=0; for(i=0;i<SHINE_MAX && eliteN<shineN;i++){ if(ELITE<=shineU[i]){ cout<<i<<endl; eliteN++; } } if(eliteN==0){cout<<AHO<<endl;} } return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'white' was not declared in this scope; did you mean 'fwrite'? 15 | white(1){ | ^~~~~ | fwrite
s998218510
p00100
C++
#include<iostream> using namespace std; #define SHINE_MAX 4000 #define ELITE 1000000 #define AHO "NA" int shineN,eliteN; long int shineU[SHINE_MAX]; //?£?????????? int num,tanka,suryo; int i; int main(){ white(1){ cin>>shineN; if(shineN==0){break;} for(i=0;i<SHINE_MAX;i++){shineU[i]=0;} for(i=0;i<shineN;i++){ cin>>num,tanka,suryo; shineU[num-1]+=tanka*suryo; } //??¨?????????????????¨ eliteN=0; for(i=0;i<SHINE_MAX && eliteN<shineN;i++){ if(ELITE<=shineU[i]){ cout<<i<<endl; eliteN++; } } if(eliteN==0){cout<<AHO<<endl;} } return 0; }
a.cc: In function 'int main()': a.cc:15:9: error: 'white' was not declared in this scope; did you mean 'fwrite'? 15 | white(1){ | ^~~~~ | fwrite
s851416060
p00100
C++
#include<iostream> using namespace std; #define SHINE_MAX 4000 #define ELITE 1000000 #define AHO "NA" int shineN,eliteN; int shineI[SHINE_MAX] //?????????????????? long int shineU[SHINE_MAX]; //?£?????????? int dataN,num,tanka,suryo; int i,j; int main(){ while(1){ //??\??? cin>>dataN; if(dataN==0){break;} shineN=0; for(j=0;j<dataN;j++){ cin>>num>>tanka>>suryo;num--; //???????????????????????????????????¨?????????????????? for(i=0;i<shineN;i++){ if(enemyI[i]==num){break;} } if(i==shineN){ //?????¨???????????£???????????? shineU[num]=0; enemyI[shineN]=num; shineN++; } shineU[num]+=suryo*tanka; } //?????? eliteN=0; for(j=0;j<shineN;j++){ i=shineI[j]; if(ELITE<=shineU[i]){ cout<<i+1<<endl; eliteN++; } } if(eliteN==0){cout<<AHO<<endl;} } return 0; }
a.cc:10:1: error: expected initializer before 'long' 10 | long int shineU[SHINE_MAX]; //?£?????????? | ^~~~ a.cc: In function 'int main()': a.cc:25:14: error: 'enemyI' was not declared in this scope 25 | if(enemyI[i]==num){break;} | ^~~~~~ a.cc:28:11: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 28 | shineU[num]=0; | ^~~~~~ | shineN a.cc:29:11: error: 'enemyI' was not declared in this scope 29 | enemyI[shineN]=num; | ^~~~~~ a.cc:32:10: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 32 | shineU[num]+=suryo*tanka; | ^~~~~~ | shineN a.cc:37:12: error: 'shineI' was not declared in this scope; did you mean 'shineN'? 37 | i=shineI[j]; | ^~~~~~ | shineN a.cc:38:20: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 38 | if(ELITE<=shineU[i]){ | ^~~~~~ | shineN
s296561432
p00100
C++
#include<iostream> using namespace std; #define SHINE_MAX 4000 #define ELITE 1000000 #define AHO "NA" int shineN,eliteN; int shineI[SHINE_MAX] //?????????????????? long int shineU[SHINE_MAX]; //?£?????????? int dataN,num,tanka,suryo; int i,j; int main(){ while(1){ //??\??? cin>>dataN; if(dataN==0){break;} shineN=0; for(j=0;j<dataN;j++){ cin>>num>>tanka>>suryo;num--; //???????????????????????????????????¨?????????????????? for(i=0;i<shineN;i++){ if(shineI[i]==num){break;} } if(i==shineN){ //?????¨???????????£???????????? shineU[num]=0; shineI[shineN]=num; shineN++; } shineU[num]+=suryo*tanka; } //?????? eliteN=0; for(j=0;j<shineN;j++){ i=shineI[j]; if(ELITE<=shineU[i]){ cout<<i+1<<endl; eliteN++; } } if(eliteN==0){cout<<AHO<<endl;} } return 0; }
a.cc:10:1: error: expected initializer before 'long' 10 | long int shineU[SHINE_MAX]; //?£?????????? | ^~~~ a.cc: In function 'int main()': a.cc:25:14: error: 'shineI' was not declared in this scope; did you mean 'shineN'? 25 | if(shineI[i]==num){break;} | ^~~~~~ | shineN a.cc:28:11: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 28 | shineU[num]=0; | ^~~~~~ | shineN a.cc:29:11: error: 'shineI' was not declared in this scope; did you mean 'shineN'? 29 | shineI[shineN]=num; | ^~~~~~ | shineN a.cc:32:10: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 32 | shineU[num]+=suryo*tanka; | ^~~~~~ | shineN a.cc:37:12: error: 'shineI' was not declared in this scope; did you mean 'shineN'? 37 | i=shineI[j]; | ^~~~~~ | shineN a.cc:38:20: error: 'shineU' was not declared in this scope; did you mean 'shineN'? 38 | if(ELITE<=shineU[i]){ | ^~~~~~ | shineN
s530393780
p00100
C++
#include<iostream> using namespace std; #define SHINE_MAX 4000 #define ELITE 1000000 #define AHO "NA" int shineN,eliteN; int shineI[SHINE_MAX]; //?????????????????? long int shineU[SHINE_MAX]; //?£?????????? int dataN,num long int tanka,suryo; int i,j; int main(){ while(1){ //??\??? cin>>dataN; if(dataN==0){break;} shineN=0; for(j=0;j<dataN;j++){ cin>>num>>tanka>>suryo;num--; //???????????????????????????????????¨?????????????????? for(i=0;i<shineN;i++){ if(shineI[i]==num){break;} } if(i==shineN){ //?????¨???????????£???????????? shineU[num]=0; shineI[shineN]=num; shineN++; } shineU[num]+=suryo*tanka; } //?????? eliteN=0; for(j=0;j<shineN;j++){ i=shineI[j]; if(ELITE<=shineU[i]){ cout<<i+1<<endl; eliteN++; } } if(eliteN==0){cout<<AHO<<endl;} } return 0; }
a.cc:13:1: error: expected initializer before 'long' 13 | long int tanka,suryo; | ^~~~ a.cc: In function 'int main()': a.cc:23:15: error: 'num' was not declared in this scope; did you mean 'enum'? 23 | cin>>num>>tanka>>suryo;num--; | ^~~ | enum a.cc:23:20: error: 'tanka' was not declared in this scope 23 | cin>>num>>tanka>>suryo;num--; | ^~~~~ a.cc:23:27: error: 'suryo' was not declared in this scope 23 | cin>>num>>tanka>>suryo;num--; | ^~~~~
s172804280
p00100
C++
ggggggggggggggggg
a.cc:1:1: error: 'ggggggggggggggggg' does not name a type 1 | ggggggggggggggggg | ^~~~~~~~~~~~~~~~~
s347923606
p00100
C++
#include<iostream> using std; int main(){ int id,price,num,count; bool isBe=false; while(true){ cin>>count; if(count==0){ break; } for(int i=0;i<count;i++){ cin>>id>>price>>num; if(price*num>=100000){ cout<<id<<'\n'; isBe=true; } } if(!isBe){ cout<<"NA\n"; } count=0; isBe=false; } return 0; }
a.cc:2:7: error: expected nested-name-specifier before 'std' 2 | using std; | ^~~ a.cc: In function 'int main()': a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 8 | cin>>count; | ^~~ | 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:15:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 15 | cout<<id<<'\n'; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:20:4: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 20 | cout<<"NA\n"; | ^~~~ | std::cout /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~
s330394080
p00100
C++
#include<iostream> using namespace std; int main(){ int id,price,num,count,SaleResult[4000]; bool isBe=false; while(true){ cin>>count; if(count==0){ break; } for(int i=0;i<count;i++){ cin>>id>>price>>num; SaleResult[id]+=price*num; if(SaleResult[id]>=1000000&&){ cout<<id<<'\n'; isBe=true; } } if(!isBe){ cout<<"NA\n"; } count=0; isBe=false; for(int i=0;i<4000;i++){ SaleResult[id]=0; } } return 0; }
a.cc: In function 'int main()': a.cc:16:32: error: expected primary-expression before ')' token 16 | if(SaleResult[id]>=1000000&&){ | ^
s409309583
p00100
C++
//Sale Result // //?????????????£?????????¨?£??????°???????¨????????????????????????????????????????????????????????£?????????¨?£??????°??????????????????????£???????????????????????????? 1, 000, 000 ?????\??????????????????????????????????????????????????°??????????????????????????????????????????????????°????????´????????????????????????????????\????????????????????????????????????????????????????????????????????????????????????????????????????????????????????´?????????NA?????¨???????????????????????????????????? 4000 ???????????¨??????1??????4000?????§?????????????????????????????????????????????????????????????????????????????¨?????????????????????????£?????????? 1, 000, 000 ?????\?????§????£??????°?????? 100, 000 ?????\?????¨???????????? //Input // //?????°???????????????????????????????????????????????\??????????????????0???????????????????????????????????\????????¨????????? // //???????????° n //???????????? ????£??????? ?£??????°???(??´??°;????§????????????????) // : // : // // Output // // ????????????????????????????????????????????????(??´??°)?????? ????????? NA(????§???±??§??????) // Sample Input // // 4 // 1001 2000 520 // 1002 1800 450 // 1003 1600 625 // 1001 200 1220 // 2 // 1001 100 3 // 1005 1000 100 // 2 // 2013 5000 100 // 2013 5000 100 // 0 // // Output for the Sample Input // // 1001 // 1003 // NA // 2013 #define _CRT_SECURE_NO_WARNINGS 1 using namespace std; #include <stdio.h> #include <map> #define BASE_VALUE 1000000 // ?£????????????? int main() { char input[1024]; // ??\???????????? int n = 0; // ???????????° int no = 0; // ???????????? int price = 0; // ????£??????? int saleNum = 0; // ?£??????°??? bool flg = false; // ????????????????????¨?????????????????? map<int, int> proceed; // ?£??????????map map<int, int>::iterator ite; // ?£??????????map????????¬?????? while (true) { // ????????? n = 0; flg = false; proceed.clear(); memset(input, 0x00, sizeof(input)); // ???????????°??\??? scanf("%s", &input); n = atoi(input); if (0 == n) {// 0?????\??????????????°?????? break; } for (int i = 0; i < n; ++i) { // ?????????????????\??? scanf("%d %d %d", &no, &price, &saleNum); proceed[no] += price*saleNum; } for (ite = proceed.begin(); ite != proceed.end(); ++ite) { if (BASE_VALUE <= ite->second) {// ?£???????????????????????????? 1,000,000 ?????\???????????? printf("%d\n", ite->first); flg = true; } } if (!flg) {// ????????????????????¨????????? printf("NA\n"); } } }
a.cc: In function 'int main()': a.cc:64:17: error: 'memset' was not declared in this scope 64 | memset(input, 0x00, sizeof(input)); | ^~~~~~ a.cc:44:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 43 | #include <map> +++ |+#include <cstring> 44 | a.cc:69:21: error: 'atoi' was not declared in this scope 69 | n = atoi(input); | ^~~~
s802967965
p00100
C++
//Sale Result // //?????????????£?????????¨?£??????°???????¨????????????????????????????????????????????????????????£?????????¨?£??????°??????????????????????£???????????????????????????? 1, 000, 000 ?????\??????????????????????????????????????????????????°??????????????????????????????????????????????????°????????´????????????????????????????????\????????????????????????????????????????????????????????????????????????????????????????????????????????????????????´?????????NA?????¨???????????????????????????????????? 4000 ???????????¨??????1??????4000?????§?????????????????????????????????????????????????????????????????????????????¨?????????????????????????£?????????? 1, 000, 000 ?????\?????§????£??????°?????? 100, 000 ?????\?????¨???????????? //Input // //?????°???????????????????????????????????????????????\??????????????????0???????????????????????????????????\????????¨????????? // //???????????° n //???????????? ????£??????? ?£??????°???(??´??°;????§????????????????) // : // : // // Output // // ????????????????????????????????????????????????(??´??°)?????? ????????? NA(????§???±??§??????) // Sample Input // // 4 // 1001 2000 520 // 1002 1800 450 // 1003 1600 625 // 1001 200 1220 // 2 // 1001 100 3 // 1005 1000 100 // 2 // 2013 5000 100 // 2013 5000 100 // 0 // // Output for the Sample Input // // 1001 // 1003 // NA // 2013 #define _CRT_SECURE_NO_WARNINGS 1 using namespace std; #include <stdio.h> #include <map> #define BASE_VALUE 1000000 // ?£????????????? int main() { char input[1024]; // ??\???????????? int n = 0; // ???????????° int no = 0; // ???????????? int price = 0; // ????£??????? int saleNum = 0; // ?£??????°??? bool flg = false; // ????????????????????¨?????????????????? map<int, int> proceed; // ?£??????????map map<int, int>::iterator ite; // ?£??????????map????????¬?????? while (true) { // ????????? n = 0; flg = false; proceed.clear(); memset(input, 0x00, sizeof(input)); // ???????????°??\??? scanf("%s", &input); n = atoi(input); if (0 == n) {// 0?????\??????????????°?????? break; } for (int i = 0; i < n; ++i) { // ?????????????????\??? scanf("%d %d %d", &no, &price, &saleNum); proceed[no] += price*saleNum; } for (ite = proceed.begin(); ite != proceed.end(); ++ite) { if (BASE_VALUE <= ite->second) {// ?£???????????????????????????? 1,000,000 ?????\???????????? printf("%d\n", ite->first); flg = true; } } if (!flg) {// ????????????????????¨????????? printf("NA\n"); } } }
a.cc: In function 'int main()': a.cc:64:17: error: 'memset' was not declared in this scope 64 | memset(input, 0x00, sizeof(input)); | ^~~~~~ a.cc:44:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 43 | #include <map> +++ |+#include <cstring> 44 | a.cc:69:21: error: 'atoi' was not declared in this scope 69 | n = atoi(input); | ^~~~
s388930696
p00100
C++
include <iostream> #include <map> #include <vector> using namespace std; int main(){ int n,number; long long a,b; bool flag; map<int,long long> info; vector<int> seq; while(cin >> n && n){ info.clear(); seq.clear(); while(n--){ cin >> number >> a >> b; if(!info[number])seq.push_back(number); // ??¢????????£????????¨???????¨???????????????\??????????????????0?????±????????????????????????????????? info[number] += a*b; } flag = true; for(int i=0;i<seq.size();i++){ if(info[seq[i]]>=1000000){ flag = false; cout << seq[i] << endl; } } if(flag)cout << "NA" << endl; } }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | st
s282424125
p00100
C++
include <iostream> #include <map> #include <vector> using namespace std; int main(){ int n,number; long long a,b; bool flag; map<int,long long> info; vector<int> seq; while(cin >> n && n){ info.clear(); seq.clear(); while(n--){ cin >> number >> a >> b; if(!info[number])seq.push_back(number); info[number] += a*b; } flag = true; for(int i=0;i<seq.size();i++){ if(info[seq[i]]>=1000000){ flag = false; cout << seq[i] << endl; } } if(flag)cout << "NA" << endl; } }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 | st
s373249458
p00100
C++
#include <iostream> #include <vector> #include <algorithm> // sort #include <map> // pair using namespace std; int n; int main(){ while((cin >> n) != 0){ int num = 0; vector<pair<int, int> > pairs(n); for(int i = 0; i < n; i++){ int p, q; cin >> pairs[i].first >> p >> q; pairs[i].second = p * q; } sort(pairs.begin(), pairs.end()); int sum = 0; sum = pairs[0].second; for(int i = 1; i < n; i++){ if(pairs[i].first == pairs[i-1].first){ sum += pairs[i].second; }else{ if(sum >= 1000000){ cout << sum << \n; num++; } sum == pairs[i].second; } } if(num == 0){ cout << "NA\n"; } } return 0; }
a.cc:28:56: error: stray '\' in program 28 | cout << sum << \n; | ^ a.cc: In function 'int main()': a.cc:9:26: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 9 | while((cin >> n) != 0){ | ~~~~~~~~~~ ^~ ~ | | | | | int | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:9:26: note: candidate: 'operator!=(int, int)' (built-in) 9 | while((cin >> n) != 0){ | ~~~~~~~~~~~^~~~ a.cc:9:26: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 9 | while((cin >> n) != 0){ | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 9 | while((cin >> n) != 0){ | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 9 | while((cin >> n) != 0){ | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 9 | while((cin >> n) != 0){ | ^ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:9:29: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/basic_string.h:3833:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3833 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3833:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/basic_string.h:3847:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 3847 | operator!=(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3847:5: note: template argument deduction/substitution failed: a.cc:9:29: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>' 9 | while((cin >> n) != 0){ | ^ /usr/include/c++/14/bits/basic_string.h:3860:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator!=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 3860 | operator!=(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:3860:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 9 | while((cin >> n) != 0){ | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/string:68: /usr/include/c++/14/tuple:2613:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator!=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)' 2613 | operator!=(const tuple<_TElements...>& __t, | ^~~~~~~~ /usr/include/c++/14/tuple:2613:5: note: template argument deduction/substitution failed: a.cc:9:29: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>' 9 | while((cin >> n) != 0){ |
s740699678
p00100
C++
#include <iostream> int main() { bool loop = true; while (loop) { int dataset_num; itn count = 0; std::cin >> dataset_num; if (dataset_num == 0) { loop = false; break; } for (int i = 0; i < dataset_num; i++) { int officer_num; int price; int figure; std::cin >> officer_num; std::cin >> price; std::cin >> figure; if (price * figure >= 1000000) { std::cout << officer_num; count +=1; } } if (count == 0) { std::cout << "NA" << std::endl; } } return 0; }
a.cc: In function 'int main()': a.cc:9:9: error: 'itn' was not declared in this scope; did you mean 'int'? 9 | itn count = 0; | ^~~ | int a.cc:27:17: error: 'count' was not declared in this scope 27 | count +=1; | ^~~~~ a.cc:30:13: error: 'count' was not declared in this scope 30 | if (count == 0) { | ^~~~~
s802459353
p00100
C++
// a.c.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { int n; int ban, tan, suu; int bango[4001]; int flg,i; while (1){ for (i = 1; i <= 4000; i++){ bango[i] = 0; } scanf_s("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf_s("%d %d %d", &ban, &tan, &suu); bango[ban] += tan*suu; } flg = 0; for (i = 1; i <= 4000; i++){ if (bango[i]>=1000000){ printf("%d\n", i); flg = 1; } } if (!flg){ printf("NA\n"); } } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s062465489
p00100
C++
// a.c.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { int n; int ban, tan, suu; long long int bango[4001]; int flg,i; while (1){ for (i = 1; i <= 4000; i++){ bango[i] = 0; } scanf_s("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf_s("%d %d %d", &ban, &tan, &suu); bango[ban] += tan*suu; } flg = 0; for (i = 1; i <= 4000; i++){ if (bango[i]>=1000000){ printf("%d\n", i); flg = 1; } } if (!flg){ printf("NA\n"); } } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s886389141
p00100
C++
// a.c.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include <stdio.h> int main(void){ int n; int ban, tan, suu; long long int bango[4001]; int flg,i; while (1){ for (i = 1; i <= 4000; i++){ bango[i] = 0; } scanf_s("%d", &n); if (n == 0){ break; } for (i = 0; i < n; i++){ scanf_s("%d %d %d", &ban, &tan, &suu); bango[ban] += tan*suu; } flg = 0; for (i = 1; i <= 4000; i++){ if (bango[i]>=1000000){ printf("%d\n", i); flg = 1; } } if (!flg){ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:14:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 14 | scanf_s("%d", &n); | ^~~~~~~ | scanf
s958881388
p00100
C++
#include <bits/stdc++.h> using namespace std ; #define pb(n) push_back(n) #define fi first #define se second #define all(r) (r).begin(),(r).end() #define gsort(st,en) sort((st),(en),greater<int>()) #define vmax(ary) *max_element(all(ary)) #define vmin(ary) *min_element(all(ary)) #define debug(x) cout<<#x<<": "<<x<<endl #define fcout(n) cout<<fixed<<setprecision((n)) #define scout(n) cout<<setw(n) #define vary(type,name,size,init) vector< type> name(size,init) #define rep(i,n) for(int i = 0; i < (int)(n);++i) #define REP(i,a,b) for(int i = (a);i < (int)(b);++i) #define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it) #define repa(n,array) for(auto &n :(array)) using ll = long long; using vi = vector<int>; using vl = vector<ll>; using dict = map<string,int>; using pii = pair<ll,ll> ; constexpr int imax = ((1<<30)-1)*2+1 ; constexpr int inf = 100000000; constexpr double PI = acos(-1.0) ; double eps = 1e-10 ; const int dy[] = {-1,0,1,0}; const int dx[] = {0,-1,0,1}; inline bool value(int x,int y,int w,int h){ return (x >= 0 && x < w && y >= 0 && y < h); } template<typename T> void Unique(vector<T> &v){ sort(all(v)); v.erase(unique(all(v)),v.end()); } template<typename T> T ston(string& str, T n){ istringstream sin(str) ; T num ; sin >> num ; return num ; } void Ans(bool f){ if(f) cout << "YES"<<endl; else cout << "NO"<<endl; } int main(){ cin.tie(0); ios::sync_with_stdio(false); int n,a,b,c; while(cin >> n && n){ vector<pair<ll,ll>> v; vary(ll,v2,4005,0); int cnt=0; rep(i,n){ cin >> a >> b >> c; if(v2[a] == 0){ ++cnt; v.push_back(make_pair(cnt,a)); } if(v2[a] + b * a >= 1000000)i v2[a] = 1000000; if(v2[a] < 1000000) v2[a] += b * c; } sort(all(v),[](const pii &p,const pii &p2){return p.fi < p2.fi;}); bool f = false; // debug(v.size()); REP(i,0,v.size()){ if(v2[v[i].se] < 1000000){ } else{ cout << v[i].se<<endl; // debug(v2[v[i].se]); f = true; } } if(!f) cout << "NA"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:71:36: error: expected ';' before 'v2' 71 | if(v2[a] + b * a >= 1000000)i v2[a] = 1000000; | ^~~ | ;
s834573165
p00100
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n; while(cin >> n){ if(n == 0) break; int id, price, amount; vector<int> v; for(int i = 0; i < n; i++){ cin >> id >> price >> amount; if(price * amount >= 10000){ auto itr = find(v.begin(), v.end(), id); if(itr == v.end()){ v.push_back(id); } } } if(v.empty()){ cout << "NA" << endl; } else{ for(int i = 0; i < v.size(); i++){ cout << v[i] << endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:14:48: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 14 | auto itr = find(v.begin(), v.end(), 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:14:48: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 14 | auto itr = find(v.begin(), v.end(), id); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
s180022173
p00100
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n; while(cin >> n){ if(n == 0) break; int id, price, amount; vector<int> v; for(int i = 0; i < n; i++){ cin >> id >> price >> amount; if(price * amount >= 10000){ vector<int>::iterator itr = find(v.begin(), v.end(), id); if(itr == v.end()){ v.push_back(id); } } } if(v.empty()){ cout << "NA" << endl; } else{ for(int i = 0; i < v.size(); i++){ cout << v[i] << endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:14:65: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 14 | vector<int>::iterator itr = find(v.begin(), v.end(), 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:14:65: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 14 | vector<int>::iterator itr = find(v.begin(), v.end(), id); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~
s284075481
p00100
C++
#include <cstdio.h> using namespace std; int main() { int tmp=0, tmpi=0, tmpp=0, tmpq=0, n=1, tmpn=0, ans0=0; long long int ans[4001]; while (1) { ans0=0; scanf("%d", &n); if (n==0) break; for (tmp=0;tmp<4001;tmp++) ans[tmp]=0; for (tmpn=0;tmpn<n;tmpn++) { scanf("%d %d %d", &tmpi, &tmpp, &tmpq); ans[tmpi]+=(long long int)tmpp*tmpq; } for (tmp=0;tmp<4001;tmp++) { if (ans[tmp]>=1000000) { ans0++; printf("%d\n", tmp); } } if (ans0==0) puts("NA"); } return 0; }
a.cc:1:10: fatal error: cstdio.h: No such file or directory 1 | #include <cstdio.h> | ^~~~~~~~~~ compilation terminated.
s883103843
p00100
C++
#include<iostream> #include<map> #include<vector> using namespace std; int main() { int n; while(cin>>n && n){ map<int,int> mp; vector<int> v; for(int i=0; i<n; i++){ int e,p,q; cin>>e>>p>>q; if(!mp[e]) v.push_back(e); mp[e]+=p*q; } bool flg=false; for(int i=0; i<v.size(); i++){ if(mp[v[i]]>=1000000){ flg=true; cout<<v[i]<<endl; } else if(!flg){ cout<<"NA"<<endl; } } }
a.cc: In function 'int main()': a.cc:36:6: error: expected '}' at end of input 36 | } | ^ a.cc:7:1: note: to match this '{' 7 | { | ^
s410725450
p00100
C++
#include<iostream> #include<map> #include<vector> using namespace std; int main() { int n; while(cin>>n && n){ map<int,int> mp; vector<int> v; for(int i=0; i<n; i++){ int e,p,q; cin>>e>>p>>q; if(!mp[e]) v.push_back(e); mp[e]+=p*q; } bool flg=false; for(int i=0; i<v.size(); i++){ if(mp[v[i]]>=1000000){ flg=true; cout<<v[i]<<endl; } else if(!flg){ cout<<"NA"<<endl; } } }
a.cc: In function 'int main()': a.cc:36:6: error: expected '}' at end of input 36 | } | ^ a.cc:7:1: note: to match this '{' 7 | { | ^
s360900454
p00100
C++
num=int(input()) emp=[] cnt=0 for i in range(num): emp.append(num) emp[i]=[int(k) for k in input().split()] for i in range(num): for q in range(i+1,num): if emp[i][0]==emp[q][0]: emp[i][1]=emp[i][1]+emp[q][1] emp[i][2]=emp[i][2]+emp[q][2] emp[q][1],emp[q][2]=0,0 if emp[i][1]*emp[i][2]>=1000000: print(emp[i][0]) cnt+=1 if cnt==0: print('NA')
a.cc:17:11: warning: multi-character character constant [-Wmultichar] 17 | print('NA') | ^~~~ a.cc:1:1: error: 'num' does not name a type; did you mean 'enum'? 1 | num=int(input()) | ^~~ | enum
s221705796
p00100
C++
#include<iostream> using namespace std; int main() { long long number[4001] = {}; long long e, p, q; int MAX = 0; int n; while (cin >> n, n) { for (int i = 0; i < n; i++) { cin >> e >> p >> q; if (MAX <= e) { MAX = e; } number[e - 1] += p*q; } } int x = 0; for (int i = 0; i < e; i++) { if (number[i] >= 1000000) { cout << number[i]; x++; } } if (x == 0){cout << "NA" << endl; return 0; }
a.cc: In function 'int main()': a.cc:25:2: error: expected '}' at end of input 25 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s694350885
p00100
C++
#include <cstdio> #include <cmath> using namespace std; int n, e, p, q; int main() { while(scanf("%d", &n), n) { for(int i = 0, i < n; i++) { scanf("%d %d %d", e, p, q); if(p * q >= 1e6) printf("%d\n", e); } } }
a.cc: In function 'int main()': a.cc:10:21: error: expected ';' before '<' token 10 | for(int i = 0, i < n; i++) { | ^~ | ; a.cc:10:22: error: expected primary-expression before '<' token 10 | for(int i = 0, i < n; i++) { | ^
s020163675
p00100
C++
#include<iostream> #include<vector>; using namespace std; int main() { int n; while (cin >> n){ if (n == 0)break; long long u[4010] = { 0 }; vector<int>l; for (int i = 0; i < n; i++){ long a, b, c; cin >> a >> b >> c; u[a] += b*c; if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); } for (int i = 0; i < l.size(); i++){ cout << l[i] << endl; } if (!l.size())cout << "NA" << endl; } return 0; }
a.cc:2:17: warning: extra tokens at end of #include directive 2 | #include<vector>; | ^ a.cc: In function 'int main()': a.cc:14:52: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, long int&)' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~ 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:14:52: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~
s580272649
p00100
C++
#include<iostream> #include<vector>; using namespace std; int main() { int n; while (cin >> n){ if (n == 0)break; long long u[4010] = { 0 }; vector<int>l; for (int i = 0; i < n; i++){ long a, b, c; cin >> a >> b >> c; u[a] += b*c; if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); } for (int i = 0; i < l.size(); i++){ cout << l[i] << endl; } if (!l.size())cout << "NA" << endl; } return 0; }
a.cc:2:17: warning: extra tokens at end of #include directive 2 | #include<vector>; | ^ a.cc: In function 'int main()': a.cc:14:52: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, long int&)' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~ 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:14:52: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~
s648593578
p00100
C++
#include<iostream> #include<vector>; using namespace std; int main() { int n; while (cin >> n){ if (n == 0)break; long long u[4010] = { 0 }; vector<int>l; for (int i = 0; i < n; i++){ long a, b, c; cin >> a >> b >> c; u[a] += b*c; if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); } for (int i = 0; i < l.size(); i++){ cout << l[i] << endl; } if (!l.size())cout << "NA" << endl; } return 0; }
a.cc:2:17: warning: extra tokens at end of #include directive 2 | #include<vector>; | ^ a.cc: In function 'int main()': a.cc:14:52: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, long int&)' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~ 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:14:52: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 14 | if (u[a] >= 1000000 && find(l.begin(), l.end(), a) == l.end())l.push_back(a); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~
s800576530
p00100
C++
#include <iostream> using namespace std; int main(){ int n; int x[4001] = {0}; int m[4001] = {0}; while(1){ int e, p, q; cin >> n; if(n == 0) break; x[4001] = {0}; bool flag = true; for(int i = 1; i <= n; i++){ cin >> e >> p >> q; m[i] = e; x[e] += p * q; } for(int i = 1; i <= n; i++){ if(x[m[i]] >= 1000000){ cout << m[i] << end; x[m[i]] = 0; flag = false; } } if(flag) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:46: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 25 | cout << m[i] << end; | ~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::nu
s518191990
p00100
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; }
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); | ~~~~^~~~~~~~~~~~~~~~~~
s718961056
p00100
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; }
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); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~
s617466133
p00100
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; }
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 |
s769047035
p00100
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; }
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>
s246454278
p00100
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; }
a.cc: In function 'int main()': a.cc:11:18: error: 'n' was not declared in this scope 11 | while(cin >> n, n != 0) { | ^
s727090000
p00100
C++
#define _CRT_SECURE_NO_WARNINGS #define _USE_MATH_DEFINES ?? #include <stdio.h> #include <ctype.h> #include <string> #include <iostream> #include <vector> #include <stack> #include <fstream> #include <sstream> #include <queue> #include <exception> #include <cmath> #include <numeric> ?? using namespace std; typedef long long int lint; ?? bool AOJ0100() { ????????lint n, e, p, q; ????????cin >> n; ????????if (n == 0) return false; ?? ????????lint* data = new lint[4001]; ????????for (int i = 0; i <= 4000; i++) data[i] = 0; ?? ????????for (lint i = 0; i < n; i++) { ????????????????cin >> e >> p >> q; ????????????????data[e] += p * q; ????????} ?? ????????bool flag = false; ????????for (int i = 1; i <= 4000; i++) { ????????????????if (data[i] >= 1000000) { ????????????????????????flag = true; ????????????????????????cout << i << endl; ????????????????} ????????} ????????if (!flag) cout << "NA" << endl; ?? ????????delete[] data; ????????return true; } ?? int main() { ????????while (AOJ0100()) { ????????} ????????return 0; }
a.cc:3:1: error: expected unqualified-id before '?' token 3 | ?? | ^ In file included from a.cc:5: /usr/include/ctype.h:81:14: error: '__int32_t' does not name a type; did you mean '__int128_t'? 81 | extern const __int32_t **__ctype_tolower_loc (void) | ^~~~~~~~~ | __int128_t /usr/include/ctype.h:83:14: error: '__int32_t' does not name a type; did you mean '__int128_t'? 83 | extern const __int32_t **__ctype_toupper_loc (void) | ^~~~~~~~~ | __int128_t In file included from /usr/include/wchar.h:53, from /usr/include/c++/14/cwchar:44, from /usr/include/c++/14/bits/postypes.h:40, from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:6: /usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h:6:9: error: '__mbstate_t' does not name a type 6 | typedef __mbstate_t mbstate_t; | ^~~~~~~~~~~ /usr/include/wchar.h:104:59: error: 'size_t' has not been declared 104 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:109:8: error: 'size_t' does not name a type 109 | extern size_t wcslcpy (wchar_t *__restrict __dest, | ^~~~~~ /usr/include/wchar.h:54:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 53 | #include <bits/types/mbstate_t.h> +++ |+#include <cstddef> 54 | #include <bits/types/__FILE.h> /usr/include/wchar.h:115:8: error: 'size_t' does not name a type 115 | extern size_t wcslcat (wchar_t *__restrict __dest, | ^~~~~~ /usr/include/wchar.h:115:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:126:59: error: 'size_t' has not been declared 126 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:133:63: error: 'size_t' has not been declared 133 | extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:142:25: error: 'size_t' has not been declared 142 | size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:150:27: error: 'size_t' has not been declared 150 | size_t __n, locale_t __loc) __THROW; | ^~~~~~ /usr/include/wchar.h:159:8: error: 'size_t' does not name a type 159 | extern size_t wcsxfrm (wchar_t *__restrict __s1, | ^~~~~~ /usr/include/wchar.h:159:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:174:8: error: 'size_t' does not name a type 174 | extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, | ^~~~~~ /usr/include/wchar.h:174:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:212:8: error: 'size_t' does not name a type 212 | extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) | ^~~~~~ /usr/include/wchar.h:212:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:216:8: error: 'size_t' does not name a type 216 | extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) | ^~~~~~ /usr/include/wchar.h:216:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:247:8: error: 'size_t' does not name a type 247 | extern size_t wcslen (const wchar_t *__s) __THROW __attribute_pure__; | ^~~~~~ /usr/include/wchar.h:247:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:265:8: error: 'size_t' does not name a type 265 | extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) | ^~~~~~ /usr/include/wchar.h:265:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:272:59: error: 'size_t' has not been declared 272 | extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) | ^~~~~~ /usr/include/wchar.h:275:38: error: 'size_t' has not been declared 275 | size_t __n) | ^~~~~~ /usr/include/wchar.h:283:63: error: 'size_t' has not been declared 283 | extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:288:58: error: 'size_t' has not been declared 288 | const wchar_t *__restrict __s2, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:292:63: error: 'size_t' has not been declared 292 | extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:296:53: error: 'size_t' has not been declared 296 | extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:302:59: error: 'size_t' has not been declared 302 | const wchar_t *__restrict __s2, size_t __n) | ^~~~~~ /usr/include/wchar.h:317:27: error: 'mbstate_t' does not name a type 317 | extern int mbsinit (const mbstate_t *__ps) __THROW __attribute_pure__; | ^~~~~~~~~ /usr/include/wchar.h:321:8: error: 'size_t' does not name a type 321 | extern size_t mbrtowc (wchar_t *__restrict __pwc, | ^~~~~~ /usr/include/wchar.h:321:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:326:8: error: 'size_t' does not name a type 326 | extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, | ^~~~~~ /usr/include/wchar.h:326:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:330:8: error: 'size_t' does not name a type 330 | extern size_t __mbrlen (const char *__restrict __s, size_t __n, | ^~~~~~ /usr/include/wchar.h:330:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:332:8: error: 'size_t' does not name a type 332 | extern size_t mbrlen (const char *__restrict __s, size_t __n, | ^~~~~~ /usr/include/wchar.h:332:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:362:8: error: 'size_t' does not name a type 362 | extern size_t mbsrtowcs (wchar_t *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:362:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:368:8: error: 'size_t' does not name a type 368 | extern size_t wcsrtombs (char *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:368:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:376:8: error: 'size_t' does not name a type 376 | extern size_t mbsnrtowcs (wchar_t *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:376:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:382:8: error: 'size_t' does not name a type 382 | extern size_t wcsnrtombs (char *__restrict __dst, | ^~~~~~ /usr/include/wchar.h:382:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/wchar.h:396:42: error: 'size_t' has not been declared 396 | extern int wcswidth (const wchar_t *__s, size_t __n) __THROW; | ^~~~~~ /usr/include/wchar.h:695:59: error: 'size_t' has not been declared 695 | const wchar_t *__restrict __src, size_t __n) | ^~~~~~ /usr/include/wchar.h:718:8: error: '__FILE' does not name a type; did you mean 'EMFILE'? 718 | extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) __THROW | ^~~~~~ | EMFILE /usr/include/wchar.h:725:19: error: '__FILE' was not declared in this scope; did you mean 'EMFILE'? 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~~~~ | EMFILE /usr/include/wchar.h:725:27: error: '__fp' was not declared in this scope 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~~ /usr/include/wchar.h:725:33: error: expected primary-expression before 'int' 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^~~ /usr/include/wchar.h:725:43: error: expression list treated as compound expression in initializer [-fpermissive] 725 | extern int fwide (__FILE *__fp, int __mode) __THROW; | ^ /usr/include/wchar.h:732:22: error: '__FILE' was not declared in this scope; did you mean 'EMFILE'? 732 | extern int fwprintf (__FILE *__restrict __stream, | ^~~~~~ | EMFILE /usr/include/wchar.h:732:30: error: expected primary-expression before '__restrict' 732 | extern int fwprintf (__FILE *__restrict __stream, |
s849819986
p00100
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 */
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); | ^
s795673726
p00100
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")
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while True: | ^~~~~
s445220878
p00100
C++
dfdf
a.cc:1:1: error: 'dfdf' does not name a type 1 | dfdf | ^~~~
s976874382
p00100
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; } } }
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 | } | ^
s187794660
p00100
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; }
a.cc: In function 'int main()': a.cc:17:24: error: 'find_if' was not declared in this scope 17 | auto pre = find_if( | ^~~~~~~
s299756873
p00100
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"; } }
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; | ^~~~
s378659283
p00100
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"); } }
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; | ^
s531707767
p00100
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"); } }
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; | ^
s556753164
p00100
C++
#include<bits/stdc++.h> using namespace std; int main() { while(1){ int n; cin>>n; if(n == 0){ break; } vector<int,int> data; for(int i = 0;i < n;++i){ int num,sa,ko; cin>>num; cin>>sa; cin>>ko; data.push_back(make_pair(num,sa * ko)); } for(pair<int,int> e : data){ if(e.second >= 1000000){ cout<<e.first<<endl; } } } return 0; }
In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>': /usr/include/c++/14/bits/stl_vector.h:428:11: required from 'class std::vector<int, int>' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ a.cc:14:21: required from here 14 | vector<int,int> data; | ^~~~ /usr/include/c++/14/bits/stl_vector.h:87:28: error: 'int' is not a class, struct, or union type 87 | rebind<_Tp>::other _Tp_alloc_type; | ^~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:89:9: error: 'int' is not a class, struct, or union type 89 | pointer; | ^~~~~~~ /usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<int, int>': a.cc:14:21: required from here 14 | vector<int,int> data; | ^~~~ /usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<int, int>::_Base' 518 | using _Base::_M_allocate; | ^~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<int, int>::_Base' 519 | using _Base::_M_deallocate; | ^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<int, int>::_Base' 521 | using _Base::_M_get_Tp_allocator; | ^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/cassert:43, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33: /usr/include/c++/14/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::_Vector_impl::_Vector_impl() [with _Tp = int; _Alloc = int]': a.cc:14:21: required from here 14 | vector<int,int> data; | ^~~~ /usr/include/c++/14/bits/stl_vector.h:136:24: error: 'int' is not a class, struct, or union type 136 | _Vector_impl() _GLIBCXX_NOEXCEPT_IF( | ^~~~~~~~~~~~~~~~~~~~ a.cc: In function 'int main()': a.cc:21:21: error: no matching function for call to 'std::vector<int, int>::push_back(std::pair<int, int>)' 21 | data.push_back(make_pair(num,sa * ko)); | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = int; value_type = int]' 1283 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'const std::vector<int, int>::value_type&' {aka 'const int&'} 1283 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = int; _Alloc = int; value_type = int]' 1300 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from 'std::pair<int, int>' to 'std::vector<int, int>::value_type&&' {aka 'int&&'} 1300 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ a.cc:24:27: error: no matching function for call to 'begin(std::vector<int, int>&)' 24 | for(pair<int,int> e : data){ | ^~~~ In file included from /usr/include/c++/14/bits/algorithmfwd.h:39, from /usr/include/c++/14/bits/stl_algo.h:59, from /usr/include/c++/14/algorithm:61, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51: /usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)' 88 | begin(initializer_list<_Tp> __ils) noexcept | ^~~~~ /usr/include/c++/14/initializer_list:88:5: note: template argument deduction/substitution failed: a.cc:24:27: note: 'std::vector<int, int>' is not derived from 'std::initializer_list<_Tp>' 24 | for(pair<int,int> e : data){ | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:52:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = std::vector<int, int>]': a.cc:24:27: required from here 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/bits/range_access.h:52:50: error: 'class std::vector<int, int>' has no member named 'begin' 52 | begin(_Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&)' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ^~~~~ /usr/include/c++/14/bits/range_access.h:63:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(const _Container&) [with _Container = std::vector<int, int>]': a.cc:24:27: required from here 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/bits/range_access.h:63:56: error: 'const class std::vector<int, int>' has no member named 'begin' 63 | begin(const _Container& __cont) -> decltype(__cont.begin()) | ~~~~~~~^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::begin(_Tp (&)[_Nm])' 95 | begin(_Tp (&__arr)[_Nm]) noexcept | ^~~~~ /usr/include/c++/14/bits/range_access.h:95:5: note: template argument deduction/substitution failed: a.cc:24:27: note: mismatched types '_Tp [_Nm]' and 'std::vector<int, int>' 24 | for(pair<int,int> e : data){ | ^~~~ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166: /usr/include/c++/14/valarray:1227:5: note: candidate: 'template<class _Tp> _Tp* std::begin(valarray<_Tp>&)' 1227 | begin(valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1227:5: note: template argument deduction/substitution failed: a.cc:24:27: note: 'std::vector<int, int>' is not derived from 'std::valarray<_Tp>' 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/valarray:1238:5: note: candidate: 'template<class _Tp> const _Tp* std::begin(const valarray<_Tp>&)' 1238 | begin(const valarray<_Tp>& __va) noexcept | ^~~~~ /usr/include/c++/14/valarray:1238:5: note: template argument deduction/substitution failed: a.cc:24:27: note: 'std::vector<int, int>' is not derived from 'const std::valarray<_Tp>' 24 | for(pair<int,int> e : data){ | ^~~~ a.cc:24:27: error: no matching function for call to 'end(std::vector<int, int>&)' /usr/include/c++/14/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)' 99 | end(initializer_list<_Tp> __ils) noexcept | ^~~ /usr/include/c++/14/initializer_list:99:5: note: template argument deduction/substitution failed: a.cc:24:27: note: 'std::vector<int, int>' is not derived from 'std::initializer_list<_Tp>' 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:74:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&) [with _Container = std::vector<int, int>]': a.cc:24:27: required from here 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/bits/range_access.h:74:48: error: 'class std::vector<int, int>' has no member named 'end' 74 | end(_Container& __cont) -> decltype(__cont.end()) | ~~~~~~~^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)' 85 | end(const _Container& __cont) -> decltype(__cont.end()) | ^~~ /usr/include/c++/14/bits/range_access.h:85:5: note: template argument deduction/substitution failed: /usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&) [with _Container = std::vector<int, int>]': a.cc:24:27: required from here 24 | for(pair<int,int> e : data){ | ^~~~ /usr/include/c++/14/bits/range_access.h:85:54: error: 'const class std::vector<int, int>' has no member named 'end' 85 | end(const _Container& __cont) -> decltype(__cont.end()) |
s104653939
p00100
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; }
a.cc: In function 'int main()': a.cc:31:9: error: expected ',' or ';' before 'if' 31 | if(b == 0){ | ^~
s934001304
p00100
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 =
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 = | ^
s366857653
p00100
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; }
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) | ^~~~
s215874415
p00100
C++
4 1001 2000 520 1002 1800 450 1003 1600 625 1001 200 1220 2 1001 100 3 1005 1000 100
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 4 | ^
s815702599
p00100
C++
#include <iostream> #include <stdlib.h> using namespace std; typedef struct{ int sum; int pr; } data; int main(int argc, char **argv) { int i, p, q, n, size = 0, flag, pri = 1, max; data *sarray = (data *)calloc(4000, sizeof(int)); int *id = (int *)calloc(1000, sizeof(int)); while(1){ cin >> n; if(n == 0){ cout << "NA" << endl; break; } while(n > 0){ n--; cin >> i >> p >> q; flag = 0; for(int j = 0; j < size; j++){ if(id[j] == i){ if(p*q > sarray[i].sum || pri != sarray[i]->pr){ sarray[i]->sum = p*q; sarray[i]->pr = pri; } flag = 1; break; } } if(flag == 0){ id[size] = i; sarray[i]->sum = p*q; sarray[i]->pr = pri; size++; } } max = id[0]; for(int j = 1; j < size; j++){ if(sarray[max]->sum < sarray[id[j]]->sum){ max = id[j]; } } cout << max << endl; pri++; } free(sarray); return 0; }
a.cc: In function 'int main(int, char**)': a.cc:13:9: error: reference to 'data' is ambiguous 13 | data *sarray = (data *)calloc(4000, sizeof(int)); | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, 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:8:3: note: 'typedef struct data data' 8 | } data; | ^~~~ a.cc:13:15: error: 'sarray' was not declared in this scope 13 | data *sarray = (data *)calloc(4000, sizeof(int)); | ^~~~~~ a.cc:13:25: error: reference to 'data' is ambiguous 13 | data *sarray = (data *)calloc(4000, sizeof(int)); | ^~~~ /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:8:3: note: 'typedef struct data data' 8 | } data; | ^~~~ a.cc:13:31: error: expected primary-expression before ')' token 13 | data *sarray = (data *)calloc(4000, sizeof(int)); | ^
s713187641
p00100
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"); } } }
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
s157328805
p00100
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"); } } }
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
s998083557
p00100
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"); } } }
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
s743139209
p00100
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"); } } }
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
s553831786
p00100
C++
#include<iostream> #include<map> #include<algorithm> using namespace std; main(){ while(1){ int n,a,b,c; cin>>n; if(n==0) break; map<long,int> m; for(;n>0;n--){ cin>>a>>b>>c; m.insert((long)b*c,a); } m.sort(); cout<<(m.begin()).first<<endl; } } cout<<"NA"<<endl; }
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:13:9: error: no matching function for call to 'std::map<long int, int>::insert(long int, int&)' 13 | m.insert((long)b*c,a); | ~~~~~~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/map:63, from a.cc:2: /usr/include/c++/14/bits/stl_map.h:847:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> > std::map<_Key, _Tp, _Compare, _Alloc>::insert(_Pair&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 847 | insert(_Pair&& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:847:9: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:924:9: note: candidate: 'template<class _Pair> std::__enable_if_t<((bool)std::is_constructible<std::pair<const _Key, _Tp>, _Pair>::value), typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, _Pair&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 924 | insert(const_iterator __position, _Pair&& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:924:9: note: template argument deduction/substitution failed: a.cc:13:17: note: cannot convert '(((long int)b) * ((long int)c))' (type 'long int') to type 'std::map<long int, int>::const_iterator' {aka 'std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::const_iterator'} 13 | m.insert((long)b*c,a); | ~~~~~~~^~ /usr/include/c++/14/bits/stl_map.h:942:9: note: candidate: 'template<class _InputIterator> void std::map<_Key, _Tp, _Compare, _Alloc>::insert(_InputIterator, _InputIterator) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 942 | insert(_InputIterator __first, _InputIterator __last) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:942:9: note: template argument deduction/substitution failed: a.cc:13:9: note: deduced conflicting types for parameter '_InputIterator' ('long int' and 'int') 13 | m.insert((long)b*c,a); | ~~~~~~~~^~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_map.h:661:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::insert_return_type std::map<_Key, _Tp, _Compare, _Alloc>::insert(node_type&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; insert_return_type = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::insert_return_type; node_type = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::node_type]' 661 | insert(node_type&& __nh) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:661:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:666:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, node_type&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::iterator; const_iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::const_iterator; node_type = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::node_type]' 666 | insert(const_iterator __hint, node_type&& __nh) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:666:29: note: no known conversion for argument 1 from 'long int' to 'std::map<long int, int>::const_iterator' {aka 'std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::const_iterator'} 666 | insert(const_iterator __hint, node_type&& __nh) | ~~~~~~~~~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_map.h:834:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(const value_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const long int, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const long int, int> >, std::pair<const long int, int> >::rebind<std::pair<const long int, int> >; typename _Alloc::value_type = std::pair<const long int, int>; value_type = std::pair<const long int, int>]' 834 | insert(const value_type& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:834:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:841:7: note: candidate: 'std::pair<typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator, bool> std::map<_Key, _Tp, _Compare, _Alloc>::insert(value_type&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; typename std::_Rb_tree<_Key, std::pair<const _Key, _Tp>, std::_Select1st<std::pair<const _Key, _Tp> >, _Compare, typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other>::iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::iterator; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> >::other = std::allocator<std::pair<const long int, int> >; typename __gnu_cxx::__alloc_traits<_Alloc>::rebind<std::pair<const _Key, _Tp> > = __gnu_cxx::__alloc_traits<std::allocator<std::pair<const long int, int> >, std::pair<const long int, int> >::rebind<std::pair<const long int, int> >; typename _Alloc::value_type = std::pair<const long int, int>; value_type = std::pair<const long int, int>]' 841 | insert(value_type&& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:841:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:879:7: note: candidate: 'void std::map<_Key, _Tp, _Compare, _Alloc>::insert(std::initializer_list<std::pair<const _Key, _Tp> >) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 879 | insert(std::initializer_list<value_type> __list) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:879:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:909:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, const value_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::iterator; const_iterator = std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::const_iterator; value_type = std::pair<const long int, int>]' 909 | insert(const_iterator __position, const value_type& __x) | ^~~~~~ /usr/include/c++/14/bits/stl_map.h:909:29: note: no known conversion for argument 1 from 'long int' to 'std::map<long int, int>::const_iterator' {aka 'std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::const_iterator'} 909 | insert(const_iterator __position, const value_type& __x) | ~~~~~~~~~~~~~~~^~~~~~~~~~ /usr/include/c++/14/bits/stl_map.h:919:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::iterator std::map<_Key, _Tp, _Compare, _Alloc>::insert(const_iterator, va
s375119309
p00100
C++
#include<iostream> #include<map> #include<algorithm> using namespace std; main(){ while(1){ int n,a,b,c; cin>>n; if(n==0) break; map<long,int> m; for(;n>0;n--){ cin>>a>>b>>c; m.insert(map<long,int>((long)b*c,a)); } m.sort(); cout<<(m.begin()).first<<endl; } cout<<"NA"<<endl; }
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:13:38: error: no matching function for call to 'std::map<long int, int>::map(long int, int&)' 13 | m.insert(map<long,int>((long)b*c,a)); | ^ In file included from /usr/include/c++/14/map:63, from a.cc:2: /usr/include/c++/14/bits/stl_map.h:302:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const _Compare&, const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 302 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/14/bits/stl_map.h:302:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_map.h:285:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 285 | map(_InputIterator __first, _InputIterator __last) | ^~~ /usr/include/c++/14/bits/stl_map.h:285:9: note: template argument deduction/substitution failed: a.cc:13:38: note: deduced conflicting types for parameter '_InputIterator' ('long int' and 'int') 13 | m.insert(map<long,int>((long)b*c,a)); | ^ /usr/include/c++/14/bits/stl_map.h:268:9: note: candidate: 'template<class _InputIterator> std::map<_Key, _Tp, _Compare, _Alloc>::map(_InputIterator, _InputIterator, const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 268 | map(_InputIterator __first, _InputIterator __last, | ^~~ /usr/include/c++/14/bits/stl_map.h:268:9: note: candidate expects 3 arguments, 2 provided /usr/include/c++/14/bits/stl_map.h:262:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; allocator_type = std::allocator<std::pair<const long int, int> >]' 262 | map(initializer_list<value_type> __l, const allocator_type& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:262:40: note: no known conversion for argument 1 from 'long int' to 'std::initializer_list<std::pair<const long int, int> >' 262 | map(initializer_list<value_type> __l, const allocator_type& __a) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:256:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<const long int, int> >]' 256 | map(map&& __m, const __type_identity_t<allocator_type>& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:256:17: note: no known conversion for argument 1 from 'long int' to 'std::map<long int, int>&&' 256 | map(map&& __m, const __type_identity_t<allocator_type>& __a) | ~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:252:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; std::__type_identity_t<_Alloc> = std::allocator<std::pair<const long int, int> >]' 252 | map(const map& __m, const __type_identity_t<allocator_type>& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:252:22: note: no known conversion for argument 1 from 'long int' to 'const std::map<long int, int>&' 252 | map(const map& __m, const __type_identity_t<allocator_type>& __a) | ~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:248:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; allocator_type = std::allocator<std::pair<const long int, int> >]' 248 | map(const allocator_type& __a) | ^~~ /usr/include/c++/14/bits/stl_map.h:248:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:240:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::initializer_list<std::pair<const _Key, _Tp> >, const _Compare&, const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; allocator_type = std::allocator<std::pair<const long int, int> >]' 240 | map(initializer_list<value_type> __l, | ^~~ /usr/include/c++/14/bits/stl_map.h:240:40: note: no known conversion for argument 1 from 'long int' to 'std::initializer_list<std::pair<const long int, int> >' 240 | map(initializer_list<value_type> __l, | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/stl_map.h:227:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(std::map<_Key, _Tp, _Compare, _Alloc>&&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 227 | map(map&&) = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:227:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:219:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const std::map<_Key, _Tp, _Compare, _Alloc>&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 219 | map(const map&) = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:219:7: note: candidate expects 1 argument, 2 provided /usr/include/c++/14/bits/stl_map.h:206:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map(const _Compare&, const allocator_type&) [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >; allocator_type = std::allocator<std::pair<const long int, int> >]' 206 | map(const _Compare& __comp, | ^~~ /usr/include/c++/14/bits/stl_map.h:206:27: note: no known conversion for argument 1 from 'long int' to 'const std::less<long int>&' 206 | map(const _Compare& __comp, | ~~~~~~~~~~~~~~~~^~~~~~ /usr/include/c++/14/bits/stl_map.h:197:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::map() [with _Key = long int; _Tp = int; _Compare = std::less<long int>; _Alloc = std::allocator<std::pair<const long int, int> >]' 197 | map() = default; | ^~~ /usr/include/c++/14/bits/stl_map.h:197:7: note: candidate expects 0 arguments, 2 provided a.cc:15:5: error: 'class std::map<long int, int>' has no member named 'sort' 15 | m.sort(); | ^~~~ a.cc:16:21: error: 'std::map<long int, int>::iterator' {aka 'std::_Rb_tree<long int, std::pair<const long int, int>, std::_Select1st<std::pair<const long int, int> >, std::less<long int>, std::allocator<std::pair<const long int, int> > >::iterator'} has no member named 'first' 16 | cout<<(m.begin()).first<<endl; | ^~~~~
s578228454
p00100
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; }
a.cc:2:10: fatal error: algorithim: No such file or directory 2 | #include <algorithim> | ^~~~~~~~~~~~ compilation terminated.
s083293968
p00100
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; }
a.cc:2:10: fatal error: algorithim: No such file or directory 2 | #include <algorithim> | ^~~~~~~~~~~~ compilation terminated.
s295193639
p00100
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; } }
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){ | ~^~~~ | )
s157995253
p00100
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(); } } }
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(){ | ^
s450788574
p00100
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"); }
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); | ^
s140148383
p00100
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; }
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;
s603371332
p00100
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; } }
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; | ^
s751550063
p00100
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; } }
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; | ^
s632695349
p00100
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; } }
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); | ~~
s577052779
p00100
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; } }
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; | ~^~~~~~~~~~~~~~~~~~
s480807804
p00100
C++
#include<iostream> #include<queue> #include<map> using namespace std; main(){ long long a,b,c,n,f; while(cin>>n,n){ map<int,long long> m; queue<int> v; f=1; for(;n;n--){ cin>>a>>b>>c; if(!m[a])v.push(a); m[a] += b*c; } while(v.size()) if(m[v.front()]>999999)f=0,cout<<v.pop()<<endl; if(f)cout<<"NA"<<endl; } }
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:18:56: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'void') 18 | if(m[v.front()]>999999)f=0,cout<<v.pop()<<endl; | ~~~~^~~~~~~~~ | | | | | void | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from 'void' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from 'void' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from 'void' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from 'void' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from 'void' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from 'void' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from 'void' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from 'void' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from 'void' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from 'void' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from 'void' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from 'void' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'void' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from 'void' to 'std::nullptr_t' 306 | operator<<(nullptr_t) | ^~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:124:5: note: candidate: 'std::basic_ostream<_CharT, _Traits
s625706998
p00100
C++
#include <iostream> #include <map> #include <string> using namespace std; int main(void) { int n, num; string str; long a; while (cin >> n, n){ map <string, long long> m; for (int i = 0; i < n; i++){ cin >> str >> num >> a; m[str] += (num * a); } map <string, long> ::iterator it; bool flag = true; /* for (it = m.begin(); it != m.end(); it++){ cout << it->first << " -- " << it->second << endl; }*/ for (it = m.begin(); it != m.end(); it++){ if (1000000 <= it->second){ cout << it->first << endl; flag = false; } } if (flag) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:35: error: no match for 'operator=' (operand types are 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} and 'std::map<std::__cxx11::basic_string<char>, long long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::iterator'}) 25 | for (it = m.begin(); it != m.end(); it++){ | ^ In file included from /usr/include/c++/14/map:62, from a.cc:2: /usr/include/c++/14/bits/stl_tree.h:252:12: note: candidate: 'constexpr std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >& std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >::operator=(const std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >&)' 252 | struct _Rb_tree_iterator | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_tree.h:252:12: note: no known conversion for argument 1 from 'std::map<std::__cxx11::basic_string<char>, long long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::iterator'} to 'const std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >&' /usr/include/c++/14/bits/stl_tree.h:252:12: note: candidate: 'constexpr std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >& std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >::operator=(std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >&&)' /usr/include/c++/14/bits/stl_tree.h:252:12: note: no known conversion for argument 1 from 'std::map<std::__cxx11::basic_string<char>, long long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::iterator'} to 'std::_Rb_tree_iterator<std::pair<const std::__cxx11::basic_string<char>, long int> >&&' a.cc:25:41: error: no match for 'operator!=' (operand types are 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} and 'std::map<std::__cxx11::basic_string<char>, long long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long long int> > >::iterator'}) 25 | for (it = m.begin(); it != m.end(); it++){ | ~~ ^~ ~~~~~~~ | | | | | _Rb_tree_iterator<pair<[...],long long int>> | _Rb_tree_iterator<pair<[...],long int>> In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} is not derived from 'const std::fpos<_StateT>' 25 | for (it = m.begin(); it != m.end(); it++){ | ^ In file included from /usr/include/c++/14/string:43, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} is not derived from 'const std::allocator<_CharT>' 25 | for (it = m.begin(); it != m.end(); it++){ | ^ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} is not derived from 'const std::reverse_iterator<_Iterator>' 25 | for (it = m.begin(); it != m.end(); it++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} is not derived from 'const std::reverse_iterator<_Iterator>' 25 | for (it = m.begin(); it != m.end(); it++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, long int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, long int> >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, long int> > >::iterator'} is not derived from 'const std::move_iterator<_IteratorL>' 25 | for (it = m.begin(); it != m.end(); it++){ | ^ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:25:50: note: 'std::map<std::__cxx11::basic_string<char>, long int>::iterator' {aka 'std::_Rb_tree<std::__cxx11::basic_string
s037176156
p00100
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; }
a.cc: In function 'int main()': a.cc:26:25: error: expected primary-expression before ')' token 26 | while(cin >> n && n)) { | ^
s296027241
p00100
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; }
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){ | ^
s016265490
p00100
C++
#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++) { cin >> array[i].id >> p >> q; array[i].c = p * q; } for(int i = 0; i < n - 1; 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; }
a.cc: In function 'int main()': a.cc:25:11: error: 'cin' was not declared in this scope 25 | while(cin >> n && n) { | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include <stdio.h> +++ |+#include <iostream> 5 | a.cc:27:20: error: reference to 'array' is ambiguous 27 | cin >> array[i].id >> p >> q; | ^~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/vector:62, from a.cc:1: /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:28:13: error: reference to 'array' is ambiguous 28 | array[i].c = p * q; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:32:20: error: reference to 'array' is ambiguous 32 | if(array[i].id == array[j].id && array[j].id) { | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:32:35: error: reference to 'array' is ambiguous 32 | if(array[i].id == array[j].id && array[j].id) { | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:32:50: error: reference to 'array' is ambiguous 32 | if(array[i].id == array[j].id && array[j].id) { | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:33:21: error: reference to 'array' is ambiguous 33 | array[i].c += array[j].c; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:33:35: error: reference to 'array' is ambiguous 33 | array[i].c += array[j].c; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:34:21: error: reference to 'array' is ambiguous 34 | array[j].id = 0; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:40:16: error: reference to 'array' is ambiguous 40 | if(array[i].id && array[i].c >= MAX) { | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:40:31: error: reference to 'array' is ambiguous 40 | if(array[i].id && array[i].c >= MAX) { | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:41:17: error: 'cout' was not declared in this scope 41 | cout << array[i].id << endl; | ^~~~ a.cc:41:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:41:25: error: reference to 'array' is ambiguous 41 | cout << array[i].id << endl; | ^~~~~ /usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:22:5: note: 'Mem array [40010]' 22 | Mem array[40010]; | ^~~~~ a.cc:41:40: error: 'endl' was not declared in this scope 41 | cout << array[i].id << endl; | ^~~~ a.cc:5:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 4 | #include <stdio.h> +++ |+#include <ostream> 5 | a.cc:46:13: error: 'cout' was not declared in this scope 46 | cout << "NA" << endl; | ^~~~ a.cc:46:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:46:29: error: 'endl' was not declared in this scope 46 | cout << "NA" << endl; | ^~~~ a.cc:46:29: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
s276543092
p00100
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; }
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>'
s148716349
p00100
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; }
a.cc:28:5: error: expected unqualified-id before 'return' 28 | return 0; | ^~~~~~ a.cc:29:1: error: expected declaration before '}' token 29 | } | ^
s511893334
p00100
C++
g#include <iostream> #include <vector> #include <utility> #include <map> using namespace std; int main() { int n; while (cin >> n) { if (n == 0) break; vector< pair<int, long long> > members; for (int i = 0; i < n; i++) { pair<int, long long> member; int id; long long cost, count; cin >> id >> cost >> count; bool exist = false; for (int i = 0; i < members.size(); i++) { if (members[i].first == id) { members[i].second += cost * count; exist = true; } } if (!exist) { member.first = id; member.second = cost * count; members.push_back(member); } } bool exist = false; for (vector< pair<int, long long> >::iterator m_i = members.begin(); m_i != members.end(); m_i++) { if (m_i->second >= 1000000) { cout << m_i->first << endl; exist = true; } } if (!exist) { cout << "NA" << endl; } } return 0; }
a.cc:1:2: error: stray '#' in program 1 | g#include <iostream> | ^ a.cc:1:1: error: 'g' does not name a type 1 | g#include <iostream> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64: /usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared 295 | template <typename _Tp, size_t = sizeof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std' 666 | struct is_null_pointer<std::nullptr_t> | ^~~~~~~~~ /usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid 666 | struct is_null_pointer<std::nullptr_t> | ^ /usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid 670 | struct is_null_pointer<const std::nullptr_t> | ^ /usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid 674 | struct is_null_pointer<volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid 678 | struct is_null_pointer<const volatile std::nullptr_t> | ^ /usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared 984 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid 985 | struct __is_array_known_bounds<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std' 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^~~~~~ /usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid 1429 | : public integral_constant<std::size_t, alignof(_Tp)> | ^ /usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std' 1438 | : public integral_constant<std::size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid 1438 | : public integral_constant<std::size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared 1440 | template<typename _Tp, std::size_t _Size> | ^~~ /usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope 1441 | struct rank<_Tp[_Size]> | ^~~~~ /usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid 1441 | struct rank<_Tp[_Size]> | ^ /usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std' 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid 1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std' 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid 1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; | ^ /usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope 1451 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' 63 | #include <bits/version.h> +++ |+#include <cstddef> 64 | /usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid 1451 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared 1453 | template<typename _Tp, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope 1454 | struct extent<_Tp[_Size], 0> | ^~~~~ /usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid 1454 | struct extent<_Tp[_Size], 0> | ^ /usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope 1455 | : public integral_constant<size_t, _Size> { }; | ^~~~~ /usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid 1455 | : public integral_constant<size_t, _Size> { }; | ^ /usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid /usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared 1457 | template<typename _Tp, unsigned _Uint, size_t _Size> | ^~~~~~ /usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope 1458 | struct extent<_Tp[_Size], _Uint> | ^~~~~ /usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid 1458 | struct extent<_Tp[_Size], _Uint> | ^ /usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope 1463 | : public integral_constant<size_t, 0> { }; | ^~~~~~ /usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid 1463 | : public integral_constant<size_t, 0> { }; | ^ /usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter /usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type 1857 | { static constexpr size_t __size = sizeof(_Tp); }; | ^~~~~~ /usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~~~~ /usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope 1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> | ^~~ /usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp' 1860 | struct __select; | ^~~~~~~~ /usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared 1862 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^~~ /usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid 1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true> | ^ /usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared 1866 | template<size_t _Sz, typename _Uint, typename... _UInts> | ^~~~~~ /usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope 1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false> | ^~~ /usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid 1867 |
s589872210
p00100
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; } }
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
s549229378
p00100
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; }
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"; | ~~^~~~ | ()
s178745651
p00100
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; }
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;
s339601985
p00100
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; }
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;
s470579622
p00100
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; }
a.cc: In function 'int main()': a.cc:18:35: error: expected primary-expression before 'long' 18 | price=num=long long int (0); | ^~~~
s558374963
p00100
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; }
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
s065554277
p00100
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; }
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 |
s703274081
p00100
C++
#include <iostream> using namespace std; int main(void) { int n; while(cin >> n,n){ int d[4000]; bool f = false; fill(d,d+4000,0); int no,m,k; for(int i = 0; i < n; i++){ cin >> no >> m >> k; d[no-1] += m*k; } for(int i = 0; i < 4000;i++) if(d[i] >= 1000000){ cout << i+1 << end; f = 1; } if(!f) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:22:45: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 22 | cout << i+1 << end; | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'} 116 | operator<<(__ostream_type& (*__pf)(__ostream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]' 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 125 | operator<<(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ^~~~~~~~ /usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 135 | operator<<(ios_base& (*__pf) (ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 174 | operator<<(long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int' 174 | operator<<(long __n) | ~~~~~^~~ /usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 178 | operator<<(unsigned long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int' 178 | operator<<(unsigned long __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 182 | operator<<(bool __n) | ^~~~~~~~ /usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool' 182 | operator<<(bool __n) | ~~~~~^~~ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]' 96 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int' 97 | operator<<(short __n) | ~~~~~~^~~ /usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 189 | operator<<(unsigned short __n) | ^~~~~~~~ /usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int' 189 | operator<<(unsigned short __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]' 110 | basic_ostream<_CharT, _Traits>:: | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int' 111 | operator<<(int __n) | ~~~~^~~ /usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 200 | operator<<(unsigned int __n) | ^~~~~~~~ /usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int' 200 | operator<<(unsigned int __n) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 211 | operator<<(long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int' 211 | operator<<(long long __n) | ~~~~~~~~~~^~~ /usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 215 | operator<<(unsigned long long __n) | ^~~~~~~~ /usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int' 215 | operator<<(unsigned long long __n) | ~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 231 | operator<<(double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double' 231 | operator<<(double __f) | ~~~~~~~^~~ /usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 235 | operator<<(float __f) | ^~~~~~~~ /usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float' 235 | operator<<(float __f) | ~~~~~~^~~ /usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 243 | operator<<(long double __f) | ^~~~~~~~ /usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double' 243 | operator<<(long double __f) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]' 301 | operator<<(const void* __p) | ^~~~~~~~ /usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*' 301 | operator<<(const void* __p) | ~~~~~~~~~~~~^~~ /usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]' 306 | operator<<(nullptr_t) | ^~~~~~~~ /usr/include/c++/14/ostream:306:18: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::null
s281801202
p00100
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; }
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 ) ); | ^
s099419775
p00100
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; }
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); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s066491532
p00100
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<string> using namespace std; int main(){ while(1){ int n; cin >> n; if(n == 0) break; long long a[5000] = {0}; long long int number; long long int jun[5000] = {0}; long long tanka,kazu; for(int i = 1; i <= n; i++){ cin >> number >> tanka >> kazu; a[number] += tanka * kazu; jun[i] = number; } for(int i = 0; i < 4000; i++){ for(int j = i+1; j <= 4000; j++){ if(jun[i] == jun[j]) jun[j] = 0; } } bool flg = 0; for(int i = 1; i 4000; i++){ if(a[jun[i]] >= 1000000){ cout << jun[i] << endl; flg = 1; } } if(!flg) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:28:25: error: expected ';' before numeric constant 28 | for(int i = 1; i 4000; i++){ | ^~~~~ | ; a.cc:28:30: error: expected ')' before ';' token 28 | for(int i = 1; i 4000; i++){ | ~ ^ | ) a.cc:28:32: error: 'i' was not declared in this scope 28 | for(int i = 1; i 4000; i++){ | ^
s991469453
p00100
C++
#include<stdio.h> int main(void) { struct employee { int N,P,A; }; employee person[10][4000]; int a,b=0,c[10],d,e; for(d=0;;b=0,d++) { scanf("%d",&c[d]); if(c[d]==0) { e=d; break; } for(a=0;a<c[d];a++) scanf("%d %d %d",&person[d][a].N,&person[d][a].P,&person[d][a].A);/ } for(d=0;d<=e;b=0,d++) { for(a=0;a<c[d];a++) if(person[d][a].P*person[d][a].A>=1000000 ) { printf("%d\n",person[d][a].N); b++; } if(b==0) printf("NA\n"); } }
a.cc: In function 'int main()': a.cc:19:91: error: expected primary-expression before '/' token 19 | scanf("%d %d %d",&person[d][a].N,&person[d][a].P,&person[d][a].A);/ | ^ a.cc:20:9: error: expected primary-expression before '}' token 20 | } | ^
s197616184
p00100
C++
int main(void) { employee person[4000]; int a,b,c,d; for(b=0;;b=0) { scanf("%d",&c); for(a=0;a<c;a++) { scanf("%d %lld %lld",&person[a].N,&person[a].P,&person[a].A); person[a].M=person[a].P*person[a].A; for(d=0;d<a;d++) if(person[a].N==person[d].N) { person[a].M+=person[d].M; person[d].M=0; } } for(a=0;a<c;a++) if(person[a].M>=1000000 ) { printf("%d\n",person[a].N); b++; } if(b==0) printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:3:9: error: 'employee' was not declared in this scope 3 | employee person[4000]; | ^~~~~~~~ a.cc:7:17: error: 'scanf' was not declared in this scope 7 | scanf("%d",&c); | ^~~~~ a.cc:10:47: error: 'person' was not declared in this scope 10 | scanf("%d %lld %lld",&person[a].N,&person[a].P,&person[a].A); | ^~~~~~ a.cc:20:28: error: 'person' was not declared in this scope 20 | if(person[a].M>=1000000 ) | ^~~~~~ a.cc:22:33: error: 'printf' was not declared in this scope 22 | printf("%d\n",person[a].N); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int main(void) a.cc:26:25: error: 'printf' was not declared in this scope 26 | printf("NA\n"); | ^~~~~~ a.cc:26:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s009237453
p00100
C++
struct employee { int N; long long int P,A,M; }; int main(void) { struct employee person[4000]; int a,b,c,d; for(b=0;;b=0) { scanf("%d",&c); for(a=0;a<c;a++) { scanf("%d %lld %lld",&person[a].N,&person[a].P,&person[a].A); person[a].M=person[a].P*person[a].A; for(d=0;d<a;d++) if(person[a].N==person[d].N) { person[a].M+=person[d].M; person[d].M=0; } } for(a=0;a<c;a++) if(person[a].M>=1000000 ) { printf("%d\n",person[a].N); b++; } if(b==0) printf("NA\n"); } return 0; }
a.cc: In function 'int main()': a.cc:12:17: error: 'scanf' was not declared in this scope 12 | scanf("%d",&c); | ^~~~~ a.cc:27:33: error: 'printf' was not declared in this scope 27 | printf("%d\n",person[a].N); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | struct employee a.cc:31:25: error: 'printf' was not declared in this scope 31 | printf("NA\n"); | ^~~~~~ a.cc:31:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
s829692428
p00100
C++
#include<iostream> #include<vector> #include<cstring> using namespace std; #define rep(i,n) for(int i=0;i<n;i++) int main(){ int n; while( cin >> n, n ){ long long emp[4001]; vector<int> nums; bool exist = false; memset( emp, 0, sizeof(emp) ); rep(i,n){ int num; long long val, am; cin >> num >> val >> am; emp[num] += val*am; if( find(nums.begin(), nums.end(), num) == nums.end() ){ nums.push_back(num); } } rep(i,nums.size()){ if( emp[nums[i]] >= 1000000 ){ exist = true; cout << nums[i] << endl; } } if(!exist){ cout << "NA" << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:20:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 20 | if( find(nums.begin(), nums.end(), num) == nums.end() ){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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:20:33: note: '__gnu_cxx::__normal_iterator<int*, std::vector<int> >' is not derived from 'std::istreambuf_iterator<_CharT>' 20 | if( find(nums.begin(), nums.end(), num) == nums.end() ){ | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
s553789822
p00100
C++
#define _CRT_SECURE_NO_WARNINGS # include<iostream> # include<string> #include<conio.h> using namespace std; int main(){ int datasuu = 0; int flag[4000][4000]; int sbangou[4000][4000]; int hanbai[4000][4000]; int uriage[4000][4000]; int goukei[4000][4000]; int kaisuu = 0; for (int j = 0;; j++){ cin >> datasuu; if (datasuu == 0){ kaisuu = j; break; } for (int i = 0; i < datasuu; i++){ scanf("%d,%d,%d", &sbangou[j][i], &hanbai[j][i], &uriage[j][i]); for (int z = 0; z < i; z++){ if (hanbai[j][i] == hanbai[j][z]){ goukei[j][i] += goukei[j][z]; } } goukei[j][i] += hanbai[j][i] * uriage[j][i]; if (goukei[j][i] >= 1000000){ flag[j][i] = 1; goukei[j][i] = hanbai[j][i] * uriage[j][i]; } } } int on = 0; for (int i = 0; i < 4000; i++){ for (int j = 0; j < 4000; i++){ if (flag[i][j] == 1){ cout << sbangou[i][j] << endl; on = 1; } if (on == 0)cout << "NA"; } } }
a.cc:4:9: fatal error: conio.h: No such file or directory 4 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s872851567
p00100
C++
# include<iostream> # include<string> #include<conio.h> using namespace std; int main(){ int datasuu = 0; int flag[4000][4000]; int sbangou[4000][4000]; int hanbai[4000][4000]; int uriage[4000][4000]; int goukei[4000][4000]; int kaisuu = 0; for (int j = 0;; j++){ cin >> datasuu; if (datasuu == 0){ kaisuu = j; break; } for (int i = 0; i < datasuu; i++){ scanf("%d%d%d", &sbangou[j][i], &hanbai[j][i], &uriage[j][i]); for (int z = 0; z < i; z++){ if (hanbai[j][i] == hanbai[j][z]){ goukei[j][i] += goukei[j][z]; } } goukei[j][i] += hanbai[j][i] * uriage[j][i]; if (goukei[j][i] >= 1000000){ flag[j][i] = 1; goukei[j][i] = hanbai[j][i] * uriage[j][i]; } } } int on = 0; for (int i = 0; i < 4000; i++){ for (int j = 0; j < 4000; i++){ if (flag[i][j] == 1){ cout << sbangou[i][j] << endl; on = 1; } if (on == 0)cout << "NA"; } } return 0; }
a.cc:3:9: fatal error: conio.h: No such file or directory 3 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s505131418
p00100
C++
#include <iostream> #include <stdio.h> #include <string> #include <queue> #include <cmath> #define int64 long long int using namespace std; typedef pair<int, int> P; int main() { int flag[4001]; int n, c, num, val, sale, na; P hoge[4001]; while (1) { cin >> n; if(n == 0) break; c = 1; na = 1; memset(flag, 0, sizeof(int)*4001); for(int i=0; i<n; i++){ cin >> num >> val >> sale; if(flag[num] == 0){ flag[num] = c; hoge[c].first = num; hoge[c].second = val * sale; c++; } else { hoge[flag[num]].second += val * sale; } } for(int i=1; i<c; i++){ if(hoge[i].second >= 1000000){ na = 0; cout << hoge[i].first << endl; } } if(na == 1) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:24:9: error: 'memset' was not declared in this scope 24 | memset(flag, 0, sizeof(int)*4001); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <cmath> +++ |+#include <cstring> 6 |
s058180703
p00100
C++
#include<iostream> int main(){ int n,num[4001]; while(std::cin>>n){ int count=0; memset(num,0,sizeof(num)); if(n==0)break; for(int a,b,c,i=0;i<n;i++){ std::cin>>a>>b>>c; num[a]+=b*c; } for(int i=0;i<4001;i++){ if(num[i]>=1000000)count++,std::cout<<i<<std::endl; } if(count==0)std::cout<<"NA"<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:17: error: 'memset' was not declared in this scope 7 | memset(num,0,sizeof(num)); | ^~~~~~ 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 |
s379757470
p00100
C++
class CMem { public : CMem() { m_check = false; m_sale = 0; } void Idata(long long sale) { m_sale += sale; m_check = true; } bool Ocheck() { return m_check; } long long Osale() { return m_sale; } private : bool m_check; long long m_sale; }; int main(void) { while(1) { CMem member[4001]; bool NA = true; int n, id, asale, scale; long long sale; cin >> n; if(n == 0) break; for(int i = 0; i < n; i++) { cin >> id >> asale >> scale; sale = asale * scale; member[id].Idata(sale); } for(int i = 1; i <= 4000; i++) { if(member[i].Ocheck() == true && member[i].Osale() >= 1000000) { cout << i << endl; NA = false; } } if(NA == true) cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:17: error: 'cin' was not declared in this scope 20 | cin >> n; | ^~~ a.cc:32:33: error: 'cout' was not declared in this scope 32 | cout << i << endl; | ^~~~ a.cc:32:46: error: 'endl' was not declared in this scope 32 | cout << i << endl; | ^~~~ a.cc:37:32: error: 'cout' was not declared in this scope 37 | if(NA == true) cout << "NA" << endl; | ^~~~ a.cc:37:48: error: 'endl' was not declared in this scope 37 | if(NA == true) cout << "NA" << endl; | ^~~~
s603681249
p00100
C++
#include<iostream> #include<vector> long long owData[4001]; std::vector<int> used; int main(){ long long x,input[3]; bool Person; while( std::cin>>x , x ){ Person=false; used.clear(); memset(owData,0,sizeof(owData)); while( x-- ){ std::cin>>input[0]>>input[1]>>input[2]; if( owData[input[0]] == 0 )used.push_back(input[0]); owData[input[0]]+=input[1]*input[2]; } for(auto it = used.begin(); it != used.end(); ++it ){ if( owData[*it] >= 1000000 ) std::cout<< *it <<std::endl, Person=true ; } if(!Person)std::cout<<"NA"<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(owData,0,sizeof(owData)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <cstring> 3 |
s698513149
p00100
C++
#include<iostream> #include<vector> long long owData[4001]; std::vector<int> used; int main(){ long long x,input[3]; bool Person; while( std::cin>>x , x ){ Person=false; used.clear(); memset(owData,0,sizeof(owData)); while( x-- ){ std::cin>>input[0]>>input[1]>>input[2]; if( owData[input[0]] == 0 )used.push_back(input[0]); owData[input[0]]+=input[1]*input[2]; } for(auto it = used.begin(); it != used.end(); ++it ){ if( owData[*it] >= 1000000 ) std::cout<< *it <<std::endl, Person=true ; } if(!Person)std::cout<<"NA"<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:17: error: 'memset' was not declared in this scope 13 | memset(owData,0,sizeof(owData)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <cstring> 3 |