submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s047339493 | p03729 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string A;
string B;
string C;
cin<<A<<B<<C;
char b = B[0];
char c = C[0];
char a = A.back();
char d = B.back();
if((a==b)&&(c==d)){
cout<<"YES"<<endl;}
else{
cout<<"NO"<<endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
8 | cin<<A<<B<<C;
| ~~~^~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::istream {aka std::basic_istream<char>}
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
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:8:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin<<A<<B<<C;
| ^~~
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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 = std::__cxx11::basic_string<char>]':
a.cc:8:7: required from here
8 | cin<<A<<B<<C;
| ^
/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)
| ^~~~~~~~
|
s518608770 | p03729 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string A;
string B;
string C;
cin<<A<<B<<C;
char b = B[0];
char c = C[0];
char a = A.back();
char d = B.back();
if((a==b)&&(c==d)){
cout<<"YES"<<endl;}
else{
cout<<"NO"<<endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
8 | cin<<A<<B<<C;
| ~~~^~~
| | |
| | std::string {aka std::__cxx11::basic_string<char>}
| std::istream {aka std::basic_istream<char>}
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
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:8:9: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
8 | cin<<A<<B<<C;
| ^~~
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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:8:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
8 | cin<<A<<B<<C;
| ^
/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 = std::__cxx11::basic_string<char>]':
a.cc:8:7: required from here
8 | cin<<A<<B<<C;
| ^
/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)
| ^~~~~~~~
|
s314484785 | p03729 | C++ | #include<iostream>
using namespace std;
int main(){
string a,b,c;
cin>>a>>b>>c;
if(a[a.size()-1]==b[0]&&b[b.size()-1]==c[0])cout<<"yes"<<endl;
else cout<<"no"<endl;
} | a.cc: In function 'int main()':
a.cc:7:16: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
7 | else cout<<"no"<endl;
| ~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:48,
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/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
7 | else cout<<"no"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
7 | else cout<<"no"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: couldn't deduce template parameter '_CharT'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
7 | else cout<<"no"<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
7 | else cout<<"no"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:7:17: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
7 | else cout<<"no"<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s547661540 | p03729 | C++ | include<iostream>
#include<string>
using namespace std;
int main(){
string A,B,C;
cin>>A>>B>>C;
if(A[A.size()-1]==B[0] && B[B.size()-1]==C[0])cout<<"YES"<<endl;
else cout<<"NO"<<endl;
return 0;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50:
/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:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/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:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
| __n
/usr/include/c++/14/bits/char_traits.h: At global scope:
/usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type
198 | _GLIBCXX14_CONSTEXPR std::size_t
| |
s793552470 | p03729 | C++ | package main
import (
"fmt"
)
func main(){
var a,b,c string
fmt.Scan(&a, &b, &c)
if a[len(a) - 1] == b[0] && b[len(b) - 1] == c[0] {
fmt.Println("YES")
} else {
fmt.Println("NO")
}
} | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
|
s811602162 | p03729 | C++ | #include<iostream>
#include<string>
using namespace std;
int main() {
string a, b, c;
cin >> a >> b >> c;
if ((a.back() == b.front()) && (b.back() == c.front()))
cout << "YES" << endl;
else
cout << "NO" << endl;
}
~ | a.cc:14:2: error: expected class-name at end of input
14 | ~
| ^
|
s356952094 | p03729 | C++ | #include <bits/stdc++.h>
#define itn int
#define LL long long
#define pb push_back
#define mp make_pair
#define x first
#define y second
#define all(x) (x).begin(), (x) end()
#define sz(x) (int)((x).size())
#define REP(i,a,b) for(int i = a ; i <= b; i ++)
using namespace std;
inline int GetInt(){
int x;
scanf("%d" , &x);
return x;
}
inline string GetString(void){
char x[100005];
scanf("%s",x); string s = x;
return s;
}
void solve(){
string a,b,c;
cin >> a >> b >> c;
if(a.back() == b[ 0 ] && b.back() == c[ 0 ]){
cout <<"YES";
}else{
cout << "NO";
}
}
int main(){
*/#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif*/
int T = 1;
while(T--){
solve();
}
return 0;
}
| a.cc:36:11: error: stray '#' in program
36 | */#ifndef ONLINE_JUDGE
| ^
a.cc:39:10: error: #endif without #if
39 | #endif*/
| ^~~~~
a.cc: In function 'int main()':
a.cc:36:10: error: expected primary-expression before '/' token
36 | */#ifndef ONLINE_JUDGE
| ^
a.cc:36:12: error: 'ifndef' was not declared in this scope; did you mean 'index'?
36 | */#ifndef ONLINE_JUDGE
| ^~~~~~
| index
|
s680936907 | p03729 | C | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");} | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 's' defaults to 'int' [-Wimplicit-int]
main.c:1:16: error: implicit declaration of function 'read' [-Wimplicit-function-declaration]
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^~~~
main.c:1:33: error: subscripted value is neither array nor pointer nor vector
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^
main.c:1:47: error: subscripted value is neither array nor pointer nor vector
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^
main.c:1:53: error: invalid type argument of unary '*' (have 'int')
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^~
main.c:1:57: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
| ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
+++ |+#include <stdio.h>
1 | main(f,s){for(;read(0,s,1);s++)s[-1]-32||(f&=s[-2]==*s);puts(f?"YES":"NO");}
|
s316395157 | p03729 | C++ | #include <iostream>
#include <string>
int main(){
string a[2];
cin >> a[0] >>a[1] >>a[2];
if (a[0].back() == a[1].front() && a[1].back() == a[2].front()) {
cout << "YES";
}else{
cout << "NO";
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:1: error: 'string' was not declared in this scope
4 | string a[2];
| ^~~~~~
a.cc:4:1: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note: 'std::string'
77 | typedef basic_string<char> string;
| ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note: 'std::pmr::string'
76 | using string = basic_string<char>;
| ^~~~~~
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> a[0] >>a[1] >>a[2];
| ^~~
| std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:5:8: error: 'a' was not declared in this scope
5 | cin >> a[0] >>a[1] >>a[2];
| ^
a.cc:7:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout << "YES";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout << "NO";
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s494705837 | p03729 | C++ | a,b,c=gets.split.map &:to_i;
b.times{|i|if a%b*i%b==c;puts"YES";exit;end}
puts"NO" | a.cc:1:1: error: 'a' does not name a type
1 | a,b,c=gets.split.map &:to_i;
| ^
a.cc:2:1: error: 'b' does not name a type
2 | b.times{|i|if a%b*i%b==c;puts"YES";exit;end}
| ^
a.cc:3:1: error: 'puts' does not name a type
3 | puts"NO"
| ^~~~
|
s189993696 | p03729 | Java | ㅁㄷㅎ | Main.java:1: error: reached end of file while parsing
???
^
1 error
|
s577519512 | p03729 | C++ | #include<stdio.h>
#include<string.h>
char A[],B[],C[];
int main(){
| a.cc:4:6: error: storage size of 'A' isn't known
4 | char A[],B[],C[];
| ^
a.cc:4:10: error: storage size of 'B' isn't known
4 | char A[],B[],C[];
| ^
a.cc:4:14: error: storage size of 'C' isn't known
4 | char A[],B[],C[];
| ^
a.cc: In function 'int main()':
a.cc:6:12: error: expected '}' at end of input
6 | int main(){
| ~^
|
s769046323 | p03729 | C++ | #include <iostream>
#include<stack>
#include<string>
#include<stdio.h>
using namespace std;
int main()
{
int n, w, price[100], weight[100], max = 1;
int weightg[20000] = { 0 }, priceg[20000] = { 0 };
cin >> n >> w;
for (int i = 0; i < n; i++)
{
cin >> weight[i] >> price[i];
if (weight[i] <= w) {
for (int z = max; z >= 0; z--)
{
weightg[max] = weightg[z] + weight[i];
if(weighg[max]<=w){
priceg[max] = priceg[z] + price[i];
max++;}
}
}
}
int kachi = 0;
for (int i = 0; i < max; i++)
{
if (weightg[i] <= w) {
if (priceg[i] > kachi) {
kachi = priceg[i];
}
}
}
cout << kachi;
return 0;
}
| a.cc: In function 'int main()':
a.cc:19:4: error: 'weighg' was not declared in this scope; did you mean 'weightg'?
19 | if(weighg[max]<=w){
| ^~~~~~
| weightg
|
s580079091 | p03729 | C++ | #include <iostream>
#include <algorithm>
#include <cstdio>
#define Max(a,b) a>b?a:b
#define INF 10000000000000000
using namespace std;
typedef long long LL;
const int MAX = 110;
LL weight[MAX], value[MAX];
LL W;
pair<LL, LL> ps[1 << (MAX / 2)];
int n;
void slove()
{
//枚举前半部分
int n2 = n / 2;
for (int i = 0; i < 1 << n2; i++)//前半部分的枚举总数为 2^(n/2);
{
LL sw = 0, sv = 0;
//每种结果选取特定的价值和重量(i.e 一共2个东西,就一共四种情况,都不选,选第一个,选第二个,都选)
for (int j = 0; j < n2; j++)
{
if (i >> j & 1)
{
sw += weight[j];
sv += value[j];
}
}
ps[i] = make_pair(sw, sv);//加入到ps数组中
}
//对ps排序
sort(ps, ps + (1 << n2));
//ps 去重
int m = 1;
for (int i = 1; i < 1 << n2; i++)
if (ps[m - 1].second < ps[i].second)
ps[m++] = ps[i];
LL res = 0;//保存结果
//枚举后半部分, 并且找到最优解
for (int i = 0; i < 1 << (n - n2); i++)//同样枚举的总个数
{
LL sw = 0, sv = 0;
for (int j = 0; j < n - n2; j++)//和前半部分的一样
{
if (i >> j & 1)
{
sw += weight[n2 + j];
sv += value[n2 + j];
}
}
if (sw <= W)//加个判断求解最大价值,只有小于背包容量的时候
{
LL tv = (lower_bound(ps, ps + m, make_pair(W - sw, INF)) - 1)->second;//找到前半部分对应的value
res = Max(res, sv + tv);
}
}
printf("%lld\n", res);
}
int main()
{
while (~scanf("%d %lld", &n, &W))
{
for (int i = 0; i < n; i++)
scanf("%lld %lld", &weight[i], &value[i]);
slove();
}
return 0;
} | a.cc:11:23: warning: left shift count >= width of type [-Wshift-count-overflow]
11 | pair<LL, LL> ps[1 << (MAX / 2)];
| ~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/string:51,
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/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_less_val::operator()(_Iterator, _Value&) const [with _Iterator = std::pair<long long int, long long int>*; _Value = const std::pair<long long int, long int>]':
/usr/include/c++/14/bits/stl_algobase.h:1504:14: required from '_ForwardIterator std::__lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare) [with _ForwardIterator = pair<long long int, long long int>*; _Tp = pair<long long int, long int>; _Compare = __gnu_cxx::__ops::_Iter_less_val]'
1504 | if (__comp(__middle, __val))
| ~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1539:32: required from '_ForwardIterator std::lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = pair<long long int, long long int>*; _Tp = pair<long long int, long int>]'
1539 | return std::__lower_bound(__first, __last, __val,
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
1540 | __gnu_cxx::__ops::__iter_less_val());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:53:37: required from here
53 | LL tv = (lower_bound(ps, ps + m, make_pair(W - sw, INF)) - 1)->second;//找到前半部分对应的value
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:69:22: error: no match for 'operator<' (operand types are 'std::pair<long long int, long long int>' and 'const std::pair<long long int, long int>')
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:1241:5: note: candidate: 'template<class _IteratorL, class _IteratorR, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_IteratorL, _Container>&, const __normal_iterator<_IteratorR, _Container>&)'
1241 | operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1241:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const __gnu_cxx::__normal_iterator<_IteratorL, _Container>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1249:5: note: candidate: 'template<class _Iterator, class _Container> bool __gnu_cxx::operator<(const __normal_iterator<_Iterator, _Container>&, const __normal_iterator<_Iterator, _Container>&)'
1249 | operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1249:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const __gnu_cxx::__normal_iterator<_Iterator, _Container>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::reverse_iterator<_Iterator>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::reverse_iterator<_Iterator>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::move_iterator<_IteratorL>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::move_iterator<_IteratorL>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: deduced conflicting types for parameter '_T2' ('long long int' and 'long int')
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long int>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
69 | { return *__it < __val; }
| ~~~~~~^~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/predefined_ops.h:69:22: note: 'std::pair<long long int, long long int>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' |
s070063568 | p03729 | C++ | #include<stdio.h>
#include<string.h>
char s[50];
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
memset(s,0,sizeof(s));
while(gets(s))
{
int flag=1;
for(int i=0;i<strlen(s);i++)
{
//printf("i = %d\n",i);
if(s[i]==' ')
{
if(s[i-1]!=s[i+1])
{
flag=0;
break;
}
}
}
if(flag)
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'gets' was not declared in this scope; did you mean 'getw'?
9 | while(gets(s))
| ^~~~
| getw
|
s076094535 | p03729 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
string a,b,c;
cin>>a>>b>>c;
if(a[a.size()-1]==b[0]&&b[b.size()-1==c[0])
cout<<"YES";
else cout<<"NO";
} | a.cc: In function 'int main()':
a.cc:6:43: error: expected ']' before ')' token
6 | if(a[a.size()-1]==b[0]&&b[b.size()-1==c[0])
| ^
| ]
|
s819633826 | p03729 | C | #include <stdio.h>
int main(void) {
int A, B, C;
int i;
scanf("%d %d %d", A, B, C);
for ( i = 0; i < 10000000000000000; i++ ) {
if ((A * i) % B == C ) {
printf("YES");
} else {
printf("NO");
]
}
return 0;
}
| main.c: In function 'main':
main.c:14:17: error: expected statement before ']' token
14 | ]
| ^
main.c:18:1: error: expected declaration or statement at end of input
18 | }
| ^
|
s118110918 | p03729 | C | #include <stdio.h>
int main(void) {
int A, B, C;
int i;
scanf("%d %d %d", A, B, C);
for ( i = 0; i < 10000000000000000; i++ ) {
if ((A * i) % B == C ) {
printf("YES");
} else {
printf("NO");
]
}
return 0;
}
| main.c: In function 'main':
main.c:14:17: error: expected statement before ']' token
14 | ]
| ^
main.c:18:1: error: expected declaration or statement at end of input
18 | }
| ^
|
s906805589 | p03729 | C++ | cin>>A>>B>>C;
court<<"YES"<<endl;
court<<"NO"<<endl; | a.cc:1:1: error: 'cin' does not name a type
1 | cin>>A>>B>>C;
| ^~~
a.cc:2:1: error: 'court' does not name a type
2 | court<<"YES"<<endl;
| ^~~~~
a.cc:3:1: error: 'court' does not name a type
3 | court<<"NO"<<endl;
| ^~~~~
|
s577982535 | p03729 | C++ | #include <cstdio>
#include <algorithm>
#include <cassert>
using namespace std;
typedef long long ll;
#ifdef _MSC_VER
#pragma warning(disable: 4996) // Disable deprecation
#endif
char cbuf1[10000];
char cbuf2[10000];
char cbuf3[10000];
int main()
{
scanf("%s % %s", cbuf1, cbuf2, cbuf3);
int l1 = strlen(cbuf1);
int l2 = strlen(cbuf2);
int l3 = strlen(cbuf3);
if (cbuf1[l1 - 1] == cbuf2[0] && cbuf2[l2 - 1] == cbuf3[0])
printf("YES\n");
else
printf("NO\n");
fclose(stdout);
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:18: error: 'strlen' was not declared in this scope
18 | int l1 = strlen(cbuf1);
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cassert>
+++ |+#include <cstring>
4 | using namespace std;
|
s211955324 | p03729 | C++ | #include <iostream>
#include <vector>
#include <cstdint>
#include <algorithm>
using namespace std;
int main()
{
uint32_t N, W;
cin >> N >> W;
vector<uint32_t> v_w(N,0), v_v(N,0);
for (uint32_t n=0; n<N; ++n)
cin >> v_w[n] >> v_v[n];
uint32_t dp[N+1][W+1];
for (uint32_t n=0; n<N+1; ++n)
dp[n][0] = 0;
for (uint32_t w=0; w<W+1; ++w)
dp[0][w] = 0;
for (uint32_t n=1; n<=N; ++n) {
for (uint32_t w=1; w<=W; ++w) {
if (w >= v_w[n-1])
dp[n][w] = max(dp[n-1][w-v_w[n-1]]+v_v[n-1], dp[n-1][w]);
else
dp[n][w] = dp[n-1][w];
}
}
cout << dp[N][W] << endl;
return 0;
}
dp[n][0] = 0;
for (uint32_t w=0; w<W+1; ++w)
dp[0][w] = 0;
for (uint16_t n=1; n<=N; ++n) {
for (uint32_t w=1; w<=W; ++w) {
if (w >= v_w[n-1])
dp[n][w] = max(dp[n-1][w-v_w[n-1]]+v_v[n-1], dp[n-1][w]);
else
dp[n][w] = dp[n-1][w];
}
}
cout << dp[N][W] << endl;
return 0;
} | a.cc:40:5: error: 'dp' does not name a type
40 | dp[n][0] = 0;
| ^~
a.cc:42:3: error: expected unqualified-id before 'for'
42 | for (uint32_t w=0; w<W+1; ++w)
| ^~~
a.cc:42:22: error: 'w' does not name a type
42 | for (uint32_t w=0; w<W+1; ++w)
| ^
a.cc:42:29: error: expected unqualified-id before '++' token
42 | for (uint32_t w=0; w<W+1; ++w)
| ^~
a.cc:45:3: error: expected unqualified-id before 'for'
45 | for (uint16_t n=1; n<=N; ++n) {
| ^~~
a.cc:45:22: error: 'n' does not name a type
45 | for (uint16_t n=1; n<=N; ++n) {
| ^
a.cc:45:28: error: expected unqualified-id before '++' token
45 | for (uint16_t n=1; n<=N; ++n) {
| ^~
a.cc:54:3: error: 'cout' does not name a type
54 | cout << dp[N][W] << endl;
| ^~~~
a.cc:56:3: error: expected unqualified-id before 'return'
56 | return 0;
| ^~~~~~
a.cc:57:1: error: expected declaration before '}' token
57 | }
| ^
|
s874595101 | p03729 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace abc60
{
class Program
{
static void Main(string[] args)
{
string[] str = Console.ReadLine().Split(' ');
string A = str[0];
string B = str[1];
string C = str[2];
if(A[A.Length-1] == B[B.Length - 1]&&B[B.Length - 1]==C[C.Length - 1])
{
Console.WriteLine("YES");
}else
{
Console.WriteLine("NO");
}
}
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Threading.Tasks;
| ^~~~~~
a.cc:11:26: error: 'string' has not been declared
11 | static void Main(string[] args)
| ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
11 | static void Main(string[] args)
| ^~~~
a.cc:25:6: error: expected ';' after class definition
25 | }
| ^
| ;
a.cc: In static member function 'static void abc60::Program::Main(int*)':
a.cc:13:13: error: 'string' was not declared in this scope
13 | string[] str = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:13:20: error: expected primary-expression before ']' token
13 | string[] str = Console.ReadLine().Split(' ');
| ^
a.cc:14:20: error: expected ';' before 'A'
14 | string A = str[0];
| ^
a.cc:15:20: error: expected ';' before 'B'
15 | string B = str[1];
| ^
a.cc:16:20: error: expected ';' before 'C'
16 | string C = str[2];
| ^
a.cc:17:16: error: 'A' was not declared in this scope
17 | if(A[A.Length-1] == B[B.Length - 1]&&B[B.Length - 1]==C[C.Length - 1])
| ^
a.cc:17:33: error: 'B' was not declared in this scope
17 | if(A[A.Length-1] == B[B.Length - 1]&&B[B.Length - 1]==C[C.Length - 1])
| ^
a.cc:17:67: error: 'C' was not declared in this scope
17 | if(A[A.Length-1] == B[B.Length - 1]&&B[B.Length - 1]==C[C.Length - 1])
| ^
a.cc:19:17: error: 'Console' was not declared in this scope
19 | Console.WriteLine("YES");
| ^~~~~~~
a.cc:22:17: error: 'Console' was not declared in this scope
22 | Console.WriteLine("NO");
| ^~~~~~~
|
s788796562 | p03729 | C | #include <stdio.h>
#include <string.h>
int main(void) {
char A[10], B[10], C[10];
scanf("%s %s %s", A, B, C);
if ( A[stlen(A) - 1] == B[0] && B[strlen(B) - 1] == C[0] ) {
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
}
| main.c: In function 'main':
main.c:9:16: error: implicit declaration of function 'stlen'; did you mean 'strlen'? [-Wimplicit-function-declaration]
9 | if ( A[stlen(A) - 1] == B[0] && B[strlen(B) - 1] == C[0] ) {
| ^~~~~
| strlen
|
s655139033 | p03729 | C++ | #include <cstdio>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <iostream>
#pragma warning(disable:4996)
using namespace std;
int main()
{
char a[100], b[100], c[100];
while (~scanf("%s %s %s", a, b, c))
{
if (b[0] == a[strlen(a) - 1] && c[0] == b[strlen(b) - 1])
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:22:31: error: 'strlen' was not declared in this scope
22 | if (b[0] == a[strlen(a) - 1] && c[0] == b[strlen(b) - 1])
| ^~~~~~
a.cc:10:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
9 | #include <iostream>
+++ |+#include <cstring>
10 |
|
s426674354 | p03729 | C++ | #include<stdio.h>
#include<string.h>
int main(){
char s[35];
gets(s);
char *s1 = strtok(s, " ");
char *s2 = strtok(NULL, " ");
char *s3 = strtok(NULL, " ");
int len1 = strlen(s1);
int len2 = strlen(s2);
if(s1[len1-1] == s2[0] && s2[len2-1] == s3[0]){
printf("YES\n");
}else{
printf("NO\n");
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
5 | gets(s);
| ^~~~
| getw
|
s509027994 | p03729 | C++ |
#include "stdio.h"
int _tmain(int argc, _TCHAR* argv[])
{
//まずは変数を作って初期化
char A[40];
char Aend=' ',Bfirst=' ',Bend=' ',Cfirst=' ';
int counter=0;
for (int i=0; i<40; i++) {
A[i]=' ';
}
//gets()で取得
gets(A);
for (int i=0 ; i<40; i++) {
//空白がどこのものなのかをチェックする
if (A[i]==' ')
counter++;
//一個目の空白をチェックしたら、Aの最後とBの最初がわかる
if ((A[i]==' ')&&(counter==1)) {
Aend=A[i-1];
Bfirst=A[i+1];
}
//ニ個目の空白をチェックしたら、Bの最後とCの最初がわかる
if ((A[i]==' ')&&(counter==2)) {
Bend=A[i-1];
Cfirst=A[i+1];
}
}
/*
//テスト
printf("%s\n",A);
printf("%c\n",Aend);
printf("%c\n",Bfirst);
printf("%c\n",Bend);
printf("%c\n",Cfirst);
*/
//Aの最後とBの最初、Bの最後とCの最初が同じならしりとりが成立
if ((Aend==Bfirst)&&(Bend==Cfirst))
printf("YES");
else
printf("NO");
return 0;
}
| a.cc:4:22: error: '_TCHAR' has not been declared
4 | int _tmain(int argc, _TCHAR* argv[])
| ^~~~~~
a.cc: In function 'int _tmain(int, int**)':
a.cc:15:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
15 | gets(A);
| ^~~~
| getw
|
s831293276 | p03729 | C++ | /*
なせば大抵なんとかなる!
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define amt(a) int a;scanf("%d",&a)
#define dlld(a,b) long long int a,b;scanf("%I64d %I64d",&a,&b)
#define scd(a) int a;scanf("%d",&a)
#define sclld(a) long long int a;scanf("%I64d",&a)
#define scs(a) char a[2000000];scanf("%s",a)
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define arr(a,b) int *a=(int *)malloc(n*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(n*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265
typedef struct dlinkedlist
{
int health;
char name[50];
struct dlinkedlist *next;
struct dlinkedlist *prev;
}dll;
dll *head=NULL;
dll *tail=NULL;
int total=0;
void pushTail(int health,char *name)
{
dll *node=(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
tail->next=node;
node->prev=tail;
tail=node;
}
}
void pushHead(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
head->prev=node;
node->next=head;
head=node;
}
}
void pushPriority(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
dll *pointer=head;
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
pushTail(health,name);
}
else if(head->health>node->health)
{
pushHead(health,name);
}
else if(node->health>tail->health)
{
pushTail(health,name);
}
else
{
while(node->health>=pointer->health)
{
pointer=pointer->next;
}
node->next=pointer;
node->prev=pointer->prev;
pointer->prev->next=node;
pointer->prev=node;
}
}
void popst()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
tail=tail->prev;
free(tail->next);
tail->next=NULL;
}
total--;
}
void popq()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
head=head->next;
free(head->prev);
head->prev=NULL;
}
total--;
}
void popAll()
{
dll *pointer=head;
while(head!=NULL)
{
head=head->next;
free(pointer);
pointer=head;
total=0;
debug;
}
}
void call()
{
if(total<0)
{
printf("No Patient");
}
else
{
printf("Patient`s Name : %s\n",head->name);
printf("Patient`s Health : %d\n",head->health);
popq();
}
getchar();
}
void view()
{
if(total<1)
{
printf("No Data");
}
else
{
dll *pointer=head;
int num=1;
while(pointer!=NULL)
{
printf("%-02d\n",num);
printf(" Patient`s Name : %s\n",pointer->name);
printf(" Patient`s Health : %d\n",pointer->health);
pointer=pointer->next;
num++;
}
}
getchar();
}
void add()
{
int health;
char name[50];
printf("\n\n");
do
{
printf("Input Patient`s Name [1-30] : ");
scanf("%[^\n]",name);
fflush(stdin);
}while(strlen(name)<1 || strlen(name)>30);
do
{
printf("Input Patient`s Health [1-100] : ");
scanf("%d",&health);
fflush(stdin);
}while(health<1 || health>100);
pushPriority(health,name);
printf("\n--Patient Added--\n");
total++;
getchar();
}
void menu()
{
system("cls");
int mn;
printf("Binus Hospital\n");
printf("-----------------\n");
printf("1. View Patient\n");
printf("2. Add New Patient\n");
printf("3. Call Patient\n");
printf("4. Exit\n");
do
{
printf("Choose : ");
scanf("%d",&mn);
fflush(stdin);
}while(mn<1 || mn>4);
if(mn==1)
{
view();
menu();
}
else if(mn==2)
{
add();
menu();
}
else if(mn==3)
{
call();
menu();
}
else if(mn==4)
{
printf("Thank You");
popAll();
menu();
}
}
int main()
{
char a[5200],b[5200],c[5200];
scanf("%s %s %s" ,a,b,c);
int lena=strlen(a),lenb=strlen(b),lenc=strlen(c);
if(a[lena-1]==b[0] &&b[lenb-1]==c[0])
printf("YES\n");
else
printf("NO\n");
return 0;}
Submission | a.cc:278:1: error: 'Submission' does not name a type
278 | Submission
| ^~~~~~~~~~
|
s149998324 | p03729 | C++ | /*
なせば大抵なんとかなる!
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define amt(a) int a;scanf("%d",&a)
#define dlld(a,b) long long int a,b;scanf("%I64d %I64d",&a,&b)
#define scd(a) int a;scanf("%d",&a)
#define sclld(a) long long int a;scanf("%I64d",&a)
#define scs(a) char a[2000000];scanf("%s",a)
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define arr(a,b) int *a=(int *)malloc(n*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(n*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265
typedef struct dlinkedlist
{
int health;
char name[50];
struct dlinkedlist *next;
struct dlinkedlist *prev;
}dll;
dll *head=NULL;
dll *tail=NULL;
int total=0;
void pushTail(int health,char *name)
{
dll *node=(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
tail->next=node;
node->prev=tail;
tail=node;
}
}
void pushHead(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
head->prev=node;
node->next=head;
head=node;
}
}
void pushPriority(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
dll *pointer=head;
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
pushTail(health,name);
}
else if(head->health>node->health)
{
pushHead(health,name);
}
else if(node->health>tail->health)
{
pushTail(health,name);
}
else
{
while(node->health>=pointer->health)
{
pointer=pointer->next;
}
node->next=pointer;
node->prev=pointer->prev;
pointer->prev->next=node;
pointer->prev=node;
}
}
void popst()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
tail=tail->prev;
free(tail->next);
tail->next=NULL;
}
total--;
}
void popq()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
head=head->next;
free(head->prev);
head->prev=NULL;
}
total--;
}
void popAll()
{
dll *pointer=head;
while(head!=NULL)
{
head=head->next;
free(pointer);
pointer=head;
total=0;
debug;
}
}
void call()
{
if(total<0)
{
printf("No Patient");
}
else
{
printf("Patient`s Name : %s\n",head->name);
printf("Patient`s Health : %d\n",head->health);
popq();
}
getchar();
}
void view()
{
if(total<1)
{
printf("No Data");
}
else
{
dll *pointer=head;
int num=1;
while(pointer!=NULL)
{
printf("%-02d\n",num);
printf(" Patient`s Name : %s\n",pointer->name);
printf(" Patient`s Health : %d\n",pointer->health);
pointer=pointer->next;
num++;
}
}
getchar();
}
void add()
{
int health;
char name[50];
printf("\n\n");
do
{
printf("Input Patient`s Name [1-30] : ");
scanf("%[^\n]",name);
fflush(stdin);
}while(strlen(name)<1 || strlen(name)>30);
do
{
printf("Input Patient`s Health [1-100] : ");
scanf("%d",&health);
fflush(stdin);
}while(health<1 || health>100);
pushPriority(health,name);
printf("\n--Patient Added--\n");
total++;
getchar();
}
void menu()
{
system("cls");
int mn;
printf("Binus Hospital\n");
printf("-----------------\n");
printf("1. View Patient\n");
printf("2. Add New Patient\n");
printf("3. Call Patient\n");
printf("4. Exit\n");
do
{
printf("Choose : ");
scanf("%d",&mn);
fflush(stdin);
}while(mn<1 || mn>4);
if(mn==1)
{
view();
menu();
}
else if(mn==2)
{
add();
menu();
}
else if(mn==3)
{
call();
menu();
}
else if(mn==4)
{
printf("Thank You");
popAll();
menu();
}
}
int main()
{
char a[5200],b[5200],c[5200];
scanf("%s %s %s" ,a,b,c);
int lena=strlen(a),lenb=strlen(b),lenc=strlen(c);
if(a[lena-1]==b[0] &&b[lenb-1]==c[0])
printf("YES\n");
else
printf("NO\n");
return 0;}
Submission | a.cc:278:1: error: 'Submission' does not name a type
278 | Submission
| ^~~~~~~~~~
|
s358514263 | p03729 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// ここにコードを挿入
Scanner s = new Scanner(System.in);
String[] str = s.nextLine().split(" ");
String a = str[0];
String b = str[1];
String c = str[2];
boolean ans = false;
if(a.charAt(a.length() - 1) == b.charAt(0) && b.charAt(b.length() - 1) == c.charAt(0)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
}import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// ここにコードを挿入
Scanner s = new Scanner(System.in);
String[] str = s.nextLine().split(" ");
String a = str[0];
String b = str[1];
String c = str[2];
boolean ans = false;
if(a.charAt(a.length() - 1) == b.charAt(0) && b.charAt(b.length() - 1) == c.charAt(0)) {
System.out.println("YES");
} else {
System.out.println("NO");
}
}
} | Main.java:20: error: class, interface, enum, or record expected
}import java.util.Scanner;
^
1 error
|
s788243783 | p03729 | C++ | #include <iostream>
#include <cmath>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <numeric>
#include <limits>
using namespace std;
typedef long long ll;
int main()
{
int n,t;
scanf("%d%d",&n,&t);
int a[200010];
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
sort(a,a+n);
ll res=0;
for(int i=0;i<n-1;i++)
{
if(a[i+1]-a[i]>t)
res+=t;
else res+=(a[i+1]-a[i]);
}
res+=t;
cout<<res<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
21 | sort(a,a+n);
| ^~~~
| sqrt
|
s089314134 | p03729 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
static void Main(string[] args)
{
string[] str = Console.ReadLine().Split(' ');
int lengtha = str[0].Length;
int lengthb = str[1].Length;
string end_a = str[0].Substring(lengtha - 1, 1);
string start_b = str[1].Substring(0, 1);
string end_b = str[1].Substring(lengthb - 1, 1);
string start_c = str[2].Substring(0, 1);
if(end_a == start_b && end_b == start_c){
Console.WriteLine("YES");
}else{
Console.WriteLine("NO");
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
a.cc:8:22: error: 'string' has not been declared
8 | static void Main(string[] args)
| ^~~~~~
a.cc:8:31: error: expected ',' or '...' before 'args'
8 | static void Main(string[] args)
| ^~~~
a.cc:24:2: error: expected ';' after class definition
24 | }
| ^
| ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:10:9: error: 'string' was not declared in this scope
10 | string[] str = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:10:16: error: expected primary-expression before ']' token
10 | string[] str = Console.ReadLine().Split(' ');
| ^
a.cc:11:23: error: 'str' was not declared in this scope; did you mean 'std'?
11 | int lengtha = str[0].Length;
| ^~~
| std
a.cc:13:16: error: expected ';' before 'end_a'
13 | string end_a = str[0].Substring(lengtha - 1, 1);
| ^~~~~
a.cc:14:16: error: expected ';' before 'start_b'
14 | string start_b = str[1].Substring(0, 1);
| ^~~~~~~
a.cc:15:16: error: expected ';' before 'end_b'
15 | string end_b = str[1].Substring(lengthb - 1, 1);
| ^~~~~
a.cc:16:16: error: expected ';' before 'start_c'
16 | string start_c = str[2].Substring(0, 1);
| ^~~~~~~
a.cc:18:12: error: 'end_a' was not declared in this scope
18 | if(end_a == start_b && end_b == start_c){
| ^~~~~
a.cc:18:21: error: 'start_b' was not declared in this scope
18 | if(end_a == start_b && end_b == start_c){
| ^~~~~~~
a.cc:18:32: error: 'end_b' was not declared in this scope
18 | if(end_a == start_b && end_b == start_c){
| ^~~~~
a.cc:18:41: error: 'start_c' was not declared in this scope; did you mean 'static'?
18 | if(end_a == start_b && end_b == start_c){
| ^~~~~~~
| static
a.cc:19:13: error: 'Console' was not declared in this scope
19 | Console.WriteLine("YES");
| ^~~~~~~
a.cc:21:13: error: 'Console' was not declared in this scope
21 | Console.WriteLine("NO");
| ^~~~~~~
|
s598819920 | p03729 | C++ | #include <stdio.h>
#include <conio.h>
int main(){
char A[3][31];
char B[11];
char C[11];
int c=0;
scanf("%s",&A[0]);
scanf("%s",&A[1]);
scanf("%s",&A[2]);
for(int j=0;j<2;j++){
for(int i=0;i<36;i++){
if(A[j][i]==0){
if(A[j][i-1]==A[j+1][0]){
c++;
break;
}
printf("NO\n");
return 0;
}
}
}
printf("YES\n");
return 0;
} | a.cc:2:10: fatal error: conio.h: No such file or directory
2 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s196764022 | p03729 | C++ | #include<cstdio>
#include<cstring>
using namespace std;
int main()
{
int MAX = 11;
char a[MAX], b[MAX], c[MAX];
scanf("%s", a);
scanf("%s", b);
scanf("%s", c);
if(a[strlen(a)-1] != b[0] || b[strlen(b)-1] != c[0]) {
printf("No");
}
else {
printf("Yes");
} | a.cc: In function 'int main()':
a.cc:17:2: error: expected '}' at end of input
17 | }
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s064388644 | p03729 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int i=0;
String rtn="";
StringBuffer[] sb=new StringBuffer[3];
for(i=0;i<3;i++){sb[i]=(sc.next());}
rtn=(sb[0].reverse().substring(0,1)==sb[1].substring(0,1)&&sb[1].reverse().substring(0,1)==sb[2].reverse().substring(0,1))?"YES":"NO";
System.out.println(rtn);
}
} | Main.java:8: error: incompatible types: String cannot be converted to StringBuffer
for(i=0;i<3;i++){sb[i]=(sc.next());}
^
1 error
|
s751361676 | p03729 | C++ | #include <iostream>
#include <cstring>
using namespace std;
string A, B, C;
void main(){
cin >> A >> B >> C;
if (A[A.length() - 1] == B[0] && B[B.length()-1] == C[0]) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
} | a.cc:8:1: error: '::main' must return 'int'
8 | void main(){
| ^~~~
|
s897010076 | p03729 | C++ | #include <iostream>
#include <string>
using namespace std;
string A, B, C;
void main(){
cin >> A >> B >> C;
if (A[A.length() - 1] == B[0] && B[B.length()-1] == C[0]) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
} | a.cc:8:1: error: '::main' must return 'int'
8 | void main(){
| ^~~~
|
s980722105 | p03729 | C++ | if __name__ == '__main__':
a, b, c = input().split()
ans = "YES" if a[-1] == b[0] and b[-1] == c[0] else "NO"
print(ans)
| a.cc:1:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
1 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: expected unqualified-id before 'if'
1 | if __name__ == '__main__':
| ^~
|
s321067517 | p03729 | C | #include <stdio.h>
#include <string.h>
typedef unsigned int uint;
#define BUF_SIZE (20)
int main(void)
{
char strA[BUF_SIZE];
char strB[BUF_SIZE];
char strC[BUF_SIZE];
int lengthA;
int lengthB;
int lengthC;
char strA_End;
char strB_Begin;
char strB_End;
char strC_Begin;
scanf_s("%s %s %s", strA, BUF_SIZE, strB, BUF_SIZE, strC, BUF_SIZE);
lengthA = strlen(strA);
lengthB = strlen(strB);
lengthC = strlen(strC);
strA_End = strA[lengthA - 1];
strB_Begin = strB[0];
strB_End = strB[lengthB - 1];
strC_Begin = strC[0];
if((strA_End == strB_Begin) && (strB_End == strC_Begin)){
printf("YES\n");
} else {
printf("NO\n");
}
return 0;
}
| main.c: In function 'main':
main.c:20:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
20 | scanf_s("%s %s %s", strA, BUF_SIZE, strB, BUF_SIZE, strC, BUF_SIZE);
| ^~~~~~~
| scanf
|
s393619555 | p03729 | C++ | /*
なせば大抵なんとかなる!
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <limits.h>
#include <windows.h>
#define LLU unsigned long long int
#define LL long long int
#define LD long double
#define LLUmax ULLONG_MAX
#define LLmax LLONG_MAX
#define dmax INT_MAX
#define debug printf("asd\n")
#define debugd(a) printf("--%d\n",a)
#define debugdd(a,b) printf("--%d %d\n",a,b)
#define debugarr(a,b) for(int i=0 ; i<b ; i++)printf("%d ",a[i]);printf("\n")
#define newline printf("\n")
#define amt(a) int a;scanf("%d",&a)
#define dlld(a,b) long long int a,b;scanf("%I64d %I64d",&a,&b)
#define scd(a) int a;scanf("%d",&a)
#define sclld(a) long long int a;scanf("%I64d",&a)
#define scs(a) char a[2000000];scanf("%s",a)
#define prdlld(a,b) printf("%I64d %I64d",a,b)
#define prdd(a,b) printf("%d %d",a,b)
#define prd(a) printf("%d",a)
#define arr(a,b) int *a=(int *)malloc(n*sizeof(int))
#define llarr(a,b) long long int *a=(long long int *)malloc(n*sizeof(long long int))
#define st(a,b) char *a=(char *)malloc(b*sizeof(char))
#define grav 9.8
#define pi 3.14159265
typedef struct dlinkedlist
{
int health;
char name[50];
struct dlinkedlist *next;
struct dlinkedlist *prev;
}dll;
dll *head=NULL;
dll *tail=NULL;
int total=0;
void pushTail(int health,char *name)
{
dll *node=(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
tail->next=node;
node->prev=tail;
tail=node;
}
}
void pushHead(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
head=tail=node;
}
else
{
head->prev=node;
node->next=head;
head=node;
}
}
void pushPriority(int health,char *name)
{
dll *node =(dll *)malloc(sizeof(dll));
dll *pointer=head;
node->next=NULL;
node->prev=NULL;
node->health=health;
strcpy(node->name,name);
if(head==NULL && tail==NULL)
{
pushTail(health,name);
}
else if(head->health>node->health)
{
pushHead(health,name);
}
else if(node->health>tail->health)
{
pushTail(health,name);
}
else
{
while(node->health>=pointer->health)
{
pointer=pointer->next;
}
node->next=pointer;
node->prev=pointer->prev;
pointer->prev->next=node;
pointer->prev=node;
}
}
void popst()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
tail=tail->prev;
free(tail->next);
tail->next=NULL;
}
total--;
}
void popq()
{
if(head==tail)
{
free(head);
head=tail=NULL;
}
else
{
head=head->next;
free(head->prev);
head->prev=NULL;
}
total--;
}
void popAll()
{
dll *pointer=head;
while(head!=NULL)
{
head=head->next;
free(pointer);
pointer=head;
total=0;
debug;
}
}
void call()
{
if(total<0)
{
printf("No Patient");
}
else
{
printf("Patient`s Name : %s\n",head->name);
printf("Patient`s Health : %d\n",head->health);
popq();
}
getchar();
}
void view()
{
if(total<1)
{
printf("No Data");
}
else
{
dll *pointer=head;
int num=1;
while(pointer!=NULL)
{
printf("%-02d\n",num);
printf(" Patient`s Name : %s\n",pointer->name);
printf(" Patient`s Health : %d\n",pointer->health);
pointer=pointer->next;
num++;
}
}
getchar();
}
void add()
{
int health;
char name[50];
printf("\n\n");
do
{
printf("Input Patient`s Name [1-30] : ");
scanf("%[^\n]",name);
fflush(stdin);
}while(strlen(name)<1 || strlen(name)>30);
do
{
printf("Input Patient`s Health [1-100] : ");
scanf("%d",&health);
fflush(stdin);
}while(health<1 || health>100);
pushPriority(health,name);
printf("\n--Patient Added--\n");
total++;
getchar();
}
void menu()
{
system("cls");
int mn;
printf("Binus Hospital\n");
printf("-----------------\n");
printf("1. View Patient\n");
printf("2. Add New Patient\n");
printf("3. Call Patient\n");
printf("4. Exit\n");
do
{
printf("Choose : ");
scanf("%d",&mn);
fflush(stdin);
}while(mn<1 || mn>4);
if(mn==1)
{
view();
menu();
}
else if(mn==2)
{
add();
menu();
}
else if(mn==3)
{
call();
menu();
}
else if(mn==4)
{
printf("Thank You");
popAll();
menu();
}
}
int main()
{
char a[5200],b[5200],c[5200];
scanf("%s %s %s" ,a,b,c);
int lena=strlen(a),lenb=strlen(b),lenc=strlen(c);
if(a[lena-1]==b[0] &&b[lenb-1]==c[0])
printf("YES\n");
else
printf("NO\n");
return 0;
}
| a.cc:12:10: fatal error: windows.h: No such file or directory
12 | #include <windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s298987298 | p03729 | C++ | a,b,c = raw_input().split()
if a[-1] == b[0] and b[-1] == c[0]:
print 'YES'
else:
print 'NO' | a.cc:3:11: warning: multi-character character constant [-Wmultichar]
3 | print 'YES'
| ^~~~~
a.cc:5:11: warning: multi-character character constant [-Wmultichar]
5 | print 'NO'
| ^~~~
a.cc:1:1: error: 'a' does not name a type
1 | a,b,c = raw_input().split()
| ^
|
s713748745 | p03729 | C++ | stem;
using System.Linq;
class Program
{
static void Main(string[] args)
{
string[] input = Console.ReadLine().Split(' ');
if (input[0].Last() == input[1].First() && input[1].Last() == input[2].First())
{
Console.WriteLine("YES");
}
else
{
Console.WriteLine("NO");
}
}
}
| a.cc:1:1: error: 'stem' does not name a type
1 | stem;
| ^~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Linq;
| ^~~~~~
a.cc:6:26: error: 'string' has not been declared
6 | static void Main(string[] args)
| ^~~~~~
a.cc:6:35: error: expected ',' or '...' before 'args'
6 | static void Main(string[] args)
| ^~~~
a.cc:19:2: error: expected ';' after class definition
19 | }
| ^
| ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:8:9: error: 'string' was not declared in this scope
8 | string[] input = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:8:16: error: expected primary-expression before ']' token
8 | string[] input = Console.ReadLine().Split(' ');
| ^
a.cc:10:13: error: 'input' was not declared in this scope; did you mean 'int'?
10 | if (input[0].Last() == input[1].First() && input[1].Last() == input[2].First())
| ^~~~~
| int
a.cc:12:13: error: 'Console' was not declared in this scope
12 | Console.WriteLine("YES");
| ^~~~~~~
a.cc:16:13: error: 'Console' was not declared in this scope
16 | Console.WriteLine("NO");
| ^~~~~~~
|
s452463631 | p03729 | C++ | #include<iostream>
#include<string>
#include<cstdlib>
#include<algorithm>
using namespace std;
int main(){
string a,b,c;
cin >> a >> b >> c;
if(a[size.a()-1] == b[0] && b[size.b()-1] == c[0])
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:19: error: overloaded function with no contextual type information
11 | if(a[size.a()-1] == b[0] && b[size.b()-1] == c[0])
| ^
a.cc:11:44: error: overloaded function with no contextual type information
11 | if(a[size.a()-1] == b[0] && b[size.b()-1] == c[0])
| ^
|
s262844383 | p03729 | C++ | #include <iostream>
#include <list>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
int main()
{
string a[3];
cin >> a[0];
cin >> a[1];
cin >> a[2];
if (a[0].back() == a[1].front() && a[1].back() == a[2].front())
{
cout << "YES";
return;
}
cout << "NO";
}
| a.cc: In function 'int main()':
a.cc:20:17: error: return-statement with no value, in function returning 'int' [-fpermissive]
20 | return;
| ^~~~~~
|
s515943368 | p03730 | C | #include <stdio.h>
#include <string.h>
#pragma warning(disable : 4996)
int main()
{
int A, B, C;
int i, ans = false;
int sum = 0;
scanf("%d %d %d", &A, &B, &C);
for (i = 1; i <= 100; i++) {
sum = A * i;
if (C == sum % B) {
ans = true;
break;
}
}
if (ans)
printf("Yes");
else
printf("No");
return 0;
} | main.c: In function 'main':
main.c:8:18: error: 'false' undeclared (first use in this function)
8 | int i, ans = false;
| ^~~~~
main.c:3:1: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include <string.h>
+++ |+#include <stdbool.h>
3 | #pragma warning(disable : 4996)
main.c:8:18: note: each undeclared identifier is reported only once for each function it appears in
8 | int i, ans = false;
| ^~~~~
main.c:17:19: error: 'true' undeclared (first use in this function)
17 | ans = true;
| ^~~~
main.c:17:19: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s613448686 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A,B,C;
cin >> A >> B >> C;
bool ok = false;
for(int i = 1; i <= b; i++){
if(A*i%B == C){
ok = true;
}
}
cout<<(ok ? "Yes" : "No") << endl;
}
| a.cc: In function 'int main()':
a.cc:8:23: error: 'b' was not declared in this scope
8 | for(int i = 1; i <= b; i++){
| ^
|
s432692663 | p03730 | C++ | #includ<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
bool flag=false;
for(int i=1;i<=b;i++){
if((a*i%b)==c){
flag=true;
break;
}
}
cout<<(flag?"Yes":"No")<<endl;
} | a.cc:1:2: error: invalid preprocessing directive #includ; did you mean #include?
1 | #includ<bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin>>a>>b>>c;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #includ<bits/stdc++.h>
a.cc:14:3: error: 'cout' was not declared in this scope
14 | cout<<(flag?"Yes":"No")<<endl;
| ^~~~
a.cc:14:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:14:28: error: 'endl' was not declared in this scope
14 | cout<<(flag?"Yes":"No")<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #includ<bits/stdc++.h>
|
s492782395 | p03730 | C++ | #include <iostream>
using namespace std;
int main(void){
int a,b,c;
cin>>a>>b>>c;
if(a%B==0){
cout<<"NO"<<endl;
}else{
int i,ans;
for(i=1;i<=b;i++){
ans=a*i-c;
if(ans%b==0){
cout<<"YES"<<endl;
break;
}
}
if(i==b+1)cout<<"NO"<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:8: error: 'B' was not declared in this scope
8 | if(a%B==0){
| ^
|
s962383125 | p03730 | C++ | // Alisher_2211
# include <bits/stdc++.h>
# define long long long
# define all(vc) vc.begin(),vc.end()
# define allr(vc) vc.rbegin(),vc.rend()
# define pb push_back
# define fi first
# define se second
# define pi pair <long, long>
# define lcm(a, b) (a * b) / __gcd(a, b)
using namespace std;
const long N = 100100;
void read(){freopen("input.txt" , "r" , stdin );freopen("output.txt", "w" , stdout );}
long dp[N][2];
string s;
void solve(){
long a, b, c;
cin >> a > b >> c;
long h = c % b;
long ans = 0;
for (int i = a; i < 100000; i += a){
ans += i;
if( ans % b == h ){
cout << "YES";
return;
}
}
cout << "NO";
}
int32_t main(){
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
long T = 1;
//cin >> T;
while( T-- ){
solve();
cout<<'\n';
}
cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
} | a.cc: In function 'void solve()':
a.cc:17:14: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'long long int')
17 | long a, b, c;
| ~~~~~~~~ ^ ~~
| | |
| | long long int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:17:14: note: candidate: 'operator>(int, long long int)' (built-in)
17 | long a, b, c;
| ~~~~~~~~~^~~~
a.cc:17:14: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:2:
/usr/include/c++/14/bits/regex.h:1176:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1176 | operator>(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1176:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1236:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1236 | operator>(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1236:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1329:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator>(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1329 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1329:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1403:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1403 | operator>(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1403:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1497:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1497 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1497:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1573:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1573 | operator>(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1573:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: mismatched types 'const std::__cxx11::sub_match<_BiIter>' and 'long long int'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/regex.h:1673:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator>(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1673 | operator>(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1673:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
17 | long a, b, c;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
17 | long a, b, c;
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
17 | long a, b, c;
| ^
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/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | long a, b, c;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
17 | long a, b, c;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:17:21: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
17 | long a, b, c;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<clas |
s030003628 | p03730 | Java | package rensyuu;
import java.util.*;
import java.io.*;
public class Cmondai {
public static void main(String[] args) throws IOException {
// 入出力高速化 java.io.* とthrows IOExceptionを忘れずに
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] in = br.readLine().split(" ");
int A = Integer.parseInt(in[0]);
int B = Integer.parseInt(in[1]);
int C = Integer.parseInt(in[2]);
String ans = "NO";
for(int i=1; i<=B; i++) {
if(i*A%B == C)
ans = "YES";
}
System.out.println(ans);
}
}
| Main.java:6: error: class Cmondai is public, should be declared in a file named Cmondai.java
public class Cmondai {
^
1 error
|
s643966751 | p03730 | Java | public class Main {
public static void main(String[] args) throws IOException {
// 入出力高速化 java.io.* とthrows IOExceptionを忘れずに
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] in = br.readLine().split(" ");
int A = Integer.parseInt(in[0]);
int B = Integer.parseInt(in[1]);
int C = Integer.parseInt(in[2]);
String ans = "NO";
for(int i=1; i<A+B; i++) {
if(i*A%B == C)
ans = "YES";
}
System.out.println(ans);
}
} | Main.java:3: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:6: error: cannot find symbol
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
^
symbol: class InputStreamReader
location: class Main
4 errors
|
s386314790 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int64_t A,B,C;
cin>>A>>B>>C;
bool Q=false;
for(int i=1;i<10000000){
if((A*i)%B==C){
Q=true;
break;
}
}
if(Q){
cout<<"YES"<<endl;
}
else{
cout<<"NO"<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:8:25: error: expected ';' before ')' token
8 | for(int i=1;i<10000000){
| ^
| ;
|
s787675776 | p03730 | C++ | int main()
{
int aa,a,b,c,i=0,m;
vector<int> box(110); //1<=A<=100より、余りは99通り
cin >> aa >> b >> c;
while (true)
{
i++;
a = aa*i;
m = a%b;
if(m==c) {
cout <<"YES"<< endl;
return 0;
}
if(count(box.begin(),box.end(),m)) {
cout << "NO" << endl;
return 0;
}
box.push_back(m);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:5: error: 'vector' was not declared in this scope
4 | vector<int> box(110); //1<=A<=100より、余りは99通り
| ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
4 | vector<int> box(110); //1<=A<=100より、余りは99通り
| ^~~
a.cc:5:5: error: 'cin' was not declared in this scope
5 | cin >> aa >> b >> c;
| ^~~
a.cc:13:13: error: 'cout' was not declared in this scope
13 | cout <<"YES"<< endl;
| ^~~~
a.cc:13:28: error: 'endl' was not declared in this scope
13 | cout <<"YES"<< endl;
| ^~~~
a.cc:16:18: error: 'box' was not declared in this scope
16 | if(count(box.begin(),box.end(),m)) {
| ^~~
a.cc:16:12: error: 'count' was not declared in this scope
16 | if(count(box.begin(),box.end(),m)) {
| ^~~~~
a.cc:17:13: error: 'cout' was not declared in this scope
17 | cout << "NO" << endl;
| ^~~~
a.cc:17:29: error: 'endl' was not declared in this scope
17 | cout << "NO" << endl;
| ^~~~
a.cc:20:9: error: 'box' was not declared in this scope
20 | box.push_back(m);
| ^~~
|
s675923732 | p03730 | C++ | #include <iostream>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int d = b / __gcd(a, b);
// [0, d)があまりの周期
int e = c / __gcd(b, c);
if (e < d)
cout << "YES";
else
cout << "NO";
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:15: error: '__gcd' was not declared in this scope
8 | int d = b / __gcd(a, b);
| ^~~~~
|
s736008278 | p03730 | C++ | #include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;
int main() {
int a,b,c;
cin >> a >> b >> c;
if(c%gcd(a,b) != 0) {
cout << "NO";
}
else {
cout << "YES";
} | a.cc: In function 'int main()':
a.cc:17:6: error: expected '}' at end of input
17 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s263260792 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int prime(int A,int B){
int ret=0;
for(int i=2;i<=10;i++){
if((A%i==0)&&(B%i==0)){
ret=i;
}
}
return ret;
}
int main() {
int A,B,C;
cin>>A>>B>>C;
int factor=0;
bool ans=true;
while(ans){
factor = prime(A,B)
if(factor){
A/=factor;
B/=factor;
if(C%factor==0)
C/=factor;
else
ans=false;
}
else
break;
}
if(ans)
cout<<"YES"<<endl;
else
cout<<"NO"<<endl;
}
| a.cc: In function 'int main()':
a.cc:20:24: error: expected ';' before 'if'
20 | factor = prime(A,B)
| ^
| ;
21 | if(factor){
| ~~
a.cc:29:5: error: 'else' without a previous 'if'
29 | else
| ^~~~
|
s713991342 | p03730 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner scn = new Scanner(System.in);
int a = scn.nextInt();
int b = scn.nextInt();
int c = scn.nextInt();
int check = 0;
long x = (long)(5*Math.pow(10,13))
for(long i=0; i<x; ++i){
if((a*i) % b == c){
check =1;
}
}
if(check==0){
System.out.println("No");
}
if(check==1){
System.out.println("Yes");
}
}
} | Main.java:10: error: ';' expected
long x = (long)(5*Math.pow(10,13))
^
1 error
|
s835470507 | p03730 | C++ | #include <bits\stdc++.h>
using namespace std;
int main(){
int a,b,c;cin>>a>>b>>c;
bool res=0;
for(int i=1;i<b;i++){
if(a*i%b==c)res=1;
}
if(res)cout<<"YES"<<endl;
else cout<<"NO"<<endl;
} | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s063109519 | p03730 | C | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: B
# CreatedDate: 2020-06-26 15:04:28 +0900
# LastModified: 2020-06-26 15:10:43 +0900
#
import os
import sys
# import numpy as np
# import pandas as pd
def main():
a, b, c = map(int, input().split())
for i in range(100):
if float((a*i-c)/b).is_integer():
print("YES")
return
print("NO")
if __name__ == "__main__":
main()
| main.c:1:2: error: invalid preprocessing directive #!
1 | #!/usr/bin/env python
| ^
main.c:2:3: error: invalid preprocessing directive #-
2 | # -*- coding: utf-8 -*-
| ^
main.c:4:3: error: invalid preprocessing directive #FileName
4 | # FileName: B
| ^~~~~~~~
main.c:5:3: error: invalid preprocessing directive #CreatedDate
5 | # CreatedDate: 2020-06-26 15:04:28 +0900
| ^~~~~~~~~~~
main.c:6:3: error: invalid preprocessing directive #LastModified
6 | # LastModified: 2020-06-26 15:10:43 +0900
| ^~~~~~~~~~~~
main.c:10:1: error: unknown type name 'import'
10 | import os
| ^~~~~~
main.c:11:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
11 | import sys
| ^~~~~~
main.c:11:1: error: unknown type name 'import'
main.c:12:3: warning: #import is a deprecated GCC extension [-Wdeprecated]
12 | # import numpy as np
| ^~~~~~
main.c:12:10: error: #import expects "FILENAME" or <FILENAME>
12 | # import numpy as np
| ^~~~~
main.c:13:3: warning: #import is a deprecated GCC extension [-Wdeprecated]
13 | # import pandas as pd
| ^~~~~~
main.c:13:10: error: #import expects "FILENAME" or <FILENAME>
13 | # import pandas as pd
| ^~~~~~
|
s890175646 | p03730 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
#define mp make_pair
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};
ll gcd(ll a,ll b){
if(a%b==0){
return b;
}
else{
return gcd(b,a%b);
}
}
int main() {
ll a,b,c;
cin >> a >>> b >> c;
a=gcd(a,b);
if(c%a==0){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
}
| a.cc: In function 'int main()':
a.cc:39:14: error: expected primary-expression before '>' token
39 | cin >> a >>> b >> c;
| ^
|
s486218336 | p03730 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
#define mp make_pair
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};
ll gcd(ll a,ll b){
if(a%b==0){
return b;
}
else{
return gcd(b,a%c);
}
}
int main() {
ll a,b,c;
cin >> a >>> b >> c;
a=gcd(a,b);
if(c%a==0){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}
} | a.cc: In function 'll gcd(ll, ll)':
a.cc:33:20: error: 'c' was not declared in this scope
33 | return gcd(b,a%c);
| ^
a.cc: In function 'int main()':
a.cc:39:14: error: expected primary-expression before '>' token
39 | cin >> a >>> b >> c;
| ^
|
s021992098 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C;
cin >> A >> B >> C;
for(int i=1;i<B+1){
if((A*i)%B==C){
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
}
| a.cc: In function 'int main()':
a.cc:7:20: error: expected ';' before ')' token
7 | for(int i=1;i<B+1){
| ^
| ;
|
s073437046 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A<B<C;
cin >> A >> B >> C;
for(int i=1;i<B+1){
if((A*i)%B==C){
cout << "YES" << endl;
return 0;
}
}
cout << "NO" << endl;
} | a.cc: In function 'int main()':
a.cc:5:8: error: expected initializer before '<' token
5 | int A<B<C;
| ^
a.cc:6:10: error: 'A' was not declared in this scope
6 | cin >> A >> B >> C;
| ^
a.cc:6:15: error: 'B' was not declared in this scope
6 | cin >> A >> B >> C;
| ^
a.cc:6:20: error: 'C' was not declared in this scope
6 | cin >> A >> B >> C;
| ^
a.cc:7:20: error: expected ';' before ')' token
7 | for(int i=1;i<B+1){
| ^
| ;
|
s591763085 | p03730 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int A,B,C,sum=0;
cin >> A >> B >> C;
bool a=false;
for(int i=A;i<B*A+1;i+=A){
sum+=A;
if(sum%B==C){
a=true;
break;
}
}
if(a){
cout << "YES" << endl;
}
else{
cout << "NO" << endl;
}A
} | a.cc: In function 'int main()':
a.cc:20:5: error: expected ';' before '}' token
20 | }A
| ^
| ;
21 | }
| ~
|
s676539733 | p03730 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main(){
int a,b,c;
cin >>a >>b >>c;
for(int i = 1; i<=b; i++){
if(i*a%b==c){
cout << "YES" << endl;
return 0;
}
cout << "NO" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:2: error: expected '}' at end of input
16 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s243876905 | p03730 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
int main() {
int a,b,c;cin>>a>>b>>c;
b=b/_gcd(a,b);
if(c%b==0){
cout<<"NO"<<endl;
}else{
cout<<"YES"<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:41:9: error: '_gcd' was not declared in this scope
41 | b=b/_gcd(a,b);
| ^~~~
|
s215599312 | p03730 | C++ | #include<bits/stdc++.h>
// #include <boost/lexical_cast.hpp>
using namespace std;
#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>>
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;}
vll factor(ll n){
vll ans;
if(n>0)ans.pb(1);if(n==2)ans.pb(2);
for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
return ans;
}
ll fact(ll n){
ll res = 1;
for (ll i = 2; i <= n; i++)
res = res * i;
return res;
}
int nCr(ll n, ll r)
{
return fact(n) / (fact(r) * fact(n - r));
}
void dfs(vllv &v,ll k,vll &par,vll &dis,ll p)
{
par[k]=p;
dis[k]=dis[p]+1;
for(ll i=0;i<v[k].sz;i++){
if(v[k][i]!=p){
dfs(v,v[k][i],par,dis,k);
}
}
}
bool sortbysec(const pair<string,int> &a,const pair<string,int> &b){return (a.second<b.second);}
ll ston(string s)
{
stringstream geek(s);
ll x = 0;
geek >> x;
return x;
}
ll pow2(ll n,ll k){ll ans=1;
while(k>0){
if(k%2==1)ans=ans*n;n=n*n;k/=2;
}return ans;}
bool prime(int n){
int i,j;
for(i=2;i<=sqrt(n);i++){
if(n%i==0){
return false;
}
}
return true;
}
bool bserch(vector<string> a, string s){
ll l=0,r=a.sz-1,mid;
while(l<=r){
mid=(l+r)/2;
if(a[mid]==s)return true;
if(a[mid]<s){
l=mid+1;
}else{
r=mid-1;
}
}
return false;
}
bool sortcol( const vector<int>& v1,
const vector<int>& v2 ) {
return v1[0] < v2[0];
}
ll degit(ll n)
{
ll t=0;
while(n>0)
{
t++;
n/=10; }
return t;
}
void solve()
{
ll a,b,c;
cin>>a>>b>>c;
if(c%_gcd(a,b)!=0)
cout<<"NO";
else
cout<<"YES";
return;
}
int main()
{
fast;
ll q;
q=1;
// cin>>q;
while(q--)
{
solve();
}
return 0;
} | a.cc: In function 'void solve()':
a.cc:108:14: error: '_gcd' was not declared in this scope
108 | if(c%_gcd(a,b)!=0)
| ^~~~
|
s541245765 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main(){
int a,b,c;
cin>>a>>b>>c;
for(int i=a;i<a*b+1;i++){
if(i%b==c){
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO";
return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main(){
int a,b,c;
cin>>a>>b>>c;
for(int i=a;i<a*b+1;i++){
if(i%b==c){
cout<<"YES"<<endl;
return 0;
}
}
cout<<"NO";
return 0;
}
| a.cc:29:5: error: redefinition of 'int main()'
29 | int main(){
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main(){
| ^~~~
|
s874779216 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
Init();
ll a, b, c; cin >> a >> b >> c;
ll add = a%b;
if(add == 0){
if(add == c){
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
for(ll i=add; i<=10000; i+=add)
{
if(i%b == c){
cout<<"YES";
return 0; }
}
NO();
}
| a.cc: In function 'int main()':
a.cc:7:5: error: 'Init' was not declared in this scope
7 | Init();
| ^~~~
a.cc:8:5: error: 'll' was not declared in this scope
8 | ll a, b, c; cin >> a >> b >> c;
| ^~
a.cc:8:24: error: 'a' was not declared in this scope
8 | ll a, b, c; cin >> a >> b >> c;
| ^
a.cc:8:29: error: 'b' was not declared in this scope
8 | ll a, b, c; cin >> a >> b >> c;
| ^
a.cc:8:34: error: 'c' was not declared in this scope
8 | ll a, b, c; cin >> a >> b >> c;
| ^
a.cc:10:8: error: expected ';' before 'add'
10 | ll add = a%b;
| ^~~~
| ;
a.cc:12:8: error: 'add' was not declared in this scope; did you mean 'std::filesystem::perm_options::add'?
12 | if(add == 0){
| ^~~
| std::filesystem::perm_options::add
In file included from /usr/include/c++/14/filesystem:51,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:219:7: note: 'std::filesystem::perm_options::add' declared here
219 | add = 0x2,
| ^~~
a.cc:15:10: error: expected '}' before 'else'
15 | else cout<<"NO"<<endl;
| ^~~~
a.cc:13:22: note: to match this '{'
13 | if(add == c){
| ^
a.cc: At global scope:
a.cc:20:5: error: expected unqualified-id before 'for'
20 | for(ll i=add; i<=10000; i+=add)
| ^~~
a.cc:20:19: error: 'i' does not name a type
20 | for(ll i=add; i<=10000; i+=add)
| ^
a.cc:20:29: error: 'i' does not name a type
20 | for(ll i=add; i<=10000; i+=add)
| ^
a.cc:26:9: error: expected constructor, destructor, or type conversion before ';' token
26 | NO();
| ^
a.cc:27:1: error: expected declaration before '}' token
27 | }
| ^
|
s579812515 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
/*
int main(){
Init();
ll a, b, c; cin >> a >> b >> c;
ll add = a%b;
if(add == 0){
if(add == c){
cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
for(ll i=add; i<=10000; i+=add)
{
if(i%b == c){
cout<<"YES";
return 0; }
}
NO();
} | a.cc:5:1: error: unterminated comment
5 | /*
| ^
|
s525137277 | p03730 | C++ | #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
const int inf = 1000000000; //10^9
const ll MOD = 1e9 + 7;
//加算代入演算子は+=!!!!!
//int 2^31 10^9まで
//intは10桁、long longは18桁、doubleは308桁、long double は4932桁
int main()
{
int main()
{
int A, B, C;
string ans = "NO";
cin >> A >> B >> C;
for (int i = 1; i < B + 1; i++)
{
if ((A * i) % B == C)
{
ans = "YES";
break;
}
}
cout << ans << endl;
return 0;
}
} | a.cc: In function 'int main()':
a.cc:15:13: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
15 | int main()
| ^~
a.cc:15:13: note: remove parentheses to default-initialize a variable
15 | int main()
| ^~
| --
a.cc:15:13: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:5: error: a function-definition is not allowed here before '{' token
16 | {
| ^
|
s716345300 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C;
cin >> A >> B >> C;
if(C%gcd__(A,B) == 0) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
} | a.cc: In function 'int main()':
a.cc:7:10: error: 'gcd__' was not declared in this scope
7 | if(C%gcd__(A,B) == 0) {
| ^~~~~
|
s402525885 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define SQ(a) (a)*(a)
template <class T, class U> ostream& operator<< (ostream &out, pair<T,U> c) { out << "(" << c.first << " "; out << c.second << ")"; return out; }
template <class T> ostream& operator<< (ostream &out, vector<T> c) { for (auto it = c.begin(); it != c.end(); ++it) { if (it != c.begin()) out << " "; out << *it; } return out; }
const double PI = 3.141592653589793238463;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int a, b, c;
cin >> a >> b >> c;
set<int> rem;
bool t = true;
while (t)
{
if(a%b == c){
cout << "YES";
break;
}
else
{
if(rem.find(a%b) == rem.end()){
rem.insert(a%b);
a += a
}
else
{
cout << "NO";
break;
}
}
}
cout << endl;
} | a.cc: In function 'int main()':
a.cc:39:23: error: expected ';' before '}' token
39 | a += a
| ^
| ;
40 | }
| ~
|
s761617891 | p03730 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <ctime>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>
#include <bitset>
#include <list>
#include <cstdio>
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <cmath>
#include <tuple>
#include <cassert>
#include <array>
#include <iomanip>
using namespace std;
using pii = pair<int, int>;
using ti = tuple<int, int, int>;
const double eps=1e-14;
const int mod = 1e9 + 7;
const int inf = ((1<<30));
const long long linf = (1LL<<60);
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int a, b, c;
cin >> a >> b >> c;
a %= b;
ok = false;
for(int i=0; i<b; i++)
{
int tmp = a*i;
tmp %= b;
if(tmp == c)
{
ok = true;
break;
}
}
if(ok) cout << "YES" << endl;
else cout << "NO" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:41:5: error: 'ok' was not declared in this scope
41 | ok = false;
| ^~
|
s600192311 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C;
if (B<=C) cout << "NO" << endl;
else {
for (int i=0; i<A; i++) {
if (A%i==0 && B%i==0 && C%i!=0) {
cout << "NO" << break;
}
if (i==A-1) cout << "YES" << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:10:31: error: expected primary-expression before 'break'
10 | cout << "NO" << break;
| ^~~~~
|
s023901542 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
const int MOD = 1e9+7;
int main() {
ll N,T;
cin >> N >> T;
vll t(N);
rep(i,n){
cin >> t[i];
}
ll ans=T;
rep(i,n){
if(t[i] >= T) ans += T;
else ans += t[i];
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:17:9: error: 'vll' was not declared in this scope; did you mean 'll'?
17 | vll t(N);
| ^~~
| ll
a.cc:18:15: error: 'n' was not declared in this scope
18 | rep(i,n){
| ^
a.cc:5:38: note: in definition of macro 'rep'
5 | #define rep(i, n) for(int i = 0; i < n; i++)
| ^
a.cc:19:16: error: 't' was not declared in this scope
19 | cin >> t[i];
| ^
a.cc:22:15: error: 'n' was not declared in this scope
22 | rep(i,n){
| ^
a.cc:5:38: note: in definition of macro 'rep'
5 | #define rep(i, n) for(int i = 0; i < n; i++)
| ^
a.cc:23:12: error: 't' was not declared in this scope
23 | if(t[i] >= T) ans += T;
| ^
|
s289586769 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
using vi = vector<int>;
using vs = vector<string>;
const int MOD = 1e9+7;
int gcd(int a, int b){
if (a%b == 0) return(b);
else return(gcd(b, a%b));
}
int main() {
int A,B,C;
cin >> A >>B >>C;
bool frag;
g = gcd(A,B);
if(C%g == 0)cout << "YES" << endl;
else cout << "NO" << endl;
} | a.cc: In function 'int main()':
a.cc:21:9: error: 'g' was not declared in this scope
21 | g = gcd(A,B);
| ^
|
s478594590 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
int a,b,c;
ll wa=0;
bool hantei=false;
cin >> a >> b >> c;
rep(i,100{
wa += a;
if(wa%b == c) hantei=true;
}
if(hantei) cout << "YES"<<endl;
else cout << "NO" <<endl;
} | a.cc:16:2: error: unterminated argument list invoking macro "rep"
16 | }
| ^
a.cc: In function 'int main()':
a.cc:10:5: error: 'rep' was not declared in this scope
10 | rep(i,100{
| ^~~
a.cc:10:8: error: expected '}' at end of input
10 | rep(i,100{
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s276028006 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
int main(){
int a,b,c;
ll wa=0;
bool hantei=false;
cin >> a >> b >> c;
rep(i,100{
wa += a;
if(wa%b == c) hantei=true;
}
if(hantei) cout << "YES"<<endl;
else cout << "NO" <<endl;
} | a.cc:16:2: error: unterminated argument list invoking macro "rep"
16 | }
| ^
a.cc: In function 'int main()':
a.cc:10:5: error: 'rep' was not declared in this scope
10 | rep(i,100{
| ^~~
a.cc:10:8: error: expected '}' at end of input
10 | rep(i,100{
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s018194311 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b){
if (b==0) return a;
else return gcd(b,a%b);
}
long long chmax(long long a,long long b){
a = max(a,b);
}
long long chmin(long long a, long long b){
a = min(a,b);
}
int main() {
long long n,k,sum=0,a=0,b=0,c=0,d=0,ans=0;
long long MOD = 1000000007;
long long INF = 1LL << 60;
string S="";
cin >> a >> b >> c;
if(c%gcd(a,b)==0) S = "YES";
else S = "NO"
cout << S << endl;
} | a.cc: In function 'long long int chmax(long long int, long long int)':
a.cc:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
10 | }
| ^
a.cc: In function 'long long int chmin(long long int, long long int)':
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
a.cc: In function 'int main()':
a.cc:22:16: error: expected ';' before 'cout'
22 | else S = "NO"
| ^
| ;
23 |
24 | cout << S << endl;
| ~~~~
|
s345179708 | p03730 | C++ | #include <bits/stdc++.h>
#include<chrono>
using namespace std;
using ll = long long;
int main() {
int A, B, C;
cin >> A >> B >> C;
for (int i = 1; i <= B; i++) {
if (i*A % B == C) {
cout << "YES" << end;
return 0;
}
}
cout << "NO" << endl;
}
| a.cc: In function 'int main()':
a.cc:11:21: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
11 | cout << "YES" << end;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
30 |
s766618079 | p03730 | C | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
int main() {
int a, b, c; cin >> a >> b >> c;
int zero_count=0;
int tmp = 1;
while(zero_count < 1) {
int tmp_c = a*tmp%b;
if(tmp_c == c) {
cout << "YES" << endl;
return 0;
}
if(tmp_c == 0) zero_count++;
tmp++;
}
cout << "NO" << endl;
return 0;
| main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s684897155 | p03730 | C | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
int main() {
int a, b, c; cin >> a >> b >> c;
int zero_count=0;
int tmp = 1;
while(zero_count < 1) {
int tmp_c = a*tmp%b;
if(tmp_c == c) {
cout << "YES" << endl;
return 0;
}
if(tmp_c == 0) zero_count++;
tmp++;
}
cout << "NO" << endl;
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s559140235 | p03730 | Java | import java.io.*;
import java.util.*;
class Main{
static final long MOD = 1_000_000_007; // 10^9+7
static final int MAX = 2_147_483_646; // intMax
static final int INF = 1_000_000_000; // 10^9
public static void main(String[] args) throws Exception {
hayami saori = new hayami();
int a = saori.saori_hayami();
int b = saori.saori_hayami();
int c = saori.saori_hayami();
for (int i = 1; i <= b; i++) {
if ((a * i) % b == c) {
ans = "YES";
break;
}
}
System.out.println(ans);
saori.close();
}
}
class hayami implements Closeable {
private final InputStream in = System.in;
private final byte[] hayami = new byte[1024];
private int Hayami = 0;
private int saori = 0;
private boolean HayamiSaori() {
if (Hayami < saori) {
return true;
}else{
Hayami = 0;
try {
saori = in.read(hayami);
} catch (IOException e) {
e.printStackTrace();
}
if (saori <= 0) {
return false;
}
}
return true;
}
private int SaoriHayami() {
if (HayamiSaori()) {
return hayami[Hayami++];
}else{
return -1;
}
}
private static boolean hayami_saori(int hayami) {
return 33 <= hayami && hayami <= 126;
}
public boolean hayamisaori() {
while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
}
public String nextHayami() {
if (!hayamisaori()) throw new NoSuchElementException();
StringBuilder hayamin = new StringBuilder();
int saori = SaoriHayami();
while(hayami_saori(saori)) {
hayamin.appendCodePoint(saori);
saori = SaoriHayami();
}
return hayamin.toString();
}
public long saorihayami() {//nextLong
if (!hayamisaori()) throw new NoSuchElementException();
long hayami = 0;
boolean misao = false;
int saori = SaoriHayami();
if (saori == '-') {
misao = true;
saori = SaoriHayami();
}
if (saori < '0' || '9' < saori) {
throw new NumberFormatException();
}
while(true){
if ('0' <= saori && saori <= '9') {
hayami *= 10;
hayami += saori - '0';
}else if(saori == -1 || !hayami_saori(saori)){
return misao ? -hayami : hayami;
}else{
throw new NumberFormatException();
}
saori = SaoriHayami();
}
}
public int saori_hayami() {//nextInt
long hayami = saorihayami();
if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
return (int) hayami;
}
public double Hayamin() { //nextDouble
return Double.parseDouble(nextHayami());
}
public void close() {
try {
in.close();
} catch (IOException e) {
}
}
} | Main.java:14: error: cannot find symbol
ans = "YES";
^
symbol: variable ans
location: class Main
Main.java:18: error: cannot find symbol
System.out.println(ans);
^
symbol: variable ans
location: class Main
2 errors
|
s975117582 | p03730 | C++ | import math
a, b, c = map(int,input().split())
for i in range(10**7):
n = a * i
if n % b == c:
print('YES')
quit()
print('NO') | a.cc:7:15: warning: multi-character character constant [-Wmultichar]
7 | print('YES')
| ^~~~~
a.cc:9:7: warning: multi-character character constant [-Wmultichar]
9 | print('NO')
| ^~~~
a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s070634832 | p03730 | C++ | // include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
// func
// ------------------------------------------------
int CalcSumOfDigit(int n); // 各桁の和を計算する。
string upper(string str); // 英字を大文字に変換する。
string lower(string str); // 英字を小文字に変換する。
// define
// ------------------------------------------------
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define sz(a) int((a).size())
#define rep(i,n) for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n) for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v) sort((v).begin(),(v).end())
#define rvsort(v) sort(rall((v)))
#define vi vector<int>
#define GCD(a,b) __gcd((a),(b))
#define LCM(a,b) (a)/GCD((a),(b))*(b)
#define kiriage(a,b) ((a)+(b)-1)/(b)
const int INF = 1e9;
// code
// ------------------------------------------------
int main() {
int a,b,c;
cin >> a >> b >> c;
for(int i = a;i = a * b;i++)
{
if(i % b == c) {cout <<"YES"<<endl;return 0;
}
cout << "NO" << endl;
return 0;
}
// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
int s = 0;
while(n)
{
s += n % 10;
n = n / 10;
}
return s;
}
string upper(string str)
{
for(auto itr = str.begin();itr != str.end() ; itr++)
{
if(97 <= *itr && *itr <= 122)
{
*itr = *itr - 32;
}
}
return str;
}
string lower(string str)
{
for(auto itr = str.begin();itr != str.end() ; itr++)
{
if(65 <= *itr && *itr <= 90)
{
*itr = *itr + 32;
}
}
return str;
}
| a.cc: In function 'int main()':
a.cc:51:1: error: a function-definition is not allowed here before '{' token
51 | {
| ^
a.cc:62:1: error: a function-definition is not allowed here before '{' token
62 | {
| ^
a.cc:74:1: error: a function-definition is not allowed here before '{' token
74 | {
| ^
a.cc:83:2: error: expected '}' at end of input
83 | }
| ^
a.cc:34:12: note: to match this '{'
34 | int main() {
| ^
|
s644193849 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long; // ll は long long と同じとする。
int main () {
int A , B , C;
cin >> A >> B >> C;
for(ll i = 0; i < N; )
for(int i = 0; i < B; i++){
if((i * A) % B == C){
cout << "YES";
return 0;
}
}
cout << "No" << endl;
}
| a.cc: In function 'int main()':
a.cc:7:23: error: 'N' was not declared in this scope
7 | for(ll i = 0; i < N; )
| ^
|
s881521865 | p03730 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);
//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
// ll a, b;
// cin >> a >> b;
// work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };
//最大公約数
ll gcd(ll x, ll y) {
return y ? gcd(y, x % y) : x;
}
ll lcm(ll x, ll y) {
if (x == 0 || y == 0)return 0;
return (x / gcd(x, y) * y);
}
//素因数分解
vector<pair<ll, int>>factorize(ll n) {
vector<pair<ll, int>>res;
for (ll i = 2;i * i <= n;++i) {
if (n % i)continue;
res.emplace_back(i, 0);
while (n % i == 0) {
n /= i;
res.back().second++;
}
}
if (n != 1)res.emplace_back(n, 1);
return res;
}
int bingo[3][3];
bool flag[3][3];
int cnt[2][105];
int h, w;
int choco[1010][1010];
int s[11][11];
int main() {
int a, b, c;
vector<bool>d(b);
cin >> a >> b >> c;
for (int i = 1;i < 1010;++i) {
int target = a * i;
int amari = target % b;
if (b[amari]) {
break;
}
b[amari] = true;
}
if (b[c])puts("YES");
else puts("NO");
return 0;
}
| a.cc: In function 'int main()':
a.cc:67:22: error: invalid types 'int[int]' for array subscript
67 | if (b[amari]) {
| ^
a.cc:70:18: error: invalid types 'int[int]' for array subscript
70 | b[amari] = true;
| ^
a.cc:72:14: error: invalid types 'int[int]' for array subscript
72 | if (b[c])puts("YES");
| ^
|
s757168768 | p03730 | C++ | #include <bits/stdc++.h>
using nameapase std;
int main(){
int A,B,C;
cin >> A >> B >> C;
bool res = false;
for(int i =1;i <B;i++){
if(k*A%B == C)ans = true;
}
if(ans)cout << "Yes" << endl;
else cout << "No" <<endl;
} | a.cc:2:7: error: expected nested-name-specifier before 'nameapase'
2 | using nameapase std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin >> A >> B >> C;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:8:12: error: 'k' was not declared in this scope
8 | if(k*A%B == C)ans = true;
| ^
a.cc:8:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
8 | if(k*A%B == C)ans = true;
| ^~~
| abs
a.cc:10:12: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | if(ans)cout << "Yes" << endl;
| ^~~
| abs
a.cc:10:16: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
10 | if(ans)cout << "Yes" << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:10:33: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
10 | if(ans)cout << "Yes" << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
a.cc:11:14: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
11 | else cout << "No" <<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:11:29: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
11 | else cout << "No" <<endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s042262497 | p03730 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int C = sc.nextInt();
int m = lcm(a,b);
if(C%m==0){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
//最大公約数・最小公倍数(セットで使う)
public static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
public static int lcm (int a, int b) {return a*b/gcd(a,b);}
}
| Main.java:8: error: cannot find symbol
int m = lcm(a,b);
^
symbol: variable a
location: class Main
Main.java:8: error: cannot find symbol
int m = lcm(a,b);
^
symbol: variable b
location: class Main
2 errors
|
s700564434 | p03730 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int C = sc.nextInt();
int m = lcm(a,b);
if(C%m==0){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
//最大公約数・最小公倍数(セットで使う)
static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
static int lcm (int a, int b) {return a*b/gcd(a,b);}
} | Main.java:8: error: cannot find symbol
int m = lcm(a,b);
^
symbol: variable a
location: class Main
Main.java:8: error: cannot find symbol
int m = lcm(a,b);
^
symbol: variable b
location: class Main
2 errors
|
s845038464 | p03730 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9
int main(){
int a,b,c;scanf("%d%d%d",&a,&b,&c);
int sum=a;
for(int i = 0;i < 1000000000000;i++){
if(sum%b==c){
//printf("%d %d %d %d\n",a,b,c,a*i%b);
printf("YES\n");
return 0;
}
sum+=a
}
printf("NO\n");
return 0;
}
| main.c: In function 'main':
main.c:18:13: error: expected ';' before '}' token
18 | sum+=a
| ^
| ;
19 | }
| ~
|
s188030054 | p03730 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9
int main(){
int a,b,c;scanf("%d%d%d",&a,&b,&c);
int i=1;
int _a= a;
if(_a%b == (_a+a*(i+1))%b){
printf("NO\n");
break;
}
while(1){
if(_a%b == c){
printf("YES\n");
break;
}
i++;
_a += a*i;
}
}
| main.c: In function 'main':
main.c:15:7: error: break statement not within loop or switch
15 | break;
| ^~~~~
|
s471932385 | p03730 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX(a,b) (a > b) ? a : b
#define MIN(a,b) (a < b) ? a : b
const int inf = 1000000000; // 10^9
int main(){
int a,b,c;scanf("%d%d%d",&a,&b,&c);
int i=1;
int _a=0;
while(1){
_a += a*i
if(_a%b == c){
printf("YES\n");
break;
}
if(_a%b == _a+a*(i+1)%b){
printf("NO\n");
break;
}
i++;
}
} | main.c: In function 'main':
main.c:14:16: error: expected ';' before 'if'
14 | _a += a*i
| ^
| ;
15 | if(_a%b == c){
| ~~
|
s355317705 | p03730 | C++ | N#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using P = pair<int, int>;
int main() {
long long a,b,c;
cin >> a >> b >> c;
rep(i,10000000){
if((a*i +1 ) % b == 0){
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
} | a.cc:1:2: error: stray '#' in program
1 | N#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'N' does not name a type
1 | N#include <bits/stdc++.h>
| ^
a.cc:4:11: error: 'pair' does not name a type
4 | using P = pair<int, int>;
| ^~~~
a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope
9 | cin >> a >> b >> c;
| ^~~
a.cc:13:13: error: 'cout' was not declared in this scope
13 | cout << "Yes" << endl;
| ^~~~
a.cc:13:30: error: 'endl' was not declared in this scope
13 | cout << "Yes" << endl;
| ^~~~
a.cc:18:5: error: 'cout' was not declared in this scope
18 | cout << "No" << endl;
| ^~~~
a.cc:18:21: error: 'endl' was not declared in this scope
18 | cout << "No" << endl;
| ^~~~
|
s217505227 | p03730 | C++ | import math
A,B,C=map(int,input().split())
lcm = A*B//math.gcd(A,B)
#A*(i+j)%B=C
#A*(i+j)=BX+C
i=A
while i<=lcm:
if i%B==C:
print("YES")
exit()
i*=A
print("NO") | a.cc:4:2: error: invalid preprocessing directive #A
4 | #A*(i+j)%B=C
| ^
a.cc:5:2: error: invalid preprocessing directive #A
5 | #A*(i+j)=BX+C
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s408792521 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C; cin >> A >> B >> C;
for (int i = A; i <= B*A; i++) {
if (i%B == C) {
cout << "YES" << endl;
return;
}
}
cout << "NO" << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:9:13: error: return-statement with no value, in function returning 'int' [-fpermissive]
9 | return;
| ^~~~~~
|
s958555863 | p03730 | C++ | #include<stdio.h>
#include<string.h>
//言語は「C++14(GCC 5.4.1)」
//AtCoder Beginner Contest 60-A
int main(void)
{
int i, A, B, C, K=0;
scanf("%d", &A);
scanf("%d", &B);
scanf("%d", &C);
for (i = 1; i < 5051; i++)
{
A = A * i;
if (A%B == C)
{
K = 15;
break;
}
}
if (K == 15)
printf("YES");
else
printf("NO");
return 0;
}#include<stdio.h>
#include<string.h>
//言語は「C++14(GCC 5.4.1)」
//AtCoder Beginner Contest 60-A
int main(void)
{
int i, A, B, C, K=0;
scanf("%d", &A);
scanf("%d", &B);
scanf("%d", &C);
for (i = 1; i < 5051; i++)
{
A = A * i;
if (A%B == C)
{
K = 15;
break;
}
}
if (K == 15)
printf("YES");
else
printf("NO");
return 0;
} | a.cc:26:2: error: stray '#' in program
26 | }#include<stdio.h>
| ^
a.cc:26:3: error: 'include' does not name a type
26 | }#include<stdio.h>
| ^~~~~~~
|
s069392539 | p03730 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int A, B, C;
cin >> A >> B >> C;
int amari = A%B;
vector<int> num(B);
for(i = 1; i <= 100; i++){
num[A%B]++;
A = A*(i + 1)/i;
}
if(num[C] > 0) cout << "YES" << endl;
else cout << "NO" << endl;
} | a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
9 | for(i = 1; i <= 100; i++){
| ^
|
s984377123 | p03730 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long ll;
template <class T>
inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template <class T>
inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int total = 0;
for (size_t i = 1; i < 10000; i++) {
if (i % a == 0) {
total += a;
if (total % b == c) {
cout << "YES" << endl;
return 0;
}
} = 0;
}
cout << "NO" << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:36:7: error: expected primary-expression before '=' token
36 | } = 0;
| ^
|
s344253675 | p03730 | C++ | #iclude <bits/stdc++.h>
using namespace std;
int main(){
int A, B, C;
cin >> A >> B >> C;
vector<int> data(B);
int count = 0;
int point = 0;
for(int i = 0; i < B; i++){
data.at(i) = ((i+1)*A)%B;
count += data.at(i);
if(count == C){
point = 1;
break;
}
}
if(point == 1) cout << "YES" << endl;
else cout << "NO" << endl;
} | a.cc:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
1 | #iclude <bits/stdc++.h>
| ^~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> A >> B >> C;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #iclude <bits/stdc++.h>
a.cc:7:3: error: 'vector' was not declared in this scope
7 | vector<int> data(B);
| ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
+++ |+#include <vector>
1 | #iclude <bits/stdc++.h>
a.cc:7:10: error: expected primary-expression before 'int'
7 | vector<int> data(B);
| ^~~
a.cc:11:5: error: 'data' was not declared in this scope
11 | data.at(i) = ((i+1)*A)%B;
| ^~~~
a.cc:18:18: error: 'cout' was not declared in this scope
18 | if(point == 1) cout << "YES" << endl;
| ^~~~
a.cc:18:18: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:35: error: 'endl' was not declared in this scope
18 | if(point == 1) cout << "YES" << endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | #iclude <bits/stdc++.h>
a.cc:19:8: error: 'cout' was not declared in this scope
19 | else cout << "NO" << endl;
| ^~~~
a.cc:19:8: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:19:24: error: 'endl' was not declared in this scope
19 | else cout << "NO" << endl;
| ^~~~
a.cc:19:24: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.