submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s491840221
p00292
C++
#include<iostream> using namespace std; int main(){ int N,K,P,A; for(int i=0;i<N;i++){ cin>>K>>P; A=K/P; if(A==0){ A=P; cout<<A<<endl; }else{ cout<<A<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:2: error: expected '}' at end of input 16 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s347147743
p00292
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; int k,p; cin >> k >> p >. endl; while((k-p)>0){ k=k-p; } cout << k << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:18: error: expected primary-expression before '.' token 8 | cin >> k >> p >. endl; | ^
s668791796
p00292
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; for(int i=0;i<n;i++){ int k,p; cin >> k >> p >. endl; while((k-p)>0){ k=k-p; } cout << k << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:20: error: expected primary-expression before '.' token 10 | cin >> k >> p >. endl; | ^
s140694196
p00292
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; for(int i=0;i<n;i++){ int k,p; cin >> k >> p >> endl; while((k-p)>0){ k=k-p; } cout << k << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 10 | cin >> k >> p >> endl; | ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); |
s454942705
p00292
C++
#include <iostream> using namespace std; int main(){ int n; cin >> n; int k,p; for(int i=0;i<n;i++){ cin >> k >> p >> endl; while((k-p)>0){ k=k-p; } cout << k << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:19: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 10 | cin >> k >> p >> endl; | ~~~~~~~~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool&' 170 | operator>>(bool& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int&' 174 | operator>>(short& __n); | ~~~~~~~^~~ /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:34: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int&' 177 | operator>>(unsigned short& __n) | ~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int&' 181 | operator>>(int& __n); | ~~~~~^~~ /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int&' 184 | operator>>(unsigned int& __n) | ~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int&' 188 | operator>>(long& __n) | ~~~~~~^~~ /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int&' 192 | operator>>(unsigned long& __n) | ~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:29: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int&' 199 | operator>>(long long& __n) | ~~~~~~~~~~~^~~ /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:38: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int&' 203 | operator>>(unsigned long long& __n) | ~~~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'void*&' 328 | operator>>(void*& __p) | ~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ^~~~~~~~ /usr/include/c++/14/istream:133:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)' 133 | operator>>(ios_base& (*__pf)(ios_base&)) | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:352:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; __streambuf_type = std::basic_streambuf<char>]' 352 | operator>>(__streambuf_type* __sb); | ^~~~~~~~ /usr/include/c++/14/istream:352:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_istream<char>::__streambuf_type*' {aka 'std::basic_streambuf<char>*'} 352 | operator>>(__streambuf_type* __sb); |
s565740721
p00292
C++
#include < cstdio > int main() { int n, k, p; scanf ("%d", &n); for ( int i =0; i <n; ++ i ) { scanf ("%d %d", &k, &p ); int j = 1; while ( -- k) { //simulation ++j; if (j == p+1) j = 1; } printf ("%d \ n", j ); } return 0; }
a.cc:1:11: error: missing terminating > character 1 | #include < | ^ a.cc:1:10: error: empty filename in #include 1 | #include < | ^ a.cc:31:2: warning: missing terminating " character 31 | ("%d | ^ a.cc:31:2: error: missing terminating " character 31 | ("%d | ^~~ a.cc:33:2: warning: missing terminating " character 33 | n", j | ^ a.cc:33:2: error: missing terminating " character 33 | n", j | ^~~~ a.cc:2:1: error: 'cstdio' does not name a type 2 | cstdio | ^~~~~~
s638991195
p00292
C++
#include <iostream> using namespace std; int main(){ int N; cin>>N; for(int n=0;n<N;n++){ int K,P; cin>>K>>P; if(K>P){ if(K%P==0){ cout<<P<<endl; } else { cout<<K%P<<endl; } } if(K<P){ cout<<K<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:10: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s740497527
p00292
C++
#include <iostream> using namespace std; int main(){ int N,K,P; cin>>N; for(int n=0;n<N;n++){ cin>>K>>P; if(K>P){ if(K%P==0){ cout<<P<<endl; } else { cout<<K%P<<endl; } } if(K<P){ cout<<K<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:21:10: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s122259003
p00292
C++
#include <iostream> #include <instream> using namespace std; int main(){ int a,N; cin>>N; int*K=new int[N]; int*P=new int[N]; int*X=new int[N]; for(a=0;a<N;a++){ cin>>K>>P; X[a]=K[a]%P[a]; if(X[a]==0){ X[a]=P[a]; } } for(a=0;a<N;a++){ cin>>X[a]>>endl; } return 0; }
a.cc:2:10: fatal error: instream: No such file or directory 2 | #include <instream> | ^~~~~~~~~~ compilation terminated.
s297589956
p00292
C++
#include <iostream> using namespace std; int main(){ int a,N; cin>>N; int*K=new int[N]; int*P=new int[N]; int*X=new int[N]; for(a=0;a<N;a++){ cin>>K>>P; X[a]=K[a]%P[a]; if(X[a]==0){ X[a]=P[a]; } } for(a=0;a<N;a++){ cin>>X[a]>>endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:20: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int*') 11 | cin>>K>>P; | ~~~^~~ | | | | | int* | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 11 | cin>>K>>P; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(short int)K' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(short unsigned int)K' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(int)K' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(unsigned int)K' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(long int)K' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(long unsigned int)K' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(long long int)K' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 11 | cin>>K>>P; | ^ | | | int* a.cc:11:22: error: cannot bind rvalue '(long long unsigned int)K' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:11:22: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 11 | cin>>K>>P; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int*' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int*' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int*' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int*' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int*' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
s452897876
p00292
C++
#include<stdio.h> int main(void) { int P, K, i, N,a[100]; scanf_s("%d", &N); for (i = 0; i < N; i++) { scanf_s("%d%d", &K, &P); if (K < P) { a[i] = P; } else { if (K%P == 0) { a[i]=P; } else { a[i]=K%P; } } } for (i = 0; i < N; i++) { printf("%d\n", a[i]); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s051085101
p00292
C++
#include<stdio.h> int main(void) { int P, K, i, N,a[100]; scanf_s("%d", &N); for (i = 0; i < N; i++) { scanf_s("%d%d", &K, &P); if (K < P) { a[i] = P; } else { if (K%P == 0) { a[i]=P; } else { a[i]=K%P; } } } for (i = 0; i < N; i++) { printf("%d\n", a[i]); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s966210900
p00292
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int N,K,P; cin>>N; for(int i=0;i<N;i++){ cin>>K>>P; int j = 1; while (--k) { ++j; if (j == p+1) j = 1; } cout<<j<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:22:18: error: 'k' was not declared in this scope 22 | while (--k) { | ^ a.cc:24:18: error: 'p' was not declared in this scope 24 | if (j == p+1) j = 1; | ^
s836671452
p00292
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <cstdio> #include <cmath> #include <string> #include <cctype> using namespace std; int main() { int N,K,P; cin>>N; for(int i=0;i<N;i++){ cin>>K>>P; int j = 1; while (--k) { ++j; if (j == p+1) j = 1; } cout<<j<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:22:18: error: 'k' was not declared in this scope 22 | while (--k) { | ^ a.cc:24:26: error: 'p' was not declared in this scope 24 | if (j == p+1) j = 1; | ^
s771180510
p00292
C++
#include <stdio.h> int main() { int n, k, p, j; sf("%d", &n); for (int i=0; i<n; ++i) { scanf("%d %d", &k, &p); j = k%p; printf("%d?\n", j == 0 ? p : j); } return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: 'sf' was not declared in this scope 4 | sf("%d", &n); | ^~
s312459417
p00292
C++
#include <bits/stdc++.h> #include<algorithm> using namespace std; int main(){ int N; cin >>N; int k[N],p[N]; cin k[N],p[N]; for(int i =0;i<N;++i){ cout << k[i]%p[i] <<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:8: error: expected ';' before 'k' 9 | cin k[N],p[N]; | ^~ | ;
s920215298
p00292
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; int k1[n],k2[n]; for(int i=0;i<n;i++){ cin>>k1[i]>>k2[i]; int ans=k1[i]%k2[i]; if(ans==0){ cout<<k2[i]<<endl; } else{ cout<<ans<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s148160006
p00292
C++
// nokorimono_h27i20.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" using namespace std; int winner(int A, int B) { while (1) { if (A > B) { A = A - B; } else { return A; } } } int main() { int N = 0;//??\????????° int K[1000];//???????????° int P[1000];//????????° cin >> N; for (int i = 0; i < N; i++) { cin >> K[i] >> P[i]; } for (int i = 0; i < N; i++) { cout << winner(K[i], P[i])<<endl; } return 0; }
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s666167507
p00292
C++
// nokorimono_h27i20.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // using namespace std; int winner(int A, int B) { while (1) { if (A > B) { A = A - B; } else { return A; } } } int main() { int N = 0;//??\????????° int K[1000];//???????????° int P[1000];//????????° cin >> N; for (int i = 0; i < N; i++) { cin >> K[i] >> P[i]; } for (int i = 0; i < N; i++) { cout << winner(K[i], P[i])<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:20:9: error: 'cin' was not declared in this scope 20 | 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 | // nokorimono_h27i20.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? a.cc:25:17: error: 'cout' was not declared in this scope 25 | cout << winner(K[i], P[i])<<endl; | ^~~~ a.cc:25:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:25:45: error: 'endl' was not declared in this scope 25 | cout << winner(K[i], P[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 | // nokorimono_h27i20.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
s823173880
p00292
C++
#include<iostream> using namespace std; int main(){ int n = 0; cin >> n; for(int i = 0; i < n; i++){ int k, p; cin >> k >> p; if(k % p == 0){ cout << p; }else{ cout << k % p; } cout << endl; } retrun 0; }
a.cc: In function 'int main()': a.cc:17:9: error: 'retrun' was not declared in this scope 17 | retrun 0; | ^~~~~~
s687485746
p00292
C++
#include <iostream> using namespace std; int main() { int n; cin>>N; int i,j; for(int i=0; i<N; i++){ cin>>i>>j; if(i>j) cout<<i<<endl; else cout<<j<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:14: error: 'N' was not declared in this scope 7 | cin>>N; | ^
s622116641
p00292
C++
#include <iostream> using namespace std; int main() { int n; cin>>n; int i,j; for(int i=0; i<N; i++){ cin>>i>>j; if(i>j) cout<<i<<endl; else cout<<j<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:24: error: 'N' was not declared in this scope 9 | for(int i=0; i<N; i++){ | ^
s401000678
p00292
C++
#include "stdafx.h" #include <iostream> using namespace std; int main() { int N = 0; int K[10000], P[10000]; cin >> N; for (int i = 0;i<N;i++) { cin >> K[i]; P[i ]; } for (int i = 0;i<N;i++) { int ans = K[i]%P[i]; if (ans == 0) { cout >> P[i]>> endl; } else { cout >> ans>> endl; } } return 0; }
a.cc:2:10: fatal error: stdafx.h: No such file or directory 2 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s856971626
p00292
C++
#include <iostream> using namespace std; int main() { int N = 0; int K[10000], P[10000]; cin >> N; for (int i = 0;i<N;i++) { cin >> K[i]; P[i ]; } for (int i = 0;i<N;i++) { int ans = K[i]%P[i]; if (ans == 0) { cout >> P[i]>> endl; } else { cout >> ans>> endl; } } return 0; }
a.cc: In function 'int main()': a.cc:18:30: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 18 | cout >> P[i]>> endl; | ~~~~ ^~ ~~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:18:30: note: candidate: 'operator>>(int, int)' (built-in) 18 | cout >> P[i]>> endl; | ~~~~~^~~~~~~ a.cc:18:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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:2: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 18 | cout >> P[i]>> endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:18:25: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 18 | cout >> P[i]>> endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:18:36: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:18:15: required from here 18 | cout >> P[i]>> endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:21:30: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 21 | cout >> ans>> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:21:30: note: candidate: 'operator>>(int, int)' (built-in) 21 | cout >> ans>> endl; | ~~~~~^~~~~~ a.cc:21:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:21:33: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 21 | cout >> ans>> endl; | ^~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:21:25: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 21 | cout >> ans>> endl; | ^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:21:33: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 21 | cout >> ans>> endl; | ^~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:21:33: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 21 | cout >> ans>> endl; | ^~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/
s576646808
p00292
C++
#include<iostream> using namespace std; int main(){ int N; cin<<N; int K=0; int P=0;] int a[100]; for(int i=0;i<N;i++){ cin>>K>>P; if(K%P==0) a[i]=P; else a[i]=K%P; } for(int i=0;i<N;i++){ cout<<a[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 6 | cin<<N; | ~~~^~~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:6:12: note: candidate: 'operator<<(int, int)' (built-in) 6 | cin<<N; | ~~~^~~ a.cc:6:12: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, 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/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:6:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 6 | cin<<N; | ^~~ In file included from /usr/include/c++/14/bits/ios_base.h:46: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)' 684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)' 689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed: a.cc:6:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 6 | cin<<N; | ^ /usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ /usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed: /usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]': a.cc:6:7: required from here 6 | cin<<N; | ^ /usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 810 | operator<<(_Ostream&& __os, const _Tp& __x) | ^~~~~~~~ a.cc:7:26: error: expected primary-expression before ']' token 7 | int K=0; int P=0;] | ^ a.cc:13:25: error: 'a' was not declared in this scope 13 | a[i]=P; | ^ a.cc:15:25: error: 'a' was not declared in this scope 15 | a[i]=K%P; | ^ a.cc:19:23: error: 'a' was not declared in this scope 19 | cout<<a[i]<<endl; | ^
s642750724
p00292
C++
#include<iostream> using namespace std; int main(){ int N,K,P; cin>>N; for(int i=0;i<N;i++){ int w; cin>>K>>P; w=K%P; if(K%P==0;) w=K; cout<<w<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:27: error: expected primary-expression before ')' token 12 | if(K%P==0;) | ^
s093269844
p00292
C++
#include <iostream> using namespace std; int main(){ int a,k,p,i; cin >> a; for(i=0;i<a;i++){ cin >> k >> p; if(k % p = 0) cout << p << endl; else cout << k % p << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:10: error: lvalue required as left operand of assignment 9 | if(k % p = 0) | ~~^~~
s134436990
p00292
C++
#include <stdio.h> 2 3 int main(void) 4 { 5 int times; // N 6 int value[times]; // K 7 int headCount[times]; // P 8 int i; 9 10 // printf("???????????????????????°?????\????????????????????????"); 11 scanf("%d", &times); 12 13 for (i = 0; i < times; i++) 14 { 15 // printf("???????????°??¨?????°?????\????????????????????????"); 16 scanf("%d %d", &value[i], &headCount[i]); 17 } 18 19 for (i = 0; i < times; i++) 20 { 21 if ((value[i] % headCount[i]) == 0) 22 { 23 printf("%d\n", headCount[i]); 24 } 25 else 26 { 27 printf("%d\n", value[i] % headCount[i]); 28 } 29 } 30 31 return 0; 32 }
a.cc:2:3: error: expected unqualified-id before numeric constant 2 | 2 | ^
s307590523
p00292
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ int N,K,P; cin>>N; for (int A=0;A<N;A++){ cin>>K>>P; if (K<P) cout>>K>>endl; else{ if (K%P==0) cout<<P<<endl; else cout<<K%P<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:9:30: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 9 | if (K<P) cout>>K>>endl; | ~~~~^~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:9:30: note: candidate: 'operator>>(int, int)' (built-in) 9 | if (K<P) cout>>K>>endl; | ~~~~^~~ a.cc:9:30: note: no known conversion for argument 1 from 'std::ostream' {aka 'std::basic_ostream<char>'} to 'int' In file included from /usr/include/c++/14/string:55, 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/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:9:26: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 9 | if (K<P) cout>>K>>endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:9:32: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = int&]': a.cc:9:18: required from here 9 | if (K<P) cout>>K>>endl; | ^ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~
s225084661
p00292
C++
#include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ int k,p; cin>>k>>p; if(k%p!=0){ cout<<k%p<<endl; } else{ cout<<p<<endl; } }
a.cc: In function 'int main()': a.cc:15:8: error: expected '}' at end of input 15 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s581295198
p00292
C++
Last One
a.cc:1:1: error: 'Last' does not name a type 1 | Last One | ^~~~
s685453836
p00293
C
#include <stdio.h> int main(void) { int N, M; int i, j; int h[100]; int m[100]; int k[100]; int g[100]; int witch; scanf("%d", &N); for (i = 0; i < N; i++) scanf("%d%d", &h[i], &m[i]); scanf("%d", &M); for (i = 0; i < M; i++) scanf("%d%d", &k[i], &g[i]); i = j = 0; while (!(i == N |&& j == M)) { if( i == N) witch = 1; else if ( j == N) witch = 0; else { if( h[i] == k[j]) { if( m[i] < g[j]) witch = 0; else witch = 1; } else if( h[i] < k[j]) witch = 0; if( h[i] > k[j]) witch = 1; if( h[i] == k[j] && m[i] == g[j]) witch = 2; } if( i != 0 || j != 0) printf(" "); switch(witch) { case 0: printf("%d:%02d", h[i], m[i]); i++; break; case 1: printf("%d:%02d", k[j], g[j]); j++; break; case 2: printf("%d:%02d", h[i], m[i]); i++;j++; break; } } printf("\n"); return 0; }
main.c: In function 'main': main.c:20:31: warning: comparison between pointer and integer 20 | while (!(i == N |&& j == M)) { | ^~ main.c:20:9: error: label 'j' used but not defined 20 | while (!(i == N |&& j == M)) { | ^~~~~
s824189992
p00293
C
#include <stdio.h> int main(void) { int N, M; int i, j; int h[100]; int m[100]; int k[100]; int g[100]; int witch; scanf("%d", &N); for (i = 0; i < N; i++) scanf("%d%d", &h[i], &m[i]); scanf("%d", &M); for (i = 0; i < M; i++) scanf("%d%d", &k[i], &g[i]); i = j = 0; while (i != N || j != M)) { if( i == N) witch = 1; else if ( j == N) witch = 0; else { if( h[i] == k[j]) { if( m[i] < g[j]) witch = 0; else witch = 1; } else if( h[i] < k[j]) witch = 0; if( h[i] > k[j]) witch = 1; if( h[i] == k[j] && m[j] == g[j]) witch = 2; } if( i != 0 || j != 0) printf(" "); switch(witch) { case 0: printf("%d:%02d", h[i], m[i]); i++; break; case 1: printf("%d:%02d", k[j], g[j]); j++; break; case 2: printf("%d:%02d", h[i], m[i]); i++;j++; break; } } printf("\n"); return 0; }
main.c: In function 'main': main.c:20:33: error: expected statement before ')' token 20 | while (i != N || j != M)) { | ^
s008190661
p00293
C
#include<stdio.h> int main(void) { int i,j,N,M,temp,m[200],h[200]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d %d",&h[i],&m[i]); } scanf("%d",&M); for(j=i;j<M+i;j++){ scanf("%d %d",&h[j],&m[j]); } for(i=M+N-1;i>0;i--){ for(j=M+N-1;j>0;j--){ if(h[j-1] > h[j]){ temp = h[j-1]; h[j-1] = h[j]; h[j] = temp; temp = m[j-1]; m[j-1] = m[j]; m[j] = temp; } else if(h[j-1] == h[j] && m[j-1] >= m[j]){ temp = m[j-1]; m[j-1] = m[j]; m[j] = temp; } } } for(i=0;i<M+N;i++){ while(h[i]==h[i+1] && m[i]==m[i+1]) i++; if(m[i] < 10) printf("%d:0%d ",h[i],m[i]); else printf("%d:%d ",h[i],m[i]); ??? return 0; }
main.c: In function 'main': main.c:37:9: error: expected expression before '?' token 37 | ??? | ^ main.c:39:1: error: expected declaration or statement at end of input 39 | } | ^
s346961929
p00293
C
#include<stdio.h> int main() { ????????int M,N,d[201],i,j,h,m,a,k=0; ????????scanf("%d",&N); ????????for(i=0;i<N;i++){ ????????????????scanf("%d %d",&h,&m); ????????????????????????d[k]=h*60+m; ????????????????????????k++; ????????} ????????scanf("%d",&M); ????????for(j=i+1;j<N+M+1;j++){ ????????????????scanf("%d %d",&h,&m); ????????????????????????d[k]=h*60+m; ????????????????????????k++; ????????} ????????for(i=0;i<M+N;i++){ ????????????????for(j=i+1;j<M+N;j++){ ????????????????????????if(d[i]>d[j]){ ????????????????????????????????a=d[i]; ????????????????????????????????d[i]=d[j]; ????????????????????????????????d[j]=a; ????????????????????????} ????????????????????????else if(d[i]==d[j]) ????????????????????????????????d[j]=-99; ?? ????????????????} ????????????????if(d[i]>=0){ ????????????????printf("%d:%02d ",d[i]/60,d[i]%60); ????????} ????????} ????????printf("\n"); ????????return 0; }
main.c: In function 'main': main.c:4:1: error: expected expression before '?' token 4 | ????????int M,N,d[201],i,j,h,m,a,k=0; | ^ main.c:5:1: error: expected expression before '?' token 5 | ????????scanf("%d",&N); | ^ main.c:5:21: error: 'N' undeclared (first use in this function) 5 | ????????scanf("%d",&N); | ^ main.c:5:21: note: each undeclared identifier is reported only once for each function it appears in main.c:6:1: error: expected expression before '?' token 6 | ????????for(i=0;i<N;i++){ | ^ main.c:12:1: error: expected expression before '?' token 12 | ????????for(j=i+1;j<N+M+1;j++){ | ^ main.c:33:1: error: expected expression before '?' token 33 | ????????return 0; | ^
s055936241
p00293
C
#include<cstdio> #include<algorithm> int main(){ int nBus=0; int aBus[2*23*59]; int n,h,m; for(int k=0;k<2;++k){ scanf("%d",&n); for(int i=0;i<n;++i){ scanf("%d %d", &h, &m); aBus[nBus+i]=h*100+m; } nBus+= n; } std::sort(aBus,aBus+nBus); nBus=std::unique(aBus,aBus+nBus)-aBus; for(int i=0;i<nBus;++i) printf("%d:%02d%c",aBus[i]/100,aBus[i]%100,(i+1)==nBus?'\n':' '); }
main.c:2:9: fatal error: cstdio: No such file or directory 2 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s564363438
p00293
C
#include<stdio.h> int main() { int N,M,sum, h[24], m[60],a,b; scanf_s("%d", &N); for (int i = 0; i < N; i++) { scanf_s("%d %d", &h[i], &m[i]); } scanf_s("%d", &M); sum = N + M; for (int i = N; i < sum; i++) { scanf_s("%d %d", &h[i], &m[i]); } for (int i = 0; i < sum; i++) { for (int j = i; j < sum; j++) { if (h[i] > h[j]) { a = h[i]; h[i] = h[j]; h[j] = a; b = m[i]; m[i] = m[j]; m[j] = b; } if (m[i] == m[j]) { if (m[i] > m[j]) { b= m[i]; m[i] = m[j]; m[j] = b; } } } } for (int i = 0; i < sum; i++) { printf("%d", h[i]); printf(":"); if (m[i] < 10) { printf("0"); } printf("%d\n", m[i]); } return 0; }
main.c: In function 'main': main.c:5:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s113447638
p00293
C
#include<stdio.h> int main(){ int time,time2,a,b,e,f,i,N,M,h[500],m[500]; scanf("%d",&N); for(a=0;a<N;a++){ scanf("%d %d",&h[a],&m[a]); } scanf("%d",&M); for(b=0;b<M;b++){ scanf("%d %d",&h[b+a],&m[b+a]); } for(e=0;e<N+M;e++){ for(f=e+1;f<N+M;f++){ if(h[e]>h[f]){ i=h[e]; h[e]=h[f]; h[f]=i; i=m[e]; m[e]=m[f]; m[f]=i; }else if(h[e]==h[f]){ if(m[e]>g[f]){ i=m[e]; m[e]=m[f]; m[f]=i; } } } } for(e=0;e<N+M;e++){ if(h[e]!=h[e-1]&&m[e]!=g[e-1]){ if(e!=0){ printf(" "); } printf("%d:%02d",h[e],m[e]); } } printf("\n"); return 0; }
main.c: In function 'main': main.c:26:41: error: 'g' undeclared (first use in this function) 26 | if(m[e]>g[f]){ | ^ main.c:26:41: note: each undeclared identifier is reported only once for each function it appears in
s659621382
p00293
C
#include<iostream> using namespace std; int main(void){ int N,h[101]={0},m[101]={0}; int M,k[101]={0},g[101]={0}; int a=0,b=0,c=0,d=0,temp=0,s[202]={0}; cin>>N; for(int i=0;i<N;i++){ cin>>h[i]>>m[i]; s[i]+=h[i]*3600+m[i]*60; } cin>>M; for(int i=0;i<M;i++){ cin>>k[i]>>g[i]; s[i+N]+=k[i]*3600+g[i]*60; } for(int i=0;i<N+M;i++){ for(int j=(N+M)-1;j>i;j--){ if(s[j]<s[j-1]){ temp=s[j]; s[j]=s[j-1]; s[j-1]=temp; } } } for(int i=0;i<N+M;i++){ a=s[i]/3600; b=(s[i]%3600)/60; if(a==c&&b==d&&i>0){ } else{ if(b<10){ cout<<a<<":0"<<b; } else{ cout<<a<<":"<<b; } if(i<N+M-1){ cout<<" "; } else{ cout<<endl; } } c=a; d=b; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s704804363
p00293
C
#include <stdio.h> int main(void) { int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; for(i=0;i<100;i++){ h[i]=999; m[i]=999; k[i]=999; g[i]=999; } scanf("%d",&M); for(i=0;i<M;i++){ scanf("%d %d",&h[i],&m[i]); } scanf("%d",&N); for(j=0;j<N;j++){ scanf("%d %d",&k[j],&g[j]); } L=M+N; for(i=0;i<L;i++){ if(h[a]>k[b]||m[a]>g[b]){ zi[c]=k[b]; pun[c]=g[b]; b++; c++; } else if(k[b]>h[a]||g[b]>m[a]){ zi[c]=h[a]; pun[c]=m[a]; a++; c++; } else{ zi[c]=h[a]; pun[c]=m[a]; a++; zi[c]=k[b]; pun[c]=g[b]; b++; c++; } if(a==M&&b==N){ break; } } for(j=0;j<c;j++){ if(pun[j]<=9){ printf("%d:0%d",zi[j],pun[j]); } else{ printf("%d:%d",zi[j],pun[j]); } if(j<c-1){ printf(" "); } else{ printf("\n"); } } return 0; }
main.c: In function 'main': main.c:4:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm' 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^ main.c:4:73: error: expected expression before ',' token 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^ main.c:4:74: error: 'pun' undeclared (first use in this function) 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^~~ main.c:4:74: note: each undeclared identifier is reported only once for each function it appears in main.c:5:13: error: 'i' undeclared (first use in this function) 5 | for(i=0;i<100;i++){ | ^ main.c:6:17: error: 'h' undeclared (first use in this function) 6 | h[i]=999; | ^ main.c:7:17: error: 'm' undeclared (first use in this function) 7 | m[i]=999; | ^ main.c:8:17: error: 'k' undeclared (first use in this function) 8 | k[i]=999; | ^ main.c:9:17: error: 'g' undeclared (first use in this function) 9 | g[i]=999; | ^ main.c:15:21: error: 'N' undeclared (first use in this function) 15 | scanf("%d",&N); | ^ main.c:16:13: error: 'j' undeclared (first use in this function) 16 | for(j=0;j<N;j++){ | ^ main.c:19:9: error: 'L' undeclared (first use in this function) 19 | L=M+N; | ^ main.c:21:22: error: 'a' undeclared (first use in this function) 21 | if(h[a]>k[b]||m[a]>g[b]){ | ^ main.c:21:27: error: 'b' undeclared (first use in this function) 21 | if(h[a]>k[b]||m[a]>g[b]){ | ^ main.c:22:25: error: 'zi' undeclared (first use in this function) 22 | zi[c]=k[b]; | ^~ main.c:22:28: error: 'c' undeclared (first use in this function) 22 | zi[c]=k[b]; | ^
s949674213
p00293
C
#include <stdio.h> int main(void) { int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; for(i=0;i<100;i++){ h[i]=999; m[i]=999; k[i]=999; g[i]=999; } scanf("%d",&M); for(i=0;i<M;i++){ scanf("%d %d",&h[i],&m[i]); } scanf("%d",&N); for(j=0;j<N;j++){ scanf("%d %d",&k[j],&g[j]); } L=M+N; for(i=0;i<L;i++){ if(h[a]>k[b]||m[a]>g[b]){ zi[c]=k[b]; pun[c]=g[b]; b++; c++; } else if(k[b]>h[a]||g[b]>m[a]){ zi[c]=h[a]; pun[c]=m[a]; a++; c++; } else{ zi[c]=h[a]; pun[c]=m[a]; a++; zi[c]=k[b]; pun[c]=g[b]; b++; c++; } if(a==M&&b==N){ break; } } for(j=0;j<c;j++){ if(pun[j]<=9){ printf("%d:0%d",zi[j],pun[j]); } else{ printf("%d:%d",zi[j],pun[j]); } if(j<c-1){ printf(" "); } else{ printf("\n"); } } return 0; }
main.c: In function 'main': main.c:4:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm' 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^ main.c:4:73: error: expected expression before ',' token 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^ main.c:4:74: error: 'pun' undeclared (first use in this function) 4 | int M,h[101]m[101],N,k[101],g[101],L,i,j,a=0,b=0,c=0,zi[202]={0},pun[202]={0}; | ^~~ main.c:4:74: note: each undeclared identifier is reported only once for each function it appears in main.c:5:13: error: 'i' undeclared (first use in this function) 5 | for(i=0;i<100;i++){ | ^ main.c:6:17: error: 'h' undeclared (first use in this function) 6 | h[i]=999; | ^ main.c:7:17: error: 'm' undeclared (first use in this function) 7 | m[i]=999; | ^ main.c:8:17: error: 'k' undeclared (first use in this function) 8 | k[i]=999; | ^ main.c:9:17: error: 'g' undeclared (first use in this function) 9 | g[i]=999; | ^ main.c:15:21: error: 'N' undeclared (first use in this function) 15 | scanf("%d",&N); | ^ main.c:16:13: error: 'j' undeclared (first use in this function) 16 | for(j=0;j<N;j++){ | ^ main.c:19:9: error: 'L' undeclared (first use in this function) 19 | L=M+N; | ^ main.c:21:22: error: 'a' undeclared (first use in this function) 21 | if(h[a]>k[b]||m[a]>g[b]){ | ^ main.c:21:27: error: 'b' undeclared (first use in this function) 21 | if(h[a]>k[b]||m[a]>g[b]){ | ^ main.c:22:25: error: 'zi' undeclared (first use in this function) 22 | zi[c]=k[b]; | ^~ main.c:22:28: error: 'c' undeclared (first use in this function) 22 | zi[c]=k[b]; | ^
s920890529
p00293
C
#include<stdio.h> int time[24][60]; int main() { int i,j,h,m,f; for(i=0;i<2;i++){ scanf("%d",&j); for(;j<0;j--){ scanf("%d %d",&h,&m); time[h][m]=1; } } f=1;[ for(j=0;j<60;j++){ if(!f)printf(" "); else f=0; printf("%d:%02d",i,j); } printf("\n"); return 0; }
main.c: In function 'main': main.c:13:21: error: expected expression before '[' token 13 | f=1;[ | ^ main.c:20:18: error: expected ';' before '}' token 20 | return 0; | ^ | ; 21 | } | ~
s735013680
p00293
C
int i, j; for(i = 0; i < n - 1; i++) { for(j = n - 1; j > i; j--) { if (a[j - 1] > a[j]) { int temp = a[j]; a[j] = a[j - 1]; a[j - 1] = temp; } } } } int main(void) { int n, m, h, p, k, g, a[100], i, c, j; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d %d", &h, &p); a[i] = h * 60 + p; } scanf("%d", &m); for(i = 0; i < m; i++) { scanf("%d %d", &k, &g); a[n + i] = k * 60 + g; } c = n + m; bsort(a, c); for(i = 0; i < c; i++) { if(a[i] == a[i + 1]) { for(j = 0; j < c; j++) a[i + j] = a[i + j + 1]; c--; } } for(i = 0; i < c; i++) { printf("%d:%.2d", a[i] / 60, a[i] % 60); if(i != c - 1) printf(" "); } printf("\n"); return 0; }
main.c:3:5: error: expected identifier or '(' before 'for' 3 | for(i = 0; i < n - 1; i++) { | ^~~ main.c:3:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 3 | for(i = 0; i < n - 1; i++) { | ^ main.c:3:28: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 3 | for(i = 0; i < n - 1; i++) { | ^~ main.c:12:1: error: expected identifier or '(' before '}' token 12 | } | ^ main.c: In function 'main': main.c:19:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 19 | scanf("%d", &n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int i, j; main.c:19:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 19 | scanf("%d", &n); | ^~~~~ main.c:19:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:34:5: error: implicit declaration of function 'bsort' [-Wimplicit-function-declaration] 34 | bsort(a, c); | ^~~~~ main.c:45:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 45 | printf("%d:%.2d", a[i] / 60, a[i] % 60); | ^~~~~~ main.c:45:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:45:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:45:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:50:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 50 | printf("\n"); | ^~~~~~ main.c:50:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s858260390
p00293
C
temp = a[j]; a[j] = a[j - 1]; a[j - 1] = temp; } } } } int main(void) { int n, m, h, p, k, g, a[200], i, c, j; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d %d", &h, &p); a[i] = h * 60 + p; } scanf("%d", &m); for(i = 0; i < m; i++) { scanf("%d %d", &k, &g); a[n + i] = k * 60 + g; } c = n + m; bsort(a, c); for(i = 0; i < c; i++) { if(a[i] == a[i + 1]) { for(j = 0; j < c; j++) a[i + j] = a[i + j + 1]; c--; i--; } } for(i = 0; i < c; i++) { printf("%d:%.2d", a[i] / 60, a[i] % 60); if(i != c - 1) printf(" "); } printf("\n"); return 0; }
main.c:1:17: warning: data definition has no type or storage class 1 | temp = a[j]; | ^~~~ main.c:1:17: error: type defaults to 'int' in declaration of 'temp' [-Wimplicit-int] main.c:1:24: error: 'a' undeclared here (not in a function) 1 | temp = a[j]; | ^ main.c:1:26: error: 'j' undeclared here (not in a function) 1 | temp = a[j]; | ^ main.c:2:17: warning: data definition has no type or storage class 2 | a[j] = a[j - 1]; | ^ main.c:2:17: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:3:17: warning: data definition has no type or storage class 3 | a[j - 1] = temp; | ^ main.c:3:17: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:4:13: error: expected identifier or '(' before '}' token 4 | } | ^ main.c:5:9: error: expected identifier or '(' before '}' token 5 | } | ^ main.c:6:5: error: expected identifier or '(' before '}' token 6 | } | ^ main.c:7:1: error: expected identifier or '(' before '}' token 7 | } | ^ main.c: In function 'main': main.c:14:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 14 | scanf("%d", &n); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | temp = a[j]; main.c:14:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 14 | scanf("%d", &n); | ^~~~~ main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:29:5: error: implicit declaration of function 'bsort' [-Wimplicit-function-declaration] 29 | bsort(a, c); | ^~~~~ main.c:41:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 41 | printf("%d:%.2d", a[i] / 60, a[i] % 60); | ^~~~~~ main.c:41:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:41:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:41:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:46:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 46 | printf("\n"); | ^~~~~~ main.c:46:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s988519405
p00293
C
int n, m, h, p, k, g, a[201], i, c, j; scanf("%d", &n); for(i = 0; i < n; i++) { scanf("%d %d", &h, &p); a[i] = h * 60 + p; } scanf("%d", &m); for(i = 0; i < m; i++) { scanf("%d %d", &k, &g); a[n + i] = k * 60 + g; } c = n + m; bsort(a, c); for(i = 0; i < c; i++) { if(a[i] == a[i + 1]) { for(j = 0; j < c; j++) a[i + j] = a[i + j + 1]; c--; i--; } } for(i = 0; i < c; i++) { printf("%d:%.2d", a[i] / 60, a[i] % 60); if(i != c - 1) printf(" "); } printf("\n"); return 0; }
main.c:4:11: error: expected declaration specifiers or '...' before string constant 4 | scanf("%d", &n); | ^~~~ main.c:4:17: error: expected declaration specifiers or '...' before '&' token 4 | scanf("%d", &n); | ^ main.c:6:5: error: expected identifier or '(' before 'for' 6 | for(i = 0; i < n; i++) { | ^~~ main.c:6:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 6 | for(i = 0; i < n; i++) { | ^ main.c:6:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 6 | for(i = 0; i < n; i++) { | ^~ main.c:11:11: error: expected declaration specifiers or '...' before string constant 11 | scanf("%d", &m); | ^~~~ main.c:11:17: error: expected declaration specifiers or '...' before '&' token 11 | scanf("%d", &m); | ^ main.c:13:5: error: expected identifier or '(' before 'for' 13 | for(i = 0; i < m; i++) { | ^~~ main.c:13:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 13 | for(i = 0; i < m; i++) { | ^ main.c:13:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 13 | for(i = 0; i < m; i++) { | ^~ main.c:18:5: warning: data definition has no type or storage class 18 | c = n + m; | ^ main.c:18:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:18:9: error: initializer element is not constant 18 | c = n + m; | ^ main.c:19:5: warning: data definition has no type or storage class 19 | bsort(a, c); | ^~~~~ main.c:19:5: error: type defaults to 'int' in declaration of 'bsort' [-Wimplicit-int] main.c:19:5: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type] main.c:21:5: error: expected identifier or '(' before 'for' 21 | for(i = 0; i < c; i++) { | ^~~ main.c:21:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 21 | for(i = 0; i < c; i++) { | ^ main.c:21:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 21 | for(i = 0; i < c; i++) { | ^~ main.c:30:5: error: expected identifier or '(' before 'for' 30 | for(i = 0; i < c; i++) { | ^~~ main.c:30:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 30 | for(i = 0; i < c; i++) { | ^ main.c:30:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 30 | for(i = 0; i < c; i++) { | ^~ main.c:36:12: error: expected declaration specifiers or '...' before string constant 36 | printf("\n"); | ^~~~ main.c:38:5: error: expected identifier or '(' before 'return' 38 | return 0; | ^~~~~~ main.c:39:1: error: expected identifier or '(' before '}' token 39 | } | ^
s409439081
p00293
C++
#include<iostream> #include<set> using namespace std; int main(){ set<int> times; int n, h, m; cin >> n; while(n-- > 0){ cin >> h >> m; times.inserts(60*h + m); } cin >> n; while(n-- > 0){ cin >> h >> m; times.insert(60*h + m); } bool first = true; for(set<int>::iterator it = times.begin(); it != times.end(); it++){ if(first) first = false; else printf(" "); int x = *it; int a = x / 60; int b = x - 60*a; printf("%d:%02d", a, b); } printf("\n"); return 0; }
a.cc: In function 'int main()': a.cc:11:15: error: 'class std::set<int>' has no member named 'inserts'; did you mean 'insert'? 11 | times.inserts(60*h + m); | ^~~~~~~ | insert
s382085682
p00293
C++
#include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; typedef pair<int, int>pi; typedef pair<ll, ll> P; typedef pair<ll, P> PP; typedef pair<P, P> PPP; const ll MOD = 1e9 + 7; const ll INF = 9e18; const double DINF = 5e14; const double eps = 1e-10; const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 }; #define ALL(x) (x).begin(),(x).end() #define ALLR(x) (x).rbegin(),(x).rend() #define pb push_back #define eb emplace_back #define fr first #define sc second int a, b, h, m; vector<PP>v; int main() { cin >> a; for (int i = 0;i < a;i++) { cin >> h >> m; v.eb(PP(h * 60 + m, P(h, m))); } cin >> b; for (int i = 0;i < b;i++) { cin >> h >> m; v.eb(PP(h * 60 + m, P(h, m))); } sort(ALL(v)); v.erase(unique(ALL(v), v.end())); for (int i = 0;i < a + b;i++) { string p = to_string(v[i].sc.sc); if (v[i].sc.sc < 10)p = "0" + p; if (i != a + b - 1)cout << v[i].sc.fr << ':' << p << ' '; else cout << v[i].sc.fr << ':' << p << endl; } return 0; }
In file included from /usr/include/c++/14/bits/stl_algobase.h:71, from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >; _Iterator2 = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >; _Compare = __gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >]': /usr/include/c++/14/bits/stl_algo.h:869:20: required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > > >]' 869 | if (!__binary_pred(__dest, __first)) | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_algo.h:933:27: required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >; _BinaryPredicate = __gnu_cxx::__normal_iterator<pair<long long int, pair<long long int, long long int> >*, vector<pair<long long int, pair<long long int, long long int> > > >]' 933 | return std::__unique(__first, __last, | ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~ 934 | __gnu_cxx::__ops::__iter_comp_iter(__binary_pred)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:40:16: required from here 40 | v.erase(unique(ALL(v), v.end())); | ~~~~~~^~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<std::pair<long long int, std::pair<long long int, long long int> >*, std::vector<std::pair<long long int, std::pair<long long int, long long int> > > >) (std::pair<long long int, std::pair<long long int, long long int> >&, std::pair<long long int, std::pair<long long int, long long int> >&)' 158 | { return bool(_M_comp(*__it1, *__it2)); } | ~~~~~~~^~~~~~~~~~~~~~~~
s837171363
p00293
C++
#include "bits/stdc++.h" using namespace std; using ll = long long; using ull = unsigned long long; typedef pair<int, int>pi; typedef pair<ll, ll> P; typedef pair<ll, P> PP; typedef pair<P, P> PPP; const ll MOD = 1e9 + 7; const ll INF = 9e18; const double DINF = 5e14; const double eps = 1e-10; const int di[4] = { 1,0,-1,0 }, dj[4] = { 0,1,0,-1 }; #define ALL(x) (x).begin(),(x).end() #define ALLR(x) (x).rbegin(),(x).rend() #define pb push_back #define eb emplace_back #define fr first #define sc second int a, b, h, m; map<int, P>mp; int main() { cin >> a; for (int i = 0;i < a;i++) { cin >> h >> m; mp[h * 60 + m] = P(h, m); } cin >> b; for (int i = 0;i < b;i++) { cin >> h >> m; mp[h * 60 + m] = P(h, m); } for (auto u : mp) { string p = to_string(u.sc.sc); if (u.sc.sc < 10)p = "0" + p; if (i != a + b - 1)cout << u.sc.fr << ':' << p << ' '; else cout << u.sc.fr << ':' << p << endl; } return 0; }
a.cc: In function 'int main()': a.cc:42:21: error: 'i' was not declared in this scope 42 | if (i != a + b - 1)cout << u.sc.fr << ':' << p << ' '; | ^
s764112286
p00293
C++
#include<stdio.h> void bubbleSort(int dt[],int n) { int i,j,temp; for(i=0;i<n-1;i++){ for(j=n-1;j>i;j--){ if(dt[j-1]>dt[j]){ temp=dt[j]; dt[j]=dt[j-1]; dt[j-1]=temp; } } } } int main(){ int h; int m; int a[200]; int an,bn; int i; scanf("%d",&an); for(i=0;i<an;i++){ scanf("%d",&h); scanf("%d",&m); a[i]=h*60+m; } scanf("%d",&bn); for(i=an;i<an+bn;i++){ scanf("%d",&h); scanf("%d",&m); a[i]=h*60+m; } bubbleSort(a,an+bn); for(i=0;i<an+bn-1;i++){ if(a[i-1]!=a[i]){ printf("%d:%02d ",(a[i]-(a[i]%60))/60,a[i]%60); } } i=an+bn-1; if(a[i-1]!=a[i]){ printf("%d:%02d",(a[i]-(a[i]%60))/60,a[i]%60); } printf("\n"); return 0;
a.cc: In function 'int main()': a.cc:69:10: error: expected '}' at end of input 69 | return 0; | ^ a.cc:23:11: note: to match this '{' 23 | int main(){ | ^
s387404542
p00293
C++
#include <iostream> #include <map> #include <vector> using namespace std; int main(){ std::vector< pair<int,int> > a; int N,h,m,M; pair<int,int> time; cin >> N; for(int i = 0; i < N ;i++){ cin >> h >> m; time.first = h; time.second = m; a.push_back(time); } cin >> M; for(int i = 0; i < M ;i++){ cin >> h >> m; time.first = h; time.second = m; a.push_back(time); } std::sort(a.begin(),a.end());//昇順ソート //std::sort(&data[0],&data[5]);//上と同じ意味 cout << a[0].first << ":" << a[0].second; for(int i = 1 ; i < a.size() ; i++){ cout << " " << a[i].first << ":"; if( a[i].second < 10 ) cout << "0"; cout << a[i].second; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 26 | std::sort(a.begin(),a.end());//昇順ソート | ^~~~ | qsort
s488769496
p00293
C++
#include <iostream> #include <map> #include <vector> using namespace std; int main(){ std::vector< pair<int,int> > a; int N,h,m,M; pair<int,int> time; cin >> N; for(int i = 0; i < N ;i++){ cin >> h >> m; time.first = h; time.second = m; a.push_back(time); } cin >> M; for(int i = 0; i < M ;i++){ cin >> h >> m; time.first = h; time.second = m; a.push_back(time); } std::sort(a.begin(),a.end());//昇順ソート //std::sort(&data[0],&data[5]);//上と同じ意味 cout << a[0].first << ":" << a[0].second; for(int i = 1 ; i < a.size() ; i++){ cout << " " << a[i].first << ":"; if( a[i].second < 10 ) cout << "0"; cout << a[i].second; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:26:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'? 26 | std::sort(a.begin(),a.end());//昇順ソート | ^~~~ | qsort
s490826760
p00293
C++
#include <iostream> #include <vector> #include <cstdio> using namespace std; typedef pair<int,int> P; int main() { while (true) { vector<P> v; for (int i = 0; i < 2; i++) { int n; if (!(cin >> n)) return 0; while (n--) { int h, m; cin >> h >> m; v.push_back(P(h, m)); } } sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end()); for (int i = 0; i < v.size(); i++) { if (i != 0) cout << " "; printf("%d:%02d", v[i].first, v[i].second); } cout << endl; } }
a.cc: In function 'int main()': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(v.begin(), v.end()); | ^~~~ | short a.cc:25:13: error: 'unique' was not declared in this scope 25 | v.erase(unique(v.begin(), v.end()), v.end()); | ^~~~~~
s936740395
p00293
C++
#include <iostream> #include <stdlib.h> int main() { sprintf("aaa"); }
a.cc: In function 'int main()': a.cc:5:11: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings] 5 | sprintf("aaa"); | ^~~~~ a.cc:5:10: error: too few arguments to function 'int sprintf(char*, const char*, ...)' 5 | sprintf("aaa"); | ~~~~~~~^~~~~~~ In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdio.h:365:12: note: declared here 365 | extern int sprintf (char *__restrict __s, | ^~~~~~~
s517901752
p00293
C++
#include <cstdio> #include <iostream> #include <iomanip> #include <string> using namespace std; int main(){ int a[2],i = 1,keta; cin >> a[0]; int n[a[0]],m[a[0]]; while (a[0] >= i){ cin >> n[i] >> m[i]; i++; } i = 1; cin >> a[1]; int o[a[1]],p[a[1]]; while (a[1] >= i){ cin >> o[i] >> p[i]; i++; } i = 1; int ii,c,aa,iii; aa = a[0] + a[1]; int ans[aa][2]; while(aa >= i){ ii = 1; if(a[0] >= i){//n,m while(aa >= ii){ if(a[0] >= ii){//n,m n,m if(n[i] == n[ii] and m[i] == n[ii] and i != ii){ iii = 1; while(a[0] >= iii){ if(iii > ii){ n[iii - 1] = n[iii]; m[iii - 1] = m[iii]; aa = aa - 1; } iii++; } } }else{//n,m o,p //cout << n[i] << " " << o[ii - a[0]] << " " << m[i] << " " << p[ii - a[0]] << endl; if(n[i] == o[ii - a[0]] and m[i] == p[ii - a[0]] and i != ii){ iii = 1; while(a[1] >= iii){ //cout << "OK"; if(iii > ii - a[0]){ o[iii - 1] = o[iii]; p[iii - 1] = p[iii]; aa = aa - 1; } iii++; } } } ii++; } }else{//o,p o,p while(aa >= ii){ if(a[0] <= ii){//o,p o,p if(o[i - a[0]] == o[ii - a[0]] and p[i - a[0]] == p[ii - a[0]] and i - a[0] != ii - a[0]){ iii = 1; while(a[1] >= iii){ if(iii > ii){ o[iii - 1] = o[iii]; o[iii - 1] = p[iii]; aa = aa - 1; } iii++; } } } ii++; } } i++; } /*i = 1; cout << aa << endl; while(aa >= i){ keta = 0; if(a[0] >= i){ cout << "[N][" << i << "]"; if(m[i] < 10){ cout << n[i] << ":" << keta << m[i] << "b "; }else{ cout << n[i] << ":" << m[i] << "b "; } }else{ cout << "[O][" << i - a[0] << "]"; if(p[i - a[0]] < 10){ cout << o[i - a[0]] << ":" << keta << p[i - a[0]] << "c "; }else{ cout << o[i - a[0]] << ":" << p[i - a[1]] << "c "; } } i++; }*/ i = 1; /*2 0 0 21 0 3 7 30 21 0 23 7*/ while(aa >= i){ ii = 1; c = 0; if(a[0] >= i){ while(aa >= ii){ if(a[0] >= ii){ if(n[i] > n[ii]){ c++; }else if(m[i] > m[ii]){ c++; } }else{ if(n[i] > o[ii - a[0]]){ c++; }else if(m[i] > p[ii - a[0]]){ c++; } } ii++; } ans[c][0] = n[i]; ans[c][1] = m[i]; //cout << c << "a" << endl; }else{ while(aa >= ii){ if(a[0] >= ii){ if(o[i - a[0]] > n[ii]){ c++; //cout << c << "ka" << endl; }else if(o[i - a[0]] > n[ii] and p[i - a[0]] > m[ii]){ c++; //cout << c << "kb" << endl; } }else{ if(o[i - a[0]] > o[ii - a[0]]){ c++; //cout << c << "kc" << endl; }else if(o[i - a[0]] > o[ii - a[0]] and p[i - a[0]] > p[ii - a[0]]){ c++; //cout << c << "ke" << endl; } } ii++; } //cout << c << "b" << endl; ans[c][0] = o[i - a[0]]; ans[c][1] = p[i - a[0]]; } i++; } i = 0; while(aa > i){ keta = 0; if(ans[i][1] < 10){ cout << ans[i][0] << ":" << keta << ans[i][1] << " "; }else{ cout << ans[i][0] << ":" << ans[i][1] << " "; } i++; } ???
a.cc: In function 'int main()': a.cc:167:1: error: expected primary-expression before '?' token 167 | ??? | ^ a.cc:167:2: error: expected primary-expression before '?' token 167 | ??? | ^ a.cc:167:3: error: expected primary-expression before '?' token 167 | ??? | ^ a.cc:167:4: error: expected primary-expression at end of input 167 | ??? | ^ a.cc:167:4: error: expected ':' at end of input 167 | ??? | ^ | : a.cc:167:4: error: expected primary-expression at end of input a.cc:167:4: error: expected ':' at end of input 167 | ??? | ^ | : a.cc:167:4: error: expected primary-expression at end of input a.cc:167:4: error: expected ':' at end of input 167 | ??? | ^ | : a.cc:167:4: error: expected primary-expression at end of input a.cc:167:4: error: expected '}' at end of input a.cc:8:11: note: to match this '{' 8 | int main(){ | ^
s389529483
p00293
C++
#include <iostream> using namespace std; int main(){ int N=0; int h[200]; int m[200]; int M=0; int k[200]; int g[200]; int L=0; cin>>N; int tem=0; int i=0; for(int i=0;i<N;i++){ cin>>h[i]>>m[i]; } cin>>M; for(int i=0;i<M;i++){ cin>>k[i]>>g[i]; } int A=N+M; for(int i=0;i<M;i++){ h[N+i]=k[i]; m[N+i]=g[i]; } for(int i=0;i<A-1;i++){ for(int q=i;q<A-1;q++){ if(h[i]>h[q+1]){ tem=h[i]; h[i]=h[q+1]; h[q+1]=tem; tem=m[i]; m[i]=m[q+1]; m[q+1]=tem; } if((h[i]==h[q+1])&&(m[i]==m[q+1])){ h[q+1]=h[q+2]; m[q+1]=m[q+2]; A--; p--; } } for(int q=i;q<A-1;q++){ if((h[i]==h[q+1])&&(m[i]>m[q+1])){ tem=m[i]; m[i]=m[q+1]; m[q+1]=tem; } } } while(1){ if(m[i]<10){ cout<<h[i]<<":0"<<m[i]; } else{ cout<<h[i]<<":"<<m[i]; } A--; i++; if(A==0){ cout<<endl; break; } else{ cout<<" "; } } return 0; }
a.cc: In function 'int main()': a.cc:41:33: error: 'p' was not declared in this scope 41 | p--; | ^
s590014492
p00293
C++
#include <iostream> using namespace std; int main(){ int N=0; int h[200]; int m[200]; int M=0; int k[200]; int g[200]; int L=0; cin>>N; int tem=0; int i=0; for(int i=0;i<N;i++){ cin>>h[i]>>m[i]; } cin>>M; for(int i=0;i<M;i++){ cin>>k[i]>>g[i]; } int A=N+M; for(int i=0;i<M;i++){ h[N+i]=k[i]; m[N+i]=g[i]; } for(int i=0;i<A-1;i++){ for(int q=i;q<A-1;q++){ if(h[i]>h[q+1]){ tem=h[i]; h[i]=h[q+1]; h[q+1]=tem; tem=m[i]; m[i]=m[q+1]; m[q+1]=tem; } if((h[i]==h[q+1])&&(m[i]==m[q+1])){ h[q+1]=h[q+2]; m[q+1]=m[q+2]; A--; q--; } } for(int q=i;q<A-1;q++){ if((h[i]==h[q+1])&&(m[i]=>m[q+1])){ tem=m[i]; m[i]=m[q+1]; m[q+1]=tem; } } } while(1){ if(m[i]<10){ cout<<h[i]<<":0"<<m[i]; } else{ cout<<h[i]<<":"<<m[i]; } A--; i++; if(A==0){ cout<<endl; break; } else{ cout<<" "; } } return 0; }
a.cc: In function 'int main()': a.cc:45:50: error: expected primary-expression before '>' token 45 | if((h[i]==h[q+1])&&(m[i]=>m[q+1])){ | ^
s505906534
p00293
C++
#include<iostream> using namespace std; struct time{ int h,m; }; int main(){ /////////////??£?¨?/////////////// int n,m; time tmp1[100],tmp2[100]; /////////////??£?¨?/////////////// /////////////????????¨1??\???/////////////// cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; /////////////????????¨1??\???/////////////// tmp1[n].h=25; //?????? /////////////????????¨2??\???/////////////// cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; /////////////????????¨2??\???/////////////// tmp2[m].h=25; //?????? /////////////??£?¨?/////////////// time ans[200]; int cnt1=0,cnt2=0; /////////////??£?¨?/////////////// /////////////?????????/////////////// for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } /////////////?????????/////////////// /////////////??????/////////////// for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; /////////////??????/////////////// return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: expected ';' before 'tmp1' 11 | time tmp1[100],tmp2[100]; | ^~~~~ | ; a.cc:17:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 17 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:20:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 20 | tmp1[n].h=25; //?????? | ^~~~ | tm a.cc:25:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 25 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:28:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 28 | tmp2[m].h=25; //?????? | ^~~~ | tm a.cc:31:13: error: expected ';' before 'ans' 31 | time ans[200]; | ^~~~ | ; a.cc:38:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:43:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 43 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:53:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 53 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:58:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 58 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:66:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 66 | if(ans[i].m<10) | ^~~ | abs
s557344440
p00293
C++
#include<iostream> using namespace std; struct time{ int h,m; }; int main(){ /////////////??£?¨?/////////////// int n,m; time tmp1[100],tmp2[100]; /////////////??£?¨?/////////////// /////////////????????¨1??\???/////////////// cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; /////////////????????¨1??\???/////////////// tmp1[n].h=25; //?????? /////////////????????¨2??\???/////////////// cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; /////////////????????¨2??\???/////////////// tmp2[m].h=25; //?????? /////////////??£?¨?/////////////// time ans[200]; int cnt1=0,cnt2=0; /////////////??£?¨?/////////////// /////////////?????????/////////////// for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } /////////////?????????/////////////// /////////////??????/////////////// for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; /////////////??????/////////////// return 0; }
a.cc: In function 'int main()': a.cc:11:13: error: expected ';' before 'tmp1' 11 | time tmp1[100],tmp2[100]; | ^~~~~ | ; a.cc:17:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 17 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:20:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 20 | tmp1[n].h=25; //?????? | ^~~~ | tm a.cc:25:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 25 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:28:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 28 | tmp2[m].h=25; //?????? | ^~~~ | tm a.cc:31:13: error: expected ';' before 'ans' 31 | time ans[200]; | ^~~~ | ; a.cc:38:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:43:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 43 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:53:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 53 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:58:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 58 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:66:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 66 | if(ans[i].m<10) | ^~~ | abs
s647018155
p00293
C++
#include<iostream> using namespace std; struct time{ int h,m; }; int main(){ int n,m; time tmp1[100],tmp2[100]; cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; tmp1[n].h=25; cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; tmp2[m].h=25; time ans[200]; int cnt1=0,cnt2=0; for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: expected ';' before 'tmp1' 10 | time tmp1[100],tmp2[100]; | ^~~~~ | ; a.cc:14:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 14 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:16:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 16 | tmp1[n].h=25; | ^~~~ | tm a.cc:20:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 20 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:22:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 22 | tmp2[m].h=25; | ^~~~ | tm a.cc:24:13: error: expected ';' before 'ans' 24 | time ans[200]; | ^~~~ | ; a.cc:29:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 29 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:34:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 34 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:38:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:44:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 44 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:49:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 49 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:55:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 55 | if(ans[i].m<10) | ^~~ | abs
s336173803
p00293
C++
#include<iostream> using namespace std; struct time{ int h; int m; }; int main(){ /////////////??£?¨?/////////////// int n; int m; time tmp1[100]; time tmp2[100]; /////////////??£?¨?/////////////// /////////////????????¨1??\???/////////////// cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; /////////////????????¨1??\???/////////////// tmp1[n].h=25; //?????? /////////////????????¨2??\???/////////////// cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; /////////////????????¨2??\???/////////////// tmp2[m].h=25; //?????? /////////////??£?¨?/////////////// time ans[200]; int cnt1=0; int cnt2=0; /////////////??£?¨?/////////////// /////////////?????????/////////////// for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } /////////////?????????/////////////// /////////////??????/////////////// for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; /////////////??????/////////////// return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: expected ';' before 'tmp1' 13 | time tmp1[100]; | ^~~~~ | ; a.cc:14:13: error: expected ';' before 'tmp2' 14 | time tmp2[100]; | ^~~~~ | ; a.cc:20:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 20 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:23:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 23 | tmp1[n].h=25; //?????? | ^~~~ | tm a.cc:28:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 28 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:31:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 31 | tmp2[m].h=25; //?????? | ^~~~ | tm a.cc:34:13: error: expected ';' before 'ans' 34 | time ans[200]; | ^~~~ | ; a.cc:42:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 42 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:51:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 51 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:57:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 57 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:62:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 62 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:70:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 70 | if(ans[i].m<10) | ^~~ | abs
s671248425
p00293
C++
#include<iostream> using namespace std; struct time{ int h; int m; }; int main(){ /////////////??£?¨?/////////////// int n; int m; time tmp1[100]; time tmp2[100]; /////////////??£?¨?/////////////// /////////////????????¨1??\???/////////////// cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; /////////////????????¨1??\???/////////////// tmp1[n].h=25; //?????? /////////////????????¨2??\???/////////////// cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; /////////////????????¨2??\???/////////////// tmp2[m].h=25; //?????? /////////////??£?¨?/////////////// time ans[200]; int cnt1=0; int cnt2=0; /////////////??£?¨?/////////////// /////////////?????????/////////////// for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } /////////////?????????/////////////// /////////////??????/////////////// for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; /////////////??????/////////////// return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: expected ';' before 'tmp1' 13 | time tmp1[100]; | ^~~~~ | ; a.cc:14:13: error: expected ';' before 'tmp2' 14 | time tmp2[100]; | ^~~~~ | ; a.cc:20:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 20 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:23:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 23 | tmp1[n].h=25; //?????? | ^~~~ | tm a.cc:28:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 28 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:31:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 31 | tmp2[m].h=25; //?????? | ^~~~ | tm a.cc:34:13: error: expected ';' before 'ans' 34 | time ans[200]; | ^~~~ | ; a.cc:42:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 42 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:51:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 51 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:57:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 57 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:62:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 62 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:70:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 70 | if(ans[i].m<10) | ^~~ | abs
s280385889
p00293
C++
#include<iostream> using namespace std; struct time{ int h; int m; }; int main(){ /////////////??£?¨?/////////////// int n; int m; time tmp1[100]; time tmp2[100]; /////////////??£?¨?/////////////// /////////////????????¨1??\???/////////////// cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; /////////////????????¨1??\???/////////////// tmp1[n].h=25; //?????? /////////////????????¨2??\???/////////////// cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; /////////////????????¨2??\???/////////////// tmp2[m].h=25; //?????? /////////////??£?¨?/////////////// time ans[200]; int cnt1=0; int cnt2=0; /////////////??£?¨?/////////////// /////////////?????????/////////////// for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } /////////////?????????/////////////// /////////////??????/////////////// for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; /////////////??????/////////////// return 0; }
a.cc: In function 'int main()': a.cc:13:13: error: expected ';' before 'tmp1' 13 | time tmp1[100]; | ^~~~~ | ; a.cc:14:13: error: expected ';' before 'tmp2' 14 | time tmp2[100]; | ^~~~~ | ; a.cc:20:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 20 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:23:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 23 | tmp1[n].h=25; //?????? | ^~~~ | tm a.cc:28:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 28 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:31:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 31 | tmp2[m].h=25; //?????? | ^~~~ | tm a.cc:34:13: error: expected ';' before 'ans' 34 | time ans[200]; | ^~~~ | ; a.cc:42:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 42 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:47:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 47 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:51:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 51 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:57:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 57 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:62:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 62 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:70:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 70 | if(ans[i].m<10) | ^~~ | abs
s085460190
p00293
C++
#include<iostream> using namespace std; struct time{ int h,m; }; int main(){ int n,m; time tmp1[100],tmp2[100]; cin >> n; for(int i=0;i<n;i++) cin >> tmp1[i].h >> tmp1[i].m; tmp1[n].h=25; cin >> m; for(int i=0;i<m;i++) cin >> tmp2[i].h >> tmp2[i].m; tmp2[m].h=25; time ans[200]; int cnt1=0,cnt2=0; for(int i=0;i<n+m;i++){ if(tmp1[cnt1].h<tmp2[cnt2].h){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].h==tmp2[cnt2].h){ if(tmp1[cnt1].m<tmp2[cnt2].m){ ans[i]=tmp1[cnt1]; cnt1++; } else if(tmp1[cnt1].m==tmp2[cnt2].m){ ans[i]=tmp2[cnt2]; cnt2++; cnt1++; n--; } else{ ans[i]=tmp2[cnt2]; cnt2++; } } else{ ans[i]=tmp2[cnt2]; cnt2++; } } for(int i=0;i<n+m;i++){ if(ans[i].m<10) cout << ans[i].h << ":0" << ans[i].m << ' '; else cout << ans[i].h << ':' << ans[i].m << ' '; } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: expected ';' before 'tmp1' 10 | time tmp1[100],tmp2[100]; | ^~~~~ | ; a.cc:14:24: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 14 | cin >> tmp1[i].h >> tmp1[i].m; | ^~~~ | tm a.cc:16:9: error: 'tmp1' was not declared in this scope; did you mean 'tm'? 16 | tmp1[n].h=25; | ^~~~ | tm a.cc:20:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 20 | cin >> tmp2[i].h >> tmp2[i].m; | ^~~~ | tm a.cc:22:9: error: 'tmp2' was not declared in this scope; did you mean 'tm'? 22 | tmp2[m].h=25; | ^~~~ | tm a.cc:24:13: error: expected ';' before 'ans' 24 | time ans[200]; | ^~~~ | ; a.cc:29:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 29 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:34:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 34 | ans[i]=tmp1[cnt1]; | ^~~ | abs a.cc:38:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:44:33: error: 'ans' was not declared in this scope; did you mean 'abs'? 44 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:49:25: error: 'ans' was not declared in this scope; did you mean 'abs'? 49 | ans[i]=tmp2[cnt2]; | ^~~ | abs a.cc:55:20: error: 'ans' was not declared in this scope; did you mean 'abs'? 55 | if(ans[i].m<10) | ^~~ | abs
s204367444
p00293
C++
#include <set> #include <algorithm> #include <iostream> using namespace std; int main() { set<pair<int, int>> t; for(int i=0; i<2; i++){ int N; cin >> N; while(N--){ int h,m; cin >> h >> m; table.insert((h,m)); } } for(auto&& i : t) printf("%d:%02d",i.first,i.second); if(i != *(t.end()-1)) cout << " "; } }
a.cc: In function 'int main()': a.cc:13:13: error: 'table' was not declared in this scope; did you mean 'mutable'? 13 | table.insert((h,m)); | ^~~~~ | mutable a.cc:18:12: error: 'i' was not declared in this scope 18 | if(i != *(t.end()-1)) | ^ a.cc:18:26: error: no match for 'operator-' (operand types are 'std::set<std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator'} and 'int') 18 | if(i != *(t.end()-1)) | ~~~~~~~^~ | | | | | int | std::set<std::pair<int, int> >::iterator {aka std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator} In file included from /usr/include/c++/14/bits/stl_algobase.h:67, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/set:62, from a.cc:1: /usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 618 | operator-(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:618:5: note: template argument deduction/substitution failed: a.cc:18:27: note: 'std::set<std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator'} is not derived from 'const std::reverse_iterator<_Iterator>' 18 | if(i != *(t.end()-1)) | ^ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1790 | operator-(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1790:5: note: template argument deduction/substitution failed: a.cc:18:27: note: 'std::set<std::pair<int, int> >::iterator' {aka 'std::_Rb_tree<std::pair<int, int>, std::pair<int, int>, std::_Identity<std::pair<int, int> >, std::less<std::pair<int, int> >, std::allocator<std::pair<int, int> > >::const_iterator'} is not derived from 'const std::move_iterator<_IteratorL>' 18 | if(i != *(t.end()-1)) | ^ a.cc: At global scope: a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s820805452
p00293
C++
#include<set> #include<iostream> int main(){ int i=2,N,h,m;set<pair<int, int>> t; while(i--&&std::cin>>N)while(N--&&std::cin>>h>>m)t.insert(make_pair(h,m)); for(auto i=t.begin();i!=t.end();)printf("%d:%02d",i->first,i->second),std::cout<<(++i!=t.end()?" ":""); cout<<endl; }
a.cc: In function 'int main()': a.cc:4:15: error: 'set' was not declared in this scope 4 | int i=2,N,h,m;set<pair<int, int>> t; | ^~~ a.cc:4:15: note: suggested alternatives: In file included from /usr/include/c++/14/set:63, from a.cc:1: /usr/include/c++/14/bits/stl_set.h:96:11: note: 'std::set' 96 | class set | ^~~ /usr/include/c++/14/set:87:13: note: 'std::pmr::set' 87 | using set = std::set<_Key, _Cmp, polymorphic_allocator<_Key>>; | ^~~ a.cc:4:19: error: 'pair' was not declared in this scope; did you mean 'std::pair'? 4 | int i=2,N,h,m;set<pair<int, int>> t; | ^~~~ | std::pair In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/stl_tree.h:63, from /usr/include/c++/14/set:62: /usr/include/c++/14/bits/stl_pair.h:89:12: note: 'std::pair' declared here 89 | struct pair; | ^~~~ a.cc:4:24: error: expected primary-expression before 'int' 4 | int i=2,N,h,m;set<pair<int, int>> t; | ^~~ a.cc:5:50: error: 't' was not declared in this scope 5 | while(i--&&std::cin>>N)while(N--&&std::cin>>h>>m)t.insert(make_pair(h,m)); | ^ a.cc:5:59: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'? 5 | while(i--&&std::cin>>N)while(N--&&std::cin>>h>>m)t.insert(make_pair(h,m)); | ^~~~~~~~~ | std::make_pair /usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here 1132 | make_pair(_T1&& __x, _T2&& __y) | ^~~~~~~~~ a.cc:6:12: error: 't' was not declared in this scope 6 | for(auto i=t.begin();i!=t.end();)printf("%d:%02d",i->first,i->second),std::cout<<(++i!=t.end()?" ":""); | ^ a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 7 | cout<<endl; | ^~~~ | std::cout In file included from a.cc:2: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:7:7: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 7 | cout<<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) | ^~~~
s628455198
p00293
C++
#include <iostream> int main() { int a,b[24],c[60],d,f[24],g[60]; std::cin>>a; for(int i=0;i<a;i++){ std::cin>>b[i]>>c[i]; } std::cin>>f; for(int i=0;i<f;i++){ std::cin>>g[i]>>h[i]; } while(true){ int i=0; int j=0; if(b[i]==g[j]&&c[i]==h[j]){ if(c[i]/10==0) std::cout<<b[i]<<":0"<<c[i]<<std::endl; else std::cout<<b[i]<<":"<<c[i]<<std::endl; i++; j++; } if(b[i]<g[j]&&c[i]<h[j]){ if(c[i]/10==0) std::cout<<b[i]<<":0"<<c[i]<<std::endl; else std::cout<<b[i]<<":"<<c[i]<<std::endl; i++; } if(a==i){ while(true){ if(h[i]/10==0) std::cout<<g[j]<<":0"<<h[j]<<std::endl; else std::cout<<g[j]<<":"<<h[j]<<std::endl; j++; if(f==j)break; } } if(b[i]>g[j]&&c[i]>h[j]){ if(h[i]/10==0) std::cout<<g[j]<<":0"<<h[j]<<std::endl; else std::cout<<g[j]<<":"<<h[j]<<std::endl; j++; } if(f==j){ while(true){ if(c[i]/10==0) std::cout<<b[i]<<":0"<<c[i]<<std::endl; else std::cout<<b[i]<<":"<<c[i]<<std::endl; i++; if(a==i)break; } } } return 0; }
a.cc: In function 'int main()': a.cc:10:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [24]') 10 | std::cin>>f; | ~~~~~~~~^~~ | | | | | int [24] | std::istream {aka std::basic_istream<char>} In file included from /usr/include/c++/14/iostream:42, from a.cc:1: /usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 170 | operator>>(bool& __n) | ^~~~~~~~ /usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'int*' 10 | std::cin>>f; | ^ /usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 174 | operator>>(short& __n); | ^~~~~~~~ /usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'short int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(short int)((int*)(& f))' to 'short int&' /usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 177 | operator>>(unsigned short& __n) | ^~~~~~~~ /usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'short unsigned int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(short unsigned int)((int*)(& f))' to 'short unsigned int&' /usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match) 181 | operator>>(int& __n); | ^~~~~~~~ /usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(int)((int*)(& f))' to 'int&' /usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 184 | operator>>(unsigned int& __n) | ^~~~~~~~ /usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'unsigned int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(unsigned int)((int*)(& f))' to 'unsigned int&' /usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 188 | operator>>(long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'long int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(long int)((int*)(& f))' to 'long int&' /usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 192 | operator>>(unsigned long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'long unsigned int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(long unsigned int)((int*)(& f))' to 'long unsigned int&' /usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 199 | operator>>(long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'long long int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(long long int)((int*)(& f))' to 'long long int&' /usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 203 | operator>>(unsigned long long& __n) | ^~~~~~~~ /usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: invalid conversion from 'int*' to 'long long unsigned int' [-fpermissive] 10 | std::cin>>f; | ^ | | | int* a.cc:10:15: error: cannot bind rvalue '(long long unsigned int)((int*)(& f))' to 'long long unsigned int&' /usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match) 328 | operator>>(void*& __p) | ^~~~~~~~ /usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed: a.cc:10:15: error: cannot bind non-const lvalue reference of type 'void*&' to an rvalue of type 'void*' 10 | std::cin>>f; | ^ /usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 219 | operator>>(float& __f) | ^~~~~~~~ /usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'int [24]' to 'float&' 219 | operator>>(float& __f) | ~~~~~~~^~~ /usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 223 | operator>>(double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'int [24]' to 'double&' 223 | operator>>(double& __f) | ~~~~~~~~^~~ /usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 227 | operator>>(long double& __f) | ^~~~~~~~ /usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'int [24]' to 'long double&' 227 | operator>>(long double& __f) | ~~~~~~~~~~~~~^~~ /usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'int [24]' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} 122 | operator>>(__istream_type& (*__pf)(__istream_type&)) | ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char>]' 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ^~~~~~~~ /usr/include/c++/14/istream:126:32: note: no known conversion for argument 1 from 'int [24]' to 'std::basic_istream<char>::__ios_type& (*)(std::basic_istream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'} 126 | operator>>(__ios_type& (*__pf)(__ios_type&)) | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ /usr/include/c++/14/istream:133:7: note: candidate: 'std::basic_istream<_CharT
s691892931
p00293
C++
#include<iostream> using namespace std; int main(){ int n,m,a[100],b[100],c[100],d[100]; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; cin>>m; for(int p=0;p<m;p++){ cin>>c[i]>>d[i]; if(a[i]*60+b[i]==c[p]*60+d[p]) cout<<a[i]<<":"<<b[i]<<" "; else if(a[i]*60+b[i]>c[p]*60+d[p]) cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; else cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; } } return 0; }
a.cc: In function 'int main()': a.cc:15:59: error: expected ']' before '}' token 15 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^ | ] a.cc:15:59: error: expected ';' before '}' token 15 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^ | ; a.cc:15:60: error: expected primary-expression before '<<' token 15 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^~ a.cc:16:17: error: 'else' without a previous 'if' 16 | else | ^~~~ a.cc:17:29: error: 'p' was not declared in this scope 17 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^ a.cc:17:41: error: expected ']' before '}' token 17 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^ | ] a.cc:17:42: error: expected primary-expression before '<<' token 17 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^~ a.cc:17:51: error: 'i' was not declared in this scope 17 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^ a.cc: At global scope: a.cc:19:5: error: expected declaration before '}' token 19 | } | ^ a.cc:20:5: error: expected unqualified-id before 'return' 20 | return 0; | ^~~~~~ a.cc:21:1: error: expected declaration before '}' token 21 | } | ^
s708234517
p00293
C++
#include<iostream> using namespace std; int main(){ int n,m,a[100],b[100],c[100],d[100]; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; cin>>m; for(int p=0;p<m;p++){ cin>>c[p]>>d[p]; if(a[i]*60+b[i]==c[p]*60+d[p]){ cout<<a[i]<<":"<<b[i]<<" "; } else{ if(a[i]*60+b[i]>c[p]*60+d[p]){ cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; } else{ cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; } } } } return 0; }
a.cc: In function 'int main()': a.cc:16:59: error: expected ']' before '}' token 16 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^ | ] a.cc:16:59: error: expected ';' before '}' token 16 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^ | ; a.cc:16:60: error: expected primary-expression before '<<' token 16 | cout<<a[i]<<":"<<b[i]<<" "<<c[p]<<":"<<d[p}<<" "; | ^~ a.cc:18:17: error: 'else' without a previous 'if' 18 | else{ | ^~~~ a.cc:19:41: error: expected ']' before '}' token 19 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^ | ] a.cc:19:41: error: expected ';' before '}' token 19 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^ | ; a.cc:19:42: error: expected primary-expression before '<<' token 19 | cout<<c[p]<<":"<<d[p}<<" "<<a[i]<<":"<<b[i]<<" "; | ^~ a.cc: At global scope: a.cc:23:5: error: expected declaration before '}' token 23 | } | ^ a.cc:24:5: error: expected unqualified-id before 'return' 24 | return 0; | ^~~~~~ a.cc:25:1: error: expected declaration before '}' token 25 | } | ^
s437853196
p00293
C++
#include<bits/stdc++.h> #include<algorithm> #include<vecotr> int main(){ int N,h[100],m[100]; int M,k[100],g[100]; scanf("%d",&N); for(int i=0;i<N;i++)scanf("%d %d",&h[i],&m[i]); scanf("%d",&M); for(int i=0;i<N;i++)scanf("%d %d",&k[i],&g[i]); vector<int> t; for(int i=0;i<N;i++){ t.push_back(h[i]*60+m[i]); t.push_back(k[i]*60+g[i]); } sort(t.begin(),t.end()); t.erase(unique(t.begin(),t.end()),t.end()); for(int i=0;i<t.size();i++) printf("%d:%d",t[i]/60,t[i]%60); }
a.cc:3:9: fatal error: vecotr: No such file or directory 3 | #include<vecotr> | ^~~~~~~~ compilation terminated.
s929711989
p00293
C++
#include<bits/stdc++.h> #include<algorithm> #include<vector> using namespace std; int main(){ int N,h[100],m[100]; int M,k[100],g[100]; scanf("%d",&N); for(int i=0;i<N;i++)scanf("%d %d",&h[i],&m[i]); scanf("%d",&M); for(int i=0;i<M;i++)scanf("%d %d",&k[i],&g[i]); vector<int> t; for(int i=0;i<N;i++) t.push_back(h[i]*60+m[i]); for(int i=0;i<M;i++) t.push_back(k[i]*60+g[i]); sort(t.begin(),t.end()); t.erase(unique(t.begin(),t.end()),t.end()); for(int i=0;i<t.size();i++) printf("%d:%02d ",t[i]/60,t[i]%60); print("\n"); }
a.cc: In function 'int main()': a.cc:19:9: error: 'print' was not declared in this scope; did you mean 'rint'? 19 | print("\n"); | ^~~~~ | rint
s139291003
p00293
C++
#include<iostream> #include<algorithm> using namespace std; int main() { int n,m,iimo1[101],iimo2[101],turu1[101],turu2[101],co1=0,co2=0; cin>>n; for(int i=0;i<n;i++)cin>>iimo1[i]>>iimo2[i]; cin>>m; for(int i=0;i<m;i++)cin>>turu1[i]>>turu2[i]; for(int i=0;n==co1&&m==co2;i++){ if(i!=0)cout<<" "; if(iimo1[co1]>turu1[co2]||n==co1){ cout<<turu1[co2]<<":"; if(turu2[co2]<10)cout<<"0"<<turu2[co2]; else cout<<turu2[co2]; co2++; } else if(iimo1[co1]<turu1[co2]||m==co2){ cout<<iimo1[co1]<<":"; if(iimo2[co1]<10)cout<<"0"<<iimo2[co1]; else cout<<iimo2[co1]; co1++; } else if(iimo2[co1]>turu2[co2]){ cout<<turu1[co2]<<":"; if(turu2[co2]<10)cout<<"0"<<turu2[co2]; else cout<<turu2[co2]; co2++; } else if(iimo2[co1]>turu2[co2]){{ cout<<iimo1[co1]<<":"; if(iimo2[co1]<10)cout<<"0"<<iimo2[co1]; else cout<<iimo2[co1]; co1++; } else{ cout<<iimo1[co1]<<":"; if(iimo2[co1]<10)cout<<"0"<<iimo2[co1]; else cout<<iimo2[co1]; co1++; co2++; } } cout<<endl; }
a.cc: In function 'int main()': a.cc:37:9: error: expected '}' before 'else' 37 | else{ | ^~~~ a.cc:31:39: note: to match this '{' 31 | else if(iimo2[co1]>turu2[co2]){{ | ^
s002286664
p00293
C++
2 0 0 21 0 3 7 30 21 0 23 7
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 0 0 21 0 | ^
s223297234
p00293
C++
#include <vector> #include <iostream> #include <algorithm> using namespace std; int main() { int n, m, p, q; vector<int> t; cin >> n; for(int i = 0; i < n; i++) { cin >> p >> q; t.push_back(p * 60 + q); } cin >> m; for(int i = 0; i < m; i++) { cin >> p >> q; t.push_back(p * 60 + q); } sort(t.begin(), t.end()); int count_ = 0; for(int i = 1; i < t.size(); i++) { if(t[i - 1] != t[i]) { if(count_) { printf(" "); } printf("%d:%02d", t[i - 1] / 60, t[i - 1] % 60); count++; } } printf("%d:%02d\n", t[n + m - 1] / 60, t[n + m - 1] % 60); return 0; }
a.cc: In function 'int main()': a.cc:26:18: error: no post-increment operator for type 26 | count++; | ^~
s328221770
p00293
C++
// 0298 #include <iostream> #include <vector> using namespace std; struct time{ int h; int m; }; void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ int i=0, j=0, check; while(i+j < bus1.size()+bus2.size()){ if(i == bus1.size()){ check = 2; }else if(j == bus2.size()){ check = 1; }else if(bus1[i].h > bus2[j].h){ check = 2; }else if(bus1[i].h < bus2[j].h){ check = 1; }else{ if(bus1[i].m > bus2[j].m) check = 2; else if(bus1[i].m < bus2[j].m) check = 1; else check = 0; } if(check == 1){ bus.push_back(bus1[i]); i++; }else if(check == 2){ bus.push_back(bus2[j]); j++; }else if(check == 0){ bus.push_back(bus1[i]); i++; j++; } } } int main(){ int N, M, hour, min; vector<time> bus1, bus2, bus; time t; cin>>N; for(int i=0;i<N;i++){ cin>>hour>>min; t.h = hour; t.m = min; bus1.push_back(t); } cin>>M; for(int j=0;j<M;j++){ cin>>hour>>min; t.h = hour; t.m = min; bus2.push_back(t); } merge(bus1, bus2, bus); for(int k=0;k<bus.size();k++){ if(k != 0) cout<<" "; cout<<bus[k].h<<":"; if(bus[k].m < 10) cout<<"0"; cout<<bus[k].m; } cout<<endl; return 0; }
a.cc:11:23: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:23: note: expected a type, got 'time' a.cc:11:23: error: template argument 2 is invalid a.cc:11:42: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:42: note: expected a type, got 'time' a.cc:11:42: error: template argument 2 is invalid a.cc:11:61: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:61: note: expected a type, got 'time' a.cc:11:61: error: template argument 2 is invalid a.cc: In function 'void merge(int, int, int&)': a.cc:13:26: error: request for member 'size' in 'bus1', which is of non-class type 'int' 13 | while(i+j < bus1.size()+bus2.size()){ | ^~~~ a.cc:13:38: error: request for member 'size' in 'bus2', which is of non-class type 'int' 13 | while(i+j < bus1.size()+bus2.size()){ | ^~~~ a.cc:14:30: error: request for member 'size' in 'bus1', which is of non-class type 'int' 14 | if(i == bus1.size()){ | ^~~~ a.cc:16:36: error: request for member 'size' in 'bus2', which is of non-class type 'int' 16 | }else if(j == bus2.size()){ | ^~~~ a.cc:18:30: error: invalid types 'int[int]' for array subscript 18 | }else if(bus1[i].h > bus2[j].h){ | ^ a.cc:18:42: error: invalid types 'int[int]' for array subscript 18 | }else if(bus1[i].h > bus2[j].h){ | ^ a.cc:20:30: error: invalid types 'int[int]' for array subscript 20 | }else if(bus1[i].h < bus2[j].h){ | ^ a.cc:20:42: error: invalid types 'int[int]' for array subscript 20 | }else if(bus1[i].h < bus2[j].h){ | ^ a.cc:23:32: error: invalid types 'int[int]' for array subscript 23 | if(bus1[i].m > bus2[j].m) | ^ a.cc:23:44: error: invalid types 'int[int]' for array subscript 23 | if(bus1[i].m > bus2[j].m) | ^ a.cc:25:37: error: invalid types 'int[int]' for array subscript 25 | else if(bus1[i].m < bus2[j].m) | ^ a.cc:25:49: error: invalid types 'int[int]' for array subscript 25 | else if(bus1[i].m < bus2[j].m) | ^ a.cc:32:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 32 | bus.push_back(bus1[i]); | ^~~~~~~~~ a.cc:32:43: error: invalid types 'int[int]' for array subscript 32 | bus.push_back(bus1[i]); | ^ a.cc:35:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 35 | bus.push_back(bus2[j]); | ^~~~~~~~~ a.cc:35:43: error: invalid types 'int[int]' for array subscript 35 | bus.push_back(bus2[j]); | ^ a.cc:38:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 38 | bus.push_back(bus1[i]); | ^~~~~~~~~ a.cc:38:43: error: invalid types 'int[int]' for array subscript 38 | bus.push_back(bus1[i]); | ^ a.cc: In function 'int main()': a.cc:47:20: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 47 | vector<time> bus1, bus2, bus; | ^ a.cc:47:20: note: expected a type, got 'time' a.cc:47:20: error: template argument 2 is invalid a.cc:48:13: error: expected ';' before 't' 48 | time t; | ^~ | ; a.cc:53:17: error: 't' was not declared in this scope 53 | t.h = hour; | ^ a.cc:55:22: error: request for member 'push_back' in 'bus1', which is of non-class type 'int' 55 | bus1.push_back(t); | ^~~~~~~~~ a.cc:61:17: error: 't' was not declared in this scope 61 | t.h = hour; | ^ a.cc:63:22: error: request for member 'push_back' in 'bus2', which is of non-class type 'int' 63 | bus2.push_back(t); | ^~~~~~~~~ a.cc:68:27: error: request for member 'size' in 'bus', which is of non-class type 'int' 68 | for(int k=0;k<bus.size();k++){ | ^~~~ a.cc:71:26: error: invalid types 'int[int]' for array subscript 71 | cout<<bus[k].h<<":"; | ^ a.cc:73:23: error: invalid types 'int[int]' for array subscript 73 | if(bus[k].m < 10) | ^ a.cc:75:26: error: invalid types 'int[int]' for array subscript 75 | cout<<bus[k].m; | ^
s132880617
p00293
C++
// 0298 #include <iostream> #include <vector> using namespace std; struct time{ int h; int m; }; void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ int i=0, j=0, check; while(i+j < bus1.size()+bus2.size()){ if(i == bus1.size()){ check = 2; }else if(j == bus2.size()){ check = 1; }else if(bus1[i].h > bus2[j].h){ check = 2; }else if(bus1[i].h < bus2[j].h){ check = 1; }else{ if(bus1[i].m > bus2[j].m) check = 2; else if(bus1[i].m < bus2[j].m) check = 1; else check = 0; } time t; if(check == 1){ t.h = bus1[i].h; t.m = bus1[i].m; bus.push_back(t); i++; }else if(check == 2){ t.h = bus2[j].h; t.m = bus2[j].m; bus.push_back(t); j++; }else if(check == 0){ t.h = bus1[i].h; t.m = bus1[i].m; bus.push_back(t); i++; j++; } } } int main(){ int N, M, hour, min; vector<time> bus1, bus2, bus; time t; cin>>N; for(int i=0;i<N;i++){ cin>>hour>>min; t.h = hour; t.m = min; bus1.push_back(t); } cin>>M; for(int j=0;j<M;j++){ cin>>hour>>min; t.h = hour; t.m = min; bus2.push_back(t); } merge(bus1, bus2, bus); for(int k=0;k<bus.size();k++){ if(k != 0) cout<<" "; cout<<bus[k].h<<":"; if(bus[k].m < 10) cout<<"0"; cout<<bus[k].m; } cout<<endl; return 0; }
a.cc:11:23: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:23: note: expected a type, got 'time' a.cc:11:23: error: template argument 2 is invalid a.cc:11:42: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:42: note: expected a type, got 'time' a.cc:11:42: error: template argument 2 is invalid a.cc:11:61: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 11 | void merge(vector<time> bus1, vector<time> bus2, vector<time> &bus){ | ^ a.cc:11:61: note: expected a type, got 'time' a.cc:11:61: error: template argument 2 is invalid a.cc: In function 'void merge(int, int, int&)': a.cc:13:26: error: request for member 'size' in 'bus1', which is of non-class type 'int' 13 | while(i+j < bus1.size()+bus2.size()){ | ^~~~ a.cc:13:38: error: request for member 'size' in 'bus2', which is of non-class type 'int' 13 | while(i+j < bus1.size()+bus2.size()){ | ^~~~ a.cc:14:30: error: request for member 'size' in 'bus1', which is of non-class type 'int' 14 | if(i == bus1.size()){ | ^~~~ a.cc:16:36: error: request for member 'size' in 'bus2', which is of non-class type 'int' 16 | }else if(j == bus2.size()){ | ^~~~ a.cc:18:30: error: invalid types 'int[int]' for array subscript 18 | }else if(bus1[i].h > bus2[j].h){ | ^ a.cc:18:42: error: invalid types 'int[int]' for array subscript 18 | }else if(bus1[i].h > bus2[j].h){ | ^ a.cc:20:30: error: invalid types 'int[int]' for array subscript 20 | }else if(bus1[i].h < bus2[j].h){ | ^ a.cc:20:42: error: invalid types 'int[int]' for array subscript 20 | }else if(bus1[i].h < bus2[j].h){ | ^ a.cc:23:32: error: invalid types 'int[int]' for array subscript 23 | if(bus1[i].m > bus2[j].m) | ^ a.cc:23:44: error: invalid types 'int[int]' for array subscript 23 | if(bus1[i].m > bus2[j].m) | ^ a.cc:25:37: error: invalid types 'int[int]' for array subscript 25 | else if(bus1[i].m < bus2[j].m) | ^ a.cc:25:49: error: invalid types 'int[int]' for array subscript 25 | else if(bus1[i].m < bus2[j].m) | ^ a.cc:31:21: error: expected ';' before 't' 31 | time t; | ^~ | ; a.cc:33:25: error: 't' was not declared in this scope 33 | t.h = bus1[i].h; | ^ a.cc:33:35: error: invalid types 'int[int]' for array subscript 33 | t.h = bus1[i].h; | ^ a.cc:34:35: error: invalid types 'int[int]' for array subscript 34 | t.m = bus1[i].m; | ^ a.cc:35:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 35 | bus.push_back(t); | ^~~~~~~~~ a.cc:38:25: error: 't' was not declared in this scope 38 | t.h = bus2[j].h; | ^ a.cc:38:35: error: invalid types 'int[int]' for array subscript 38 | t.h = bus2[j].h; | ^ a.cc:39:35: error: invalid types 'int[int]' for array subscript 39 | t.m = bus2[j].m; | ^ a.cc:40:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 40 | bus.push_back(t); | ^~~~~~~~~ a.cc:43:25: error: 't' was not declared in this scope 43 | t.h = bus1[i].h; | ^ a.cc:43:35: error: invalid types 'int[int]' for array subscript 43 | t.h = bus1[i].h; | ^ a.cc:44:35: error: invalid types 'int[int]' for array subscript 44 | t.m = bus1[i].m; | ^ a.cc:45:29: error: request for member 'push_back' in 'bus', which is of non-class type 'int' 45 | bus.push_back(t); | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:54:20: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector' 54 | vector<time> bus1, bus2, bus; | ^ a.cc:54:20: note: expected a type, got 'time' a.cc:54:20: error: template argument 2 is invalid a.cc:55:13: error: expected ';' before 't' 55 | time t; | ^~ | ; a.cc:60:17: error: 't' was not declared in this scope 60 | t.h = hour; | ^ a.cc:62:22: error: request for member 'push_back' in 'bus1', which is of non-class type 'int' 62 | bus1.push_back(t); | ^~~~~~~~~ a.cc:68:17: error: 't' was not declared in this scope 68 | t.h = hour; | ^ a.cc:70:22: error: request for member 'push_back' in 'bus2', which is of non-class type 'int' 70 | bus2.push_back(t); | ^~~~~~~~~ a.cc:75:27: error: request for member 'size' in 'bus', which is of non-class type 'int' 75 | for(int k=0;k<bus.size();k++){ | ^~~~ a.cc:78:26: error: invalid types 'int[int]' for array subscript 78 | cout<<bus[k].h<<":"; | ^ a.cc:80:23: error: invalid types 'int[int]' for array subscript 80 | if(bus[k].m < 10) | ^ a.cc:82:26: error: invalid types 'int[int]' for array subscript 82 | cout<<bus[k].m; | ^
s240053530
p00293
C++
#include<iostream> #include<queue> #include<cstdio> using namespace std; int main(){ int n=0; int i=0; priority_queue<int,vector<int>,greater<int> > q1; int a=0; int b=0; int j=0; int m=-1; for(i=0;i<2;i++){ cin>>n; for(j=0;j<n;j++){ cin>>a>>b; a=a*60+b; q1.push(a); } } while(q1.empty()==false){ a=q1.top(); q1.pop(); if(a==m)continue; m=a; b=a%60; a/=60; printf("%d:%2d",a,b) if(!q1.empty())cout<<" "; } cout<<endl; }
a.cc: In function 'int main()': a.cc:28:37: error: expected ';' before 'if' 28 | printf("%d:%2d",a,b) | ^ | ; 29 | if(!q1.empty())cout<<" "; | ~~
s920901977
p00293
C++
#include <iostream> using namespace std; int main(){ int N,M; cin >> N; int h[N],m[N]; for(int i=0; i<N; i++) cin >>h[i]>>m[i]; cin >> M; int k[M],g[M]; for(int i=0; i<M; i++) cin >>k[i]>>g[i]; int Nc=0,Mc=0,same=0; for(int i=0; i<N+M; i++){ if((h[Nc]<k[Mc]||(h[Nc]==k[Mc]&&m[Nc]<g[Nc]))||Mc==M){//飯盛のが早いか鶴賀城がもうない cout << h[Nc]<<':'; if(m[Nc]<10) cout <<'0'; cout <<m[Nc]; Nc++; if(Nc+Mc=N+M) cout<<' '; else cout <<endl; } else if((h[Nc]>k[Mc]||(h[Nc]==k[Mc]&&m[Nc]>g[Nc]))||Nc==N){ cout << k[Mc]<<':'; if(g[Mc]<10) cout <<'0'; cout <<g[Mc]; Mc++; if(Nc+Mc=N+M) cout<<' '; else cout <<endl; } else if (h[Nc]==k[Mc]&&m[Nc]==g[Mc]){ cout << h[Nc]<<':'; if(m[Nc]<10) cout <<'0'; cout <<m[Nc]; Nc++; Mc++; i++; if(Nc+Mc!=N+M) cout<<' '; else cout <<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:25:30: error: lvalue required as left operand of assignment 25 | if(Nc+Mc=N+M) | ~~^~~ a.cc:39:30: error: lvalue required as left operand of assignment 39 | if(Nc+Mc=N+M) | ~~^~~
s294967762
p00293
C++
#include<iostream> using namespace std; int main(){ int N,M; int h[],m[],k[],g[],a[],b[]; cin>>N; for(int i=0;i<N;i++){ cin>>h[i]<<m[i]; a[i]=(h[i]*60)+m[i]; } cin>>M; for(int j=0;j<M;j++){ cin>>k[j]>>g[j]; b[j]=(k[j]*60)+g[j]; } return 0; }
a.cc: In function 'int main()': a.cc:6:13: error: storage size of 'h' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^ a.cc:6:17: error: storage size of 'm' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^ a.cc:6:21: error: storage size of 'k' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^ a.cc:6:25: error: storage size of 'g' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^ a.cc:6:29: error: storage size of 'a' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^ a.cc:6:33: error: storage size of 'b' isn't known 6 | int h[],m[],k[],g[],a[],b[]; | ^
s253056661
p00293
C++
#include<iostream> using namespace std; int main (){ int N,M,L; int tmp1,tmp2; int h[200]; int m[200]; int k[200]; int g[200]; int c=100,d=100; for(int i=0;i<c;i++){ cin>>N>>h[i]>>m[i]; if(c!=N) c=N; } for(int j=0;j<d;j++){ cin>>M>>k[j]>>g[j]; if(d!=M) d=M; } int T[M+N]; int t[M+N]; for(int x=0;x<M+1;x++){ h[N+x+1]=k[x]; m[N+x+1]=g[x]; } for(int l=0;l<M+N;l++){ if(h[l]>h[l+1]){ tmp1=h[l]; h[l]=h[l+1]; h[l+1]=tmp1; tmp2=m[l]; m[l]=m[l+1]; m[l+1]=tmp2; }else if(h[l]==h[l]){ if(m[l]>m[l+1]){ tmp2=m[l]; m[l]=m[l+1]; m[l+1]=tmp2; } } } for(int y=0;i<M+N;y++){ cout<<h[y]<<":"; if(m[y]=0){ cout<<00; else{ cout<<m[y]; } cout<<' '; } return 0; }
a.cc: In function 'int main()': a.cc:42:21: error: 'i' was not declared in this scope 42 | for(int y=0;i<M+N;y++){ | ^ a.cc:46:18: error: expected '}' before 'else' 46 | else{ | ^~~~ a.cc:44:27: note: to match this '{' 44 | if(m[y]=0){ | ^
s334041038
p00293
C++
#include<iostream> using namespace std; int main (){ int N,M,L; int tmp1,tmp2; int h[200]; int m[200]; int k[200]; int g[200]; int c=100,d=100; for(int i=0;i<c;i++){ cin>>N>>h[i]>>m[i]; if(c!==N) c=N; } for(int j=0;j<d;j++){ cin>>M>>k[j]>>g[j]; if(d!==M) d=M; } for(int x=0;x<M;x++){ h[N+x+1]=k[x]; m[N+x+1]=g[x]; } for(int l=0;l<M+N;l++){ if(h[l]>h[l+1]){ tmp1=h[l]; h[l]=h[l+1]; h[l+1]=tmp1; tmp2=m[l]; m[l]=m[l+1]; m[l+1]=tmp2; }else if(h[l]==h[l]){ if(m[l]>m[l+1]){ tmp2=m[l]; m[l]=m[l+1]; m[l+1]=tmp2; } } } for(int y=0;y<M+N;y++){ cout<<h[y]<<":"; if(m[y]==0){ cout<<00; }else{ cout<<m[y]; } cout<<' '; } return 0; }
a.cc: In function 'int main()': a.cc:14:23: error: expected primary-expression before '=' token 14 | if(c!==N) c=N; | ^ a.cc:18:23: error: expected primary-expression before '=' token 18 | if(d!==M) d=M; | ^
s089651285
p00293
C++
#include <iostream> using namespace std; void BubbleSort(int S[], int N) { bool flg; do{ flg = false; for(int i=0; i<N-1; i++){ if(S[i]>S[i+1]){ int tmp = S[i]; S[i] = S[i+1]; S[i+1] = tmp; flg = true; } } }while(flg); } int main(){ int N,h[N],m[N],min[N]; cin >> N; for(int i=0;i<N;i++){ cin >> h[i] >> m[i]; min[i]=h[i]*60+m[i]; } int M,k[M],g[M],min[M]; cin >> M; for(int i=0;i<M;i++){ cin >> k[i] >> g[i]; min[i+N]=k[i]*60+k[i]; } int L=N+M; BubbleSort(min,L) int hour[L],minute[L]; for(int i=0;i<L;i++){ hour[i]=min[i]/60; minute[i]=min[i]%60; cout << hour[i]; if(minute[i]<10){ cout << "0" << minute[i] << endl; }else{ cout << minute[i] <<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:35:19: error: conflicting declaration 'int min [M]' 35 | int M,k[M],g[M],min[M]; | ^~~ a.cc:26:19: note: previous declaration as 'int min [N]' 26 | int N,h[N],m[N],min[N]; | ^~~ a.cc:44:20: error: expected ';' before 'int' 44 | BubbleSort(min,L) | ^ | ; 45 | 46 | int hour[L],minute[L]; | ~~~ a.cc:48:7: error: 'hour' was not declared in this scope 48 | hour[i]=min[i]/60; | ^~~~ a.cc:49:7: error: 'minute' was not declared in this scope 49 | minute[i]=min[i]%60; | ^~~~~~
s735726615
p00293
C++
#include <iostream> using namespace std; int main(){ int N=0,M=0; cin>>N; int h[N],m[N]; for(int i=0; i<N; i++) cin>>h[i]>>m[i]; cin>>M; int k[M],g[M],all[M+N]; for(int i=0; i<M; i++) cin>>k[i]>>g[i]; for(int i=0; i<M+N; i++){ if(i<N) all[i]=h[i]*60+m[i]; else all[i]=k[i-N]*60+g[i-N]; } for(int i=0; i<M+N-1; i++){ for(int j=M+N-1; j>i; j--){ int tmp=0; if(all[j]<all[j-1]){ tmp=all[j-1]; all[j-1]=all[j]; all[j]=tmp; } } } for(int i=0; i<M+N-1; i++){ if(all[i]%60<10) cout<<all[i]/60<<':'<<0<<all[i]%60<<' '; else cout<<all[i]/60<<':'<<all[i]%60<<' '; } if(all[i]%60<10) cout<<all[i]/60<<':'<<0<<all[i]%60; else cout<<all[i]/60<<':'<<all[i]%60; cout<<endl; return 0; }
a.cc: In function 'int main()': a.cc:35:9: error: 'i' was not declared in this scope 35 | if(all[i]%60<10) cout<<all[i]/60<<':'<<0<<all[i]%60; | ^
s600850284
p00293
C++
#include < cstdio > #include <algorithm> main () { int nBus = 0; int aBus [2*23*59]; int n, h, m ; for ( int k=0; k<2; ++k ) { scanf ("%d", &n); for ( int i =0; i <n; ++ i ) { scanf ("%d %d", &h, &m); aBus [ nBus+i ] = h*100 + m; } nBus += n; } std ::sort( aBus , aBus+nBus ); nBus = std ::unique( aBus , aBus+nBus ) - aBus ; for ( int i =0; i < nBus ; ++ i ) printf ("%d:%02d%c", aBus [ i ]/100, aBus [ i ]%100, (i+1) == nBus ? ' \ n' : ' '); }
a.cc:1:11: error: missing terminating > character 1 | #include < | ^ a.cc:1:10: error: empty filename in #include 1 | #include < | ^ a.cc:78:3: warning: missing terminating ' character 78 | ? ' | ^ a.cc:78:3: error: missing terminating ' character a.cc:80:2: warning: multi-character character constant [-Wmultichar] 80 | n' : ' '); | ^~~~~ a.cc:80:8: warning: missing terminating ' character 80 | n' : ' '); | ^ a.cc:80:8: error: missing terminating ' character 80 | n' : ' '); | ^~~ a.cc:2:1: error: 'cstdio' does not name a type 2 | cstdio | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:4: /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> |
s671113812
p00293
C++
#include <iostream> using namespace std; struct bus{ unsigned h; unsigned m; }; int main(){ unsigned N=0; cin >> N; bus bus[N+100]; for(unsigned i=0;i<N;i++){ cin >> bus[i].h >> bus[i].m; } unsigned M=0; cin >> M; for(unsigned j=0;j<M;j++){ cin >> bus[N+j].h >> bus[N+j].m; } for(unsigned k=0;k<N+M;k++){ for(unsigned l=N+M;l>k;l--){ unsigned a=0,b=0; if(bus[l-1].h>bus[l].h){ a=bus[l].h; b=bus[l].m; bus[l].h=bus[l-1].h; bus[l].m=bus[l-1].m; bus[l-1].h=a; bus[l-1].m=b; } } } for(unsigned k=0;k<N+M;k++){ for(unsigned l=N+M;l>k;l--){ unsigned a=0; if((bus[l-1].m>bus[l].m)&&(bus[l-1].h==BUS[l].h)){ b=bus[l].m; bus[l].m=bus[l-1].m; bus[l-1].m=b; } } } int s=0; for(unsigned m=0;m<N+M;m++){ for(int n=0;n<N+M;n++){ if(bus[m].h==bus[m+1].h){ bus[m+n].h=bus[m+n+1].h; bus[m+n].m=bus[m+n+1].m; s++; } } } if(s>0){ for(unsigned o=0;o<N+M-1;o++){ if(o<N+M-2){ cout << bus[o].h << ":"; if(bus[o].m<10){ cout << "0" << bus[o].m << ' '; }else{ cout << bus[o].m << ' '; } }else{ cout << bus[o].h << ":"; if(bus[o].m<10){ cout << "0" << bus[o].m << endl; }else{ cout << bus[o].m << endl; } } } } if(s==0){ for(unsigned p=0;p<N+M;p++){ if(p<N+M-1){ cout << bus[p].h << ":"; if(bus[p].m<10){ cout << "0" << bus[p].m << ' '; }else{ cout << bus[p].m << ' '; } }else{ cout << bus[p].h << ":"; if(bus[p].m<10){ cout << "0" << bus[p].m << endl; }else{ cout << bus[p].m << endl; } } } } return 0; }
a.cc: In function 'int main()': a.cc:37:47: error: 'BUS' was not declared in this scope 37 | if((bus[l-1].m>bus[l].m)&&(bus[l-1].h==BUS[l].h)){ | ^~~ a.cc:39:12: error: 'b' was not declared in this scope 39 | b=bus[l].m; | ^
s588899905
p00293
C++
#include<stdio.h> int main() { int N,M,sum, h[24], m[60],a,b; scanf_s("%d", &N); for (int i = 0; i < N; i++) { scanf_s("%d %d", &h[i], &m[i]); } scanf_s("%d", &M); sum = N + M; for (int i = N; i < sum; i++) { scanf_s("%d %d", &h[i], &m[i]); } for (int i = 0; i < sum; i++) { for (int j = i; j < sum; j++) { if (h[i] > h[j]) { a = h[i]; h[i] = h[j]; h[j] = a; b = m[i]; m[i] = m[j]; m[j] = b; } if (m[i] == m[j]) { if (m[i] > m[j]) { b= m[i]; m[i] = m[j]; m[j] = b; } } } } for (int i = 0; i < sum; i++) { printf("%d", h[i]); printf(":"); if (m[i] < 10) { printf("0"); } printf("%d\n", m[i]); } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | scanf_s("%d", &N); | ^~~~~~~ | scanf
s006826171
p00293
C++
#include <iostream> #include <vector> #include <iomanip> using namespace std; int N, M; int main() { vector<int> out; cin >> N; for (int i=0; i<N; i++) { int h, m; cin >> h >> m; out.push_back(h*60 + m); } cin >> M; for (int i=0; i<M; i++) { int h, m; cin >> h >> m; out.push_back(h*60 + m); } sort(out.begin(), out.end()); out.erase( unique( out.begin(), out.end() ), out.end() ); bool first = true; for (auto x : out) { if (!first) cout << " "; first = false; cout << setfill('0') << setw(2) << x/60 << ":" << setfill('0') << setw(2) << x%60; } cout << "\n"; return 0; }
a.cc: In function 'int main()': a.cc:23:3: error: 'sort' was not declared in this scope; did you mean 'short'? 23 | sort(out.begin(), out.end()); | ^~~~ | short a.cc:24:14: error: 'unique' was not declared in this scope 24 | out.erase( unique( out.begin(), out.end() ), out.end() ); | ^~~~~~
s979510370
p00293
C++
#include<iostream> using namespace std; int main() { int N, M, a, b, c, d, f, x, y, Z, w; w = 0; cin >> N; int*h = new int[N]; int*m = new int[N]; for (a = 0; a < N; a++) { cin >> h[a] >> m[a]; } cin >> M; int*k = new int[M]; int*g = new int[M]; for (b = 0; b < M; b++) { cin >> k[b] >> g[b]; } for (a = 0; a < N; a++) { for (b = 0; b < M; b++) { if (h[a] > k[b]) { x = h[a]; h[a] = k[b]; k[b] = x; y = m[a]; m[a] = g[b]; g[b] = y; } else if (h[a] == k[b]) { if (m[a] > g[b]) { x = h[a]; h[a] = k[b]; k[b] = x; y = m[a]; m[a] = g[b]; g[b] = y; } } } } Z = N + M; int*q = new int[Z]; int*r = new int[Z]; for (a = 0; a < N; a++) { q[a] = h[a]; r[a] = m[a]; } for (b = 0; b < M; b++) { q[b+N] = k[b]; r[b+N] = g[b]; } for (c = 0; c < Z; c++) { for (d = c+1; d < Z; d++) { if (q[c] == q[d] && r[c] == r[d]) { for (f = d; f < Z; f++) { q[f] = q[f + 1]; r[f] = r[f + 1]; } w = w + 1; } } } for (c = 0; c < Z-w; c++) { cout << q[c] << ":"; if (r[c] < 10) { cout << 0; } cout << r[c] ; if (c < Z - w - 1) { cout << " "; } } return 0;
a.cc: In function 'int main()': a.cc:77:18: error: expected '}' at end of input 77 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s145792592
p00293
C++
struct Time { int hour; int minute; }; vector<Time> get_input() { int n; cin >> n; vector<Time> ninput(n); for (int i = 0; i < n; i++) { cin >> ninput[i].hour; cin >> ninput[i].minute; } return ninput; } bool operator<(Time a, Time b) { if (a.hour < b.hour) { return true; } else if (a.hour > b.hour) { return false; } else { if (a.minute < b.minute) { return true; } else { return false; } } } void print_time(Time t) { printf("%d:%02d", t.hour, t.minute); } int main() { vector<Time> ninput = get_input(); vector<Time> minput = get_input(); copy(minput.begin(), minput.end(), back_inserter(ninput)); sort(ninput.begin(), ninput.end()); print_time(ninput[0]); for (int i = 1; i < ninput.size(); i++) { cout << " "; print_time(ninput[i]); } cout << endl; }
a.cc:7:1: error: 'vector' does not name a type 7 | vector<Time> get_input() { | ^~~~~~ a.cc: In function 'void print_time(Time)': a.cc:33:9: error: 'printf' was not declared in this scope 33 | printf("%d:%02d", t.hour, t.minute); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | a.cc: In function 'int main()': a.cc:37:9: error: 'vector' was not declared in this scope 37 | vector<Time> ninput = get_input(); | ^~~~~~ a.cc:37:20: error: expected primary-expression before '>' token 37 | vector<Time> ninput = get_input(); | ^ a.cc:37:22: error: 'ninput' was not declared in this scope 37 | vector<Time> ninput = get_input(); | ^~~~~~ a.cc:37:31: error: 'get_input' was not declared in this scope 37 | vector<Time> ninput = get_input(); | ^~~~~~~~~ a.cc:38:20: error: expected primary-expression before '>' token 38 | vector<Time> minput = get_input(); | ^ a.cc:38:22: error: 'minput' was not declared in this scope 38 | vector<Time> minput = get_input(); | ^~~~~~ a.cc:39:44: error: 'back_inserter' was not declared in this scope 39 | copy(minput.begin(), minput.end(), back_inserter(ninput)); | ^~~~~~~~~~~~~ a.cc:39:9: error: 'copy' was not declared in this scope 39 | copy(minput.begin(), minput.end(), back_inserter(ninput)); | ^~~~ a.cc:40:9: error: 'sort' was not declared in this scope; did you mean 'short'? 40 | sort(ninput.begin(), ninput.end()); | ^~~~ | short a.cc:43:17: error: 'cout' was not declared in this scope 43 | cout << " "; | ^~~~ a.cc:46:9: error: 'cout' was not declared in this scope 46 | cout << endl; | ^~~~ a.cc:46:17: error: 'endl' was not declared in this scope 46 | cout << endl; | ^~~~
s392384711
p00293
C++
#include<stdio.h> int main(void) { int n,m,h[200],temp,k,cnt,g,i,j; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d",&k,&g); h[i]=k*60+g; } scanf("%d",&m); for(i<n+m;i++){ scanf("%d %d",&k,&g); h[i]=k*60+g; } cnt=m+n; for(i=0;i<n+m-1;i++){ for(j=0;j<n+m;j++){ if(h[i]>h[j]){ temp=h[i]; h[i]=h[j]; h[j]=temp; } } } for(i=0;i<n+m-1;i++){ if(h[i]==h[i+1]){ i++; cnt-=1; } } for(i=0;i<cnt-1;i++){ printf("%d:%02d",h[i]/60,h[i]%60); } printf("%d:%02d",h[cnt-1]/60,h[i-1]%60); return 0; }
a.cc: In function 'int main()': a.cc:11:22: error: expected ';' before ')' token 11 | for(i<n+m;i++){ | ^ | ;
s089628472
p00293
C++
#include <iostream> using namespace std; int main(){ int N1; int h[101]; int m[101]; cin>>N1; for(int i=0;i<N1;i++) cin>>h[i]>>m[i]; h[N1]=24; m[N1]=0; int N2; int k[101]; int g[101]; cin>>N2; for(int i=0;i<N2;i++) cin>>k[i]>>g[i]; k[N2]=24; g[N2]=0; for(int i=0,j=0;i<N1 || j<N2;){ if(h[i]==k[j]&& m[i]==g[j]){ cout<<h[i]<<':'<<m[i]/10<<m[i]%10; i++; j++; } else if(h[i]<k[j]||(h[i]==k[j] && m[i]<g[j])){ cout<<h[i]<<':'<<m[i]/10<<m[i]%10; i++; } else{ cout<<k[j]<<':'<<g[j]/10<<g[j]%10; j++; } /*if(i==N1&&j==N2) cout<<endl;*/ else cout<<' '; } return 0; }
a.cc: In function 'int main()': a.cc:33:17: error: 'else' without a previous 'if' 33 | else | ^~~~
s644489492
p00293
C++
#include <iostream> using namespace std; int main(){ int N1; int h[101]; int m[101]; cin>>N1; for(int i=0;i<N1;i++) cin>>h[i]>>m[i]; h[N1]=24; m[N1]=0; int N2; int k[101]; int g[101]; cin>>N2; for(int i=0;i<N2;i++) cin>>k[i]>>g[i]; k[N2]=24; g[N2]=0; for(int i=0,j=0;i<N1 || j<N2;){ if(h[i]==k[j]&& m[i]==g[j]){ cout<<h[i]<<':'<<m[i]/10<<m[i]%10; i++; j++; } else if(h[i]<k[j]||(h[i]==k[j] && m[i]<g[j])){ cout<<h[i]<<':'<<m[i]/10<<m[i]%10; i++; } else{ cout<<k[j]<<':'<<g[j]/10<<g[j]%10; j++; } else cout<<' '; } return 0; }
a.cc: In function 'int main()': a.cc:32:17: error: 'else' without a previous 'if' 32 | else | ^~~~
s568607951
p00293
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ int z[24][60],n,a,b,k=0; for(int i=0;i<24;i++)for(int j=0;j<60;j++)z[i][j]=0; for(int w=0;w<2;w++){ cin>>n; for(int i=0;i<n;i++){ cin>>a>>b; z[a][b]=1; } } for(int i=0;i<24;i++){ for(int j=0;j<60;j++){ if(z[i][j]==1){ if(k)cout<<" "; if(j<10){cout<<i<<":"<<"0"<<j;k++;} else {cout<<i<<":"<<j;k++;} } } } cout<<endl; return 0; } v
a.cc:26:1: error: 'v' does not name a type 26 | v | ^
s096606355
p00293
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <iostream> #include <vector> #include <string> #include <sstream> #include <algorithm> #include <utility> #include <set> #include <map> #include <stack> #include <queue> #include <deque> #include <functional> using namespace std; #define fst first #define scd second #define PB push_back #define MP make_pair #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define omajinai ios::sync_with_stdio(false);cin.tie(0) #define rep(i,x) for(int i=0;i<(int)(x);++i) #define rep1(i,x) for(int i=1;i<=(int)(x);++i) typedef long long ll; typedef long double ld; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> pii; typedef vector<pii> vpii; template<typename T>T& max(T&a,T&b){if(a>=b)return a;return b;} template<typename T>T& min(T&a,T&b){if(a<b)return a;return b;} template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;} template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;} template<typename T>T get(){T a;cin>>a;return a;} template<typename T>T rev(T a){reverse(all(a));return a;} template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;} const int inf = 1e9; const ll linf = 3e18; const double eps = 1e-9; string conv(int a, int b) { stringstream ss; ss << a; ss << ":"; if (b < 10) ss << 0; ss << b; return ss.str(); } struct data { int v; string s; data(){} data(int v, string s):v(v),s(s){} bool operator<(data d) const { return v < d.v; } }; map<string, s> A; signed main() { int N; cin >> N; vector<data> vs; rep(i, N) { int a, b; cin >> a >> b; string res = conv(a, b); A[res] = true; vs.push_back(data(a * 100 + b, res)); } int M; cin >> M; rep(i, M) { int a, b; cin >> a >> b; string res = conv(a, b); if (A.find(res) != A.end()) continue; vs.push_back(data(a * 100 + b, res)); } sort(all(vs)); rep(i, vs.size()) { if (i) cout << ' '; cout << vs[i].s; } cout << endl; }
a.cc:71:13: error: 's' was not declared in this scope 71 | map<string, s> A; | ^ a.cc:71:14: error: template argument 2 is invalid 71 | map<string, s> A; | ^ a.cc:71:14: error: template argument 4 is invalid a.cc: In function 'int main()': a.cc:77:16: error: template argument 1 is invalid 77 | vector<data> vs; | ^ a.cc:77:16: error: template argument 2 is invalid a.cc:82:10: error: no match for 'operator[]' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'}) 82 | A[res] = true; | ^ a.cc:83:12: error: request for member 'push_back' in 'vs', which is of non-class type 'int' 83 | vs.push_back(data(a * 100 + b, res)); | ^~~~~~~~~ a.cc:83:22: error: reference to 'data' is ambiguous 83 | vs.push_back(data(a * 100 + b, res)); | ^~~~ 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:6: /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:61:8: note: 'struct data' 61 | struct data { | ^~~~ a.cc:90:15: error: request for member 'find' in 'A', which is of non-class type 'int' 90 | if (A.find(res) != A.end()) continue; | ^~~~ a.cc:90:30: error: request for member 'end' in 'A', which is of non-class type 'int' 90 | if (A.find(res) != A.end()) continue; | ^~~ a.cc:91:12: error: request for member 'push_back' in 'vs', which is of non-class type 'int' 91 | vs.push_back(data(a * 100 + b, res)); | ^~~~~~~~~ a.cc:91:22: error: reference to 'data' is ambiguous 91 | vs.push_back(data(a * 100 + b, res)); | ^~~~ /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:61:8: note: 'struct data' 61 | struct data { | ^~~~ a.cc:25:18: error: request for member 'begin' in 'vs', which is of non-class type 'int' 25 | #define all(a) a.begin(),a.end() | ^~~~~ a.cc:94:10: note: in expansion of macro 'all' 94 | sort(all(vs)); | ^~~ a.cc:25:28: error: request for member 'end' in 'vs', which is of non-class type 'int' 25 | #define all(a) a.begin(),a.end() | ^~~ a.cc:94:10: note: in expansion of macro 'all' 94 | sort(all(vs)); | ^~~ a.cc:96:15: error: request for member 'size' in 'vs', which is of non-class type 'int' 96 | rep(i, vs.size()) { | ^~~~ a.cc:28:38: note: in definition of macro 'rep' 28 | #define rep(i,x) for(int i=0;i<(int)(x);++i) | ^ a.cc:98:19: error: invalid types 'int[int]' for array subscript 98 | cout << vs[i].s; | ^
s566599045
p00293
C++
#include <iostream> #include <stdio.h> using namespace std; int main(){ int n; cin >> n; int hm[100][2]; for(int i = 0; i < n; i++){ cin >> hm[i][0]; cin >> hm[i][1]; } int m; cin >> m; int kg[100][2]; for(int i = 0; i < m; i++){ cin >> kg[i][0]; cin >> kg[i][1]; } int result[200][2]; for(int k = 0; k < 2 * n; k++){ int i = 0; int j = 0; if(hm[i][0] < kg[j][0]){ result[k][0] = hm[i][0]; result[k][1] = hm[i][1]; i++; }else if(hm[i][0] == kg[j][0] && hm[i][1] < kg[j][1]){ result[k][0] = hm[i][0]; result[k][0] = hm[i][1]; i++ }else if(hm [i][0] > kg[j][0]){ result[k][0] = kg[j][0]; result[k][1] = kg[j][1] j++; }else if(hm[i][0] == kg[j][0] && hm[i][1] > kg[j][1]){ result[k][0] = kg[j][0]; result[k][1] = kg[j][1]; j++; }else if(hm[i][0] == kg[j][0] && hm[i][1] == kg[j][1]){ result[k][0] = hm[i][0]; result[k][1] = hm[i][0]; i++; j++; } } for(int i = 0; i < 2 * n; i++){ printf("%d:%2d ", result[i][0], result[i][1]); } cout << endl; return 0; }
a.cc: In function 'int main()': a.cc:31:28: error: expected ';' before '}' token 31 | i++ | ^ | ; 32 | }else if(hm [i][0] > kg[j][0]){ | ~ a.cc:34:48: error: expected ';' before 'j' 34 | result[k][1] = kg[j][1] | ^ | ; 35 | j++; | ~
s973327124
p00293
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <string> #include <cstdio.h> using namespace std; int timetbl[24][26]; int main() { int i, j, h, m, first; for (i=0; i<2; ++i) { cin>>i>>j; for (; j>0; --j) { cin>>h>>m; timetbl[h][m] = 1; } } first = 1; for (i=0; i<24; ++i){ for (j=0; j<60; ++j){ if ( timetbl[i][j] ){ if ( !first ) printf(" "); else first =0; printf ("%d:%02d", i, j); } } } cout<<endl; return 0; }
a.cc:11:10: fatal error: cstdio.h: No such file or directory 11 | #include <cstdio.h> | ^~~~~~~~~~ compilation terminated.
s122269052
p00293
C++
//============================================================================ // Name : AOJ.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include <string> #include <cstdio.h> int timetbl[24][26]; int main() { int i, j, h, m, first; for (i=0; i<2; ++i) { cin>>i>>j; for (; j>0; --j) { cin>>h>>m; timetbl[h][m] = 1; } } first = 1; for (i=0; i<24; ++i){ for (j=0; j<60; ++j){ if ( timetbl[i][j] ){ if ( !first ) printf(" "); else first =0; printf ("%d:%02d", i, j); } } } cout<<endl; return 0; }
a.cc:11:10: fatal error: cstdio.h: No such file or directory 11 | #include <cstdio.h> | ^~~~~~~~~~ compilation terminated.
s642451847
p00293
C++
#include<iostream> using namespace std; int main(){ int N,M,A; cin>>N; int Ih[N]; int Im[N]; for(int i=0;i<N;i++){ cin>>Ih[i]; cin>>Im[i]; } cin>>M; int Th[M]; int Tm[M]; for(int i=0;i<M;i++){ cin>>Th[i]; cin>>Tm[i]; } A=N+M; int Ah[A]; int Am[A]; for(int i=0;i<N;i++){ Ah[i]=Ih[i]; Am[i]=im[i]; } for(int i=0;i<M;i++){ Ah[N+i]=Th[i]; Am[N+i]=Tm[i]; } int flag=1; while(flag){ flag=0; int tmp1,tmp2; for(int j=0;j<A;j++){ if(Ah[j]>Ah[j+1]){ tmp1=Ah[j]; Ah[j]=Ah[j+1]; Ah[j+1]=tmp1; tmp2=Am[j]; Am[j]=Am[j+1]; Am[j+1]=tmp2; flag=1; }else if(Ah[j]==Ah[j+1]){ if(Am[j]<Am[j+1]){ tmp1=Ah[j]; Ah[j]=Ah[j+1]; Ah[j+1]=tmp1; tmp2=Am[j]; Am[j]=Am[j+1]; Am[j+1]=tmp2; flag=1; } } } } for(int i=0;i<A;i++){ if(i!=A-1){ cout<<Ah[i]<<":"<<Am[i]<<" "; }else{ cout<<Ah[i]<<":"<<Am[i]; } } return 0; }
a.cc: In function 'int main()': a.cc:25:23: error: 'im' was not declared in this scope; did you mean 'Im'? 25 | Am[i]=im[i]; | ^~ | Im
s586896484
p00293
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; int h[101],m[101]; for(int i=0;i<N;i++){ cin>>h[i]>>m[i]; } h[N]=24;m[N]=0; int M; cin>>M; int k[101],g[101]; for(int j=0;j<M;j++){ cint>>k[j]>>g[j]; } k[M]=24;g[M]=0; for(int i=0,j=0;i<N||j<M;){ if(h[i]==k[j]&&m[i]==g[j]){ cout<<h[i]<<';'<<m[i]/10<<m[i]%10; i++;j++; } else if(h[i]<k[i]||(h[i]==k[j]&&m[i]<g[j]){ cout<<h[i]<<';'<<m[i]/10<<m[i]%10; i++; } else{ cout<<k[j]<<';'<<g[j]/10<<g[j]%10; j++ } if(i==N&&j==M){ cout<<endl; } else { cout<<' '; } } return 0; }
a.cc: In function 'int main()': a.cc:18:9: error: 'cint' was not declared in this scope; did you mean 'uint'? 18 | cint>>k[j]>>g[j]; | ^~~~ | uint a.cc:27:51: error: expected ')' before '{' token 27 | else if(h[i]<k[i]||(h[i]==k[j]&&m[i]<g[j]){ | ~ ^ | ) a.cc:41:2: error: expected primary-expression before '}' token 41 | } | ^
s171851412
p00293
C++
#include <iostream> using namespace std; int main(){ int n[100],m[100],a,b,c,nn,mn,i; cin >> nn; for(i=0;i<nn;i++){ cin >> b; n[i] = b * 100; cin >> b; n[i] += b; } cin >> mn; for(i=0;i<mn;i++){ cin >> b; m[i] = b * 100; cin >> b; m[i] += b; } a = 0; b = 0; while(a > nn && c > mn){ if(n[a] == m[nn]){ cout << n[nn] / 100 << ':' << n[nn] - (n[nn] / 100 * 100); nn++; mn++; } else if(n[nn] > m[mn]){ cout << n[nn] / 100 << ':' << n[nn] - (n[nn] / 100 * 100); nn++; } else { cout << m[mn] / 100 << ':' << m[mn] - (m[mn] / 100 * 100); mn++; } }
a.cc: In function 'int main()': a.cc:32:4: error: expected '}' at end of input 32 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s355648812
p00293
C++
#include <iostream> using namespace std; int main(){ int n[101],m[101],a,b,c,nn,mn,i; cin >> nn; if(cin.eof()) return 0; for(i=0;i<nn;i++){ cin >> b; n[i] = b * 100; cin >> b; n[i] += b; } n[i] = 0; cin >> mn; for(i=0;i<mn;i++){ cin >> b; m[i] = b * 100; cin >> b; m[i] += b; } m[i] = 0; a = 0; c = 0; while(a + c < m + n;){ if(n[a] == m[c]){ cout << n[a] / 100 << ':' << n[a] - (n[a] / 100 * 100); a++; c++; } else if(n[a] < m[c]){ cout << n[a] / 100 << ':' << n[a] - (n[a] / 100 * 100); a++; } else { cout << m[c] / 100 << ':' << m[c] - (m[c] / 100 * 100); c++; } } return 0; }
a.cc: In function 'int main()': a.cc:25:19: error: invalid operands of types 'int [101]' and 'int [101]' to binary 'operator+' 25 | while(a + c < m + n;){ | ~ ^ ~ | | | | | int [101] | int [101] a.cc:25:22: error: expected ')' before ';' token 25 | while(a + c < m + n;){ | ~ ^ | ) a.cc:25:23: error: expected primary-expression before ')' token 25 | while(a + c < m + n;){ | ^