submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s694393474
p00034
C
#include <stdio.h> int main() { double L[10]; double V1, V2; double meet_pos; double railway_lenth; int cnt1, cnt2; int output[50]; cnt2 = 0; while(1) { if(scanf("%lf,", &L[0]) == EOF) { break; } for(cnt1 = 1; cnt1 < 10; cnt1++) { scanf("%lf,", &L[cnt1]); } scanf("%lf,%lf", &V1, &V2); railway_lenth = 0; for(cnt1 = 0; cnt1 < 10; cnt1++) { railway_lenth += L[cnt1]; } meet_pos = railway_lenth * V1 / (V1 + V2); cnt1 = 0; railway_lenth = 0; while(railway_lenth <= meet_pos) { railway_lenth += L[cnt1]; cnt1++; } output[cnt2] = cnt1; cnt2++; } for(cnt1 = 0; cnt1 < cnt2; cnt1++) { printf("%d\n", output[cnt1]) } return 0; }
main.c: In function 'main': main.c:45:45: error: expected ';' before '}' token 45 | printf("%d\n", output[cnt1]) | ^ | ; 46 | } | ~
s337405875
p00034
C
#include <stdio.h> main(){ int n[10],a,b,i,nsum,m; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5],&n[6],&n[7],&n[8],&n[9],&a,&b) !=EOF){ double t=0,x; nsum=0; for(i=0;i<10;i++){#include <stdio.h> main(){ int n[10],a,b,i,nsum,m; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5],&n[6],&n[7],&n[8],&n[9],&a,&b) !=EOF){ double t=0,x; nsum=0; for(i=0;i<10;i++){ nsum+=n[i]; } t=nsum/(double)(a+b); x=t*(double)a; m=0; for(i=0;i<10;i++){ if((double)x-m>0&&(double)x-m<n[i]){ i++; break; } else if(x-m==0) break; else m+=n[i]; } printf("%d\n",i); } return 0; } nsum+=n[i]; } t=nsum/(double)(a+b); x=t*(double)a; m=0; for(i=0;i<10;i++){ if((double)x-m>0&&(double)x-m<n[i]){ i++; break; } else if(x-m==0) break; else m+=n[i]; } printf("%d\n",i); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:7:22: error: stray '#' in program 7 | for(i=0;i<10;i++){#include <stdio.h> | ^ main.c:7:23: error: 'include' undeclared (first use in this function) 7 | for(i=0;i<10;i++){#include <stdio.h> | ^~~~~~~ main.c:7:23: note: each undeclared identifier is reported only once for each function it appears in main.c:7:32: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'? 7 | for(i=0;i<10;i++){#include <stdio.h> | ^~~~~ | stdin main.c:8:7: error: expected ';' before '{' token 8 | main(){ | ^ | ;
s718176490
p00034
C
#include <stdio.h> main(){ int n[10],a,b,i,nsum,m; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&n[0],&n[1],&n[2],&n[3],&n[4],&n[5],&n[6],&n[7],&n[8],&n[9],&a,&b) !=EOF){ double t=0,x; nsum=0; for(i=0;i<10;i++){ nsum+=n[i]; } t=nsum/(double)(a+b); x=t*(double)a; m=0; for(i=0;i<10;i++){ if((double)x-m>0&&(double)x-m<n[i]){ i++; break; } else if(x-m==0) break; else m+=n[i]; } printf("%d\n",i); } return 0; } nsum+=n[i]; } t=nsum/(double)(a+b); x=t*(double)a; m=0; for(i=0;i<10;i++){ if((double)x-m>0&&(double)x-m<n[i]){ i++; break; } else if(x-m==0) break; else m+=n[i]; } printf("%d\n",i); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c:27:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '+=' token 27 | nsum+=n[i]; | ^~ main.c:28:4: error: expected identifier or '(' before '}' token 28 | } | ^ main.c:29:4: warning: data definition has no type or storage class 29 | t=nsum/(double)(a+b); | ^ main.c:29:4: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] main.c:29:6: error: 'nsum' undeclared here (not in a function) 29 | t=nsum/(double)(a+b); | ^~~~ main.c:29:20: error: 'a' undeclared here (not in a function) 29 | t=nsum/(double)(a+b); | ^ main.c:29:22: error: 'b' undeclared here (not in a function) 29 | t=nsum/(double)(a+b); | ^ main.c:30:4: warning: data definition has no type or storage class 30 | x=t*(double)a; | ^ main.c:30:4: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:31:4: warning: data definition has no type or storage class 31 | m=0; | ^ main.c:31:4: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int] main.c:32:4: error: expected identifier or '(' before 'for' 32 | for(i=0;i<10;i++){ | ^~~ main.c:32:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 32 | for(i=0;i<10;i++){ | ^ main.c:32:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 32 | for(i=0;i<10;i++){ | ^~ main.c:40:11: error: expected declaration specifiers or '...' before string constant 40 | printf("%d\n",i); | ^~~~~~ main.c:40:18: error: unknown type name 'i' 40 | printf("%d\n",i); | ^ main.c:42:3: error: expected identifier or '(' before '}' token 42 | } | ^ main.c:43:3: error: expected identifier or '(' before 'return' 43 | return 0; | ^~~~~~ main.c:44:1: error: expected identifier or '(' before '}' token 44 | } | ^
s078210618
p00034
C
#include<stdio.h> int main() { int v1,v2; int dist[10]; int dist0to10; int i,station; double intersect,tmp; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) { dist0to10=0; tmp=0; for(i=0;i<10;i++) { dist0to10+=dist[i]; } intersect=(double)(v1*dist0to10)/(v1+v2); printf("%lf ",intersect); for(i=0;i<10;i++) { tmp+=(double)dist[i]; if(tmp>=intersect) { station=i+1; break; } } printf("%d\n",station); } return 0; }
main.c: In function 'main': main.c:11:21: warning: missing terminating " character 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:11:21: error: missing terminating " character 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:2: warning: missing terminating " character 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ main.c:13:2: error: missing terminating " character 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:1: error: 'd' undeclared (first use in this function) 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in main.c:13:2: error: expected ')' before '{' token 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ | ) 14 | { | ~ main.c:11:20: note: to match this '(' 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:37:18: error: expected ')' before '}' token 37 | return 0; | ^ | ) 38 | } | ~ main.c:11:14: note: to match this '(' 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:38:1: error: expected expression before '}' token 38 | } | ^
s065010890
p00034
C
#include<stdio.h> int main() { int v1,v2; int dist[10]; int dist0to10; int i,station; double intersect,tmp; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) { dist0to10=0; tmp=0; for(i=0;i<10;i++) { dist0to10+=dist[i]; } intersect=(double)(v1*dist0to10)/(v1+v2); for(i=0;i<10;i++) { tmp+=(double)dist[i]; if(tmp>=intersect) { station=i+1; break; } } printf("%d\n",station); } return 0; }
main.c: In function 'main': main.c:11:21: warning: missing terminating " character 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:11:21: error: missing terminating " character 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:2: warning: missing terminating " character 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ main.c:13:2: error: missing terminating " character 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:1: error: 'd' undeclared (first use in this function) 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in main.c:13:2: error: expected ')' before '{' token 13 | d",dist,dist+1,dist+2,dist+3,dist+4,dist+5,dist+6,dist+7,dist+8,dist+9,&v1,&v2)!=EOF) | ^ | ) 14 | { | ~ main.c:11:20: note: to match this '(' 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:36:18: error: expected ')' before '}' token 36 | return 0; | ^ | ) 37 | } | ~ main.c:11:14: note: to match this '(' 11 | while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,% | ^ main.c:37:1: error: expected expression before '}' token 37 | } | ^
s056566221
p00034
C++
#include <iostream> #include <string> using namespace std; int main() { int l[10] , v1 , v2 , n , cnt; double d , t; char ch; while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ n=0; for(int i=0;i<10;i++){ n+=l[i]; } t=n/(v1+v2); d=v1*t; //列車1の動く距離 cnt=0; while(d>0){ d -= l[cnt]; cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:129: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:10:129: note: candidate: 'operator!=(int, int)' (built-in) 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^ a.cc:10:129: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:10:131: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF)){ |
s571094014
p00034
C++
#include <iostream> #include <string> using namespace std; int main() { int l[10] , v1 , v2 , n , cnt; double d , t; char ch; while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ n=0; for(int i=0;i<10;i++){ n+=l[i]; } t=n/(v1+v2); d=v1*t; //列車1の動く距離 cnt=0; while(d>0){ d -= l[cnt]; cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:127: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:10:127: note: candidate: 'operator!=(int, int)' (built-in) 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^ a.cc:10:127: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:10:129: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:10:129: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | while(cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2 !=EOF){ |
s271114989
p00034
C++
#include <iostream> #include <string> using namespace std; int main() { int l[10] , v1 , v2 , n , cnt; double d , t; char ch; while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ n=0; for(int i=0;i<10;i++){ n+=l[i]; } t=n/(v1+v2); d=v1*t; //列車1の動く距離 cnt=0; while(d>0){ d -= l[cnt]; cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:129: error: no match for 'operator!=' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int') 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ | | | std::basic_istream<char>::__istream_type {aka std::basic_istream<char>} a.cc:10:129: note: candidate: 'operator!=(int, int)' (built-in) 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^ a.cc:10:129: note: no known conversion for argument 1 from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/postypes.h:197:5: note: candidate: 'template<class _StateT> bool std::operator!=(const fpos<_StateT>&, const fpos<_StateT>&)' 197 | operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) | ^~~~~~~~ /usr/include/c++/14/bits/postypes.h:197:5: note: template argument deduction/substitution failed: In file included from /usr/include/c++/14/cstdio:42, from /usr/include/c++/14/ext/string_conversions.h:45, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::fpos<_StateT>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ In file included from /usr/include/c++/14/string:43: /usr/include/c++/14/bits/allocator.h:243:5: note: candidate: 'template<class _T1, class _T2> bool std::operator!=(const allocator<_CharT>&, const allocator<_T2>&)' 243 | operator!=(const allocator<_T1>&, const allocator<_T2>&) | ^~~~~~~~ /usr/include/c++/14/bits/allocator.h:243:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::allocator<_CharT>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ In file included from /usr/include/c++/14/string:48: /usr/include/c++/14/bits/stl_iterator.h:455:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)' 455 | operator!=(const reverse_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:455:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)' 500 | operator!=(const reverse_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:500:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)' 1686 | operator!=(const move_iterator<_IteratorL>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1686:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator!=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)' 1753 | operator!=(const move_iterator<_Iterator>& __x, | ^~~~~~~~ /usr/include/c++/14/bits/stl_iterator.h:1753:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51: /usr/include/c++/14/bits/stl_pair.h:1052:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator!=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)' 1052 | operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) | ^~~~~~~~ /usr/include/c++/14/bits/stl_pair.h:1052:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47: /usr/include/c++/14/string_view:651:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)' 651 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:651:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ /usr/include/c++/14/string_view:658:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)' 658 | operator!=(basic_string_view<_CharT, _Traits> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:658:5: note: template argument deduction/substitution failed: a.cc:10:131: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~~ /usr/include/c++/14/string_view:666:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator!=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)' 666 | operator!=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x, | ^~~~~~~~ /usr/include/c++/14/string_view:666:5: note: template argument deduction/substitution failed: a.cc:10:131: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int' 10 | while((cin>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ |
s311082425
p00034
C++
#include <iostream> #include <string> using namespace std; int main() { int l[10] , v1 , v2 , n , cnt; double d , t; char ch; while(cin(>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ n=0; for(int i=0;i<10;i++){ n+=l[i]; } t=n/(v1+v2); d=v1*t; //列車1の動く距離 cnt=0; while(d>0){ d -= l[cnt]; cnt++; } cout << cnt << endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:15: error: expected primary-expression before '>>' token 10 | while(cin(>>l[0]>>ch>>l[1]>>ch>>l[2]>>ch>>l[3]>>ch>>l[4]>>ch>>l[5]>>ch>>l[6]>>ch>>l[7]>>ch>>l[8]>>ch>>l[9]>>ch>>v1>>ch>>v2) !=EOF){ | ^~
s410625229
p00034
C++
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Main{ public static void main(String[] args)throws IOException{ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); String str; while((str = reader.readLine()) != null){ String[] code = str.split(",",0); int sum = 0; int[] station = new int[12]; for(int i = 0; i < 10; i++){ station[i] = Integer.parseInt(code[i]); sum += station[i]; } int v1 = Integer.parseInt(code[10]); int v2 = Integer.parseInt(code[11]); double x = 0,s = 0; for(int i = 0; i < 10; i++){ x += station[i]; s = x / v1; if(x + s * v2 >= sum){ System.out.println(i + 1); break; } } } reader.close(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.io.InputStreamReader; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:15: error: expected ':' before 'static' 6 | public static void main(String[] args)throws IOException{ | ^~~~~~~ | : a.cc:6:33: error: 'String' has not been declared 6 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:6:42: error: expected ',' or '...' before 'args' 6 | public static void main(String[] args)throws IOException{ | ^~~~ a.cc:6:46: error: expected ';' at end of member declaration 6 | public static void main(String[] args)throws IOException{ | ^ | ; a.cc:6:47: error: 'throws' does not name a type 6 | public static void main(String[] args)throws IOException{ | ^~~~~~ a.cc:33:2: error: expected ';' after class definition 33 | } | ^ | ;
s054010589
p00034
C++
$<.map{|i|*a,b,c=i.split(?,).map(&:to_f);s=0;p a.index{|j|(s+=j)>=a.reduce(:+)*b/(b+c)}+1}
a.cc:1:1: error: '$' does not name a type 1 | $<.map{|i|*a,b,c=i.split(?,).map(&:to_f);s=0;p a.index{|j|(s+=j)>=a.reduce(:+)*b/(b+c)}+1} | ^
s441967848
p00034
C++
#include <cstdio> using namespace std; #define SIZE 10 #define scanf scanf_s int main() { int l[SIZE] = { 0 }, v1, v2; double s; char t; while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2) != EOF) { s = 0; for (int i = 0; i < SIZE; i++) { s += l[i]; } s = s * v1 / (v1 + v2); for (int i = 0; i < 10; i++) { s -= l[i]; if (s <= 0) { printf("%d\n", i + 1); break; } } } return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | #define scanf scanf_s | ^~~~~~~ a.cc:11:16: note: in expansion of macro 'scanf' 11 | while (scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2) != EOF) { | ^~~~~
s928005760
p00034
C++
#include <iostream> #include <numeric> int main() { int lengthes[10]; char tmp; while (std::cin >> lengthes[0] >> tmp >> lengthes[1] >> tmp >> lengthes[2] >> tmp >> lengthes[3] >> tmp >> lengthes[4] >> tmp >> lengthes[5] >> tmp >> lengthes[6] >> tmp >> lengthes[7] >> tmp >> lengthes[8] >> tmp >> lengthes[9] >> tmp ) { int v1, v2; std::cin >> v1 >> tmp >> v2; int sum = std::accumulate(lengthes[0], lengthes[10], 0); double sec = (double)(sum) / (v1 + v2); double dist = v1 + sec; int all = 0; int index = 1; for (auto length : lengthes) { all += length; if (dist < all) { std::cout << index << std::endl; break; } index++; } } return 0; }
In file included from /usr/include/c++/14/numeric:62, from a.cc:2: /usr/include/c++/14/bits/stl_numeric.h: In instantiation of '_Tp std::accumulate(_InputIterator, _InputIterator, _Tp) [with _InputIterator = int; _Tp = int]': a.cc:13:28: required from here 13 | int sum = std::accumulate(lengthes[0], lengthes[10], 0); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/c++/14/bits/stl_numeric.h:141:48: error: invalid type argument of unary '*' (have 'int') 141 | __init = _GLIBCXX_MOVE_IF_20(__init) + *__first; | ^~~~~~~~
s462037150
p00034
C++
#include<iostream> #include<stdio.h> #include<vector> int main(){ int dis[10];int speed[2];vector<int> answers; while(scanf("%d,%d,%d,%d,%d,%d.%d,%d,%d,%d,%d,%d",&dis[0],&dis[1],&dis[2],&dis[3],&dis[4],&dis[5],&dis[6],&dis[7],&dis[8],&dis[9],&speed[0],&speed[1])!=EOF){ int all=0; for(int i=0;i<10;i++){ all+=dis[i]; } double addtion_speed=speed[0]+speed[1]; double same_time=all/addtion_spedd; double same_dis=speed[0]*same_time; double add_dis=0; int j=0; while(same_dis>add_dis){ add_dis+=dis[j]; j++; } if(same_dis==add_dis)j--; answers.push_back(j); } for(int i=0;i<answers.size();i++){ cout<<answers[i]<<endl; } }
a.cc: In function 'int main()': a.cc:5:28: error: 'vector' was not declared in this scope 5 | int dis[10];int speed[2];vector<int> answers; | ^~~~~~ a.cc:5:28: note: suggested alternatives: In file included from /usr/include/c++/14/vector:66, from a.cc:3: /usr/include/c++/14/bits/stl_vector.h:428:11: note: 'std::vector' 428 | class vector : protected _Vector_base<_Tp, _Alloc> | ^~~~~~ /usr/include/c++/14/vector:93:13: note: 'std::pmr::vector' 93 | using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>; | ^~~~~~ a.cc:5:35: error: expected primary-expression before 'int' 5 | int dis[10];int speed[2];vector<int> answers; | ^~~ a.cc:12:26: error: 'addtion_spedd' was not declared in this scope; did you mean 'addtion_speed'? 12 | double same_time=all/addtion_spedd; | ^~~~~~~~~~~~~ | addtion_speed a.cc:21:5: error: 'answers' was not declared in this scope 21 | answers.push_back(j); | ^~~~~~~ a.cc:23:17: error: 'answers' was not declared in this scope 23 | for(int i=0;i<answers.size();i++){ | ^~~~~~~ a.cc:24:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'? 24 | cout<<answers[i]<<endl; | ^~~~ | std::cout In file included from a.cc:1: /usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here 63 | extern ostream cout; ///< Linked to standard output | ^~~~ a.cc:24:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 24 | cout<<answers[i]<<endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41: /usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here 744 | endl(basic_ostream<_CharT, _Traits>& __os) | ^~~~
s092851105
p00034
C++
#include <cstdio> int main(){ int l[11],v1,v2;for(;~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2);printf("%d\n",i+1))for(int i=0;i<10;i++){l[i]+=l[i-1];if(l[i]>=l[9]*(v1/((double)v1+v2)))break;}}}
a.cc: In function 'int main()': a.cc:3:150: error: 'i' was not declared in this scope 3 | int l[11],v1,v2;for(;~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2);printf("%d\n",i+1))for(int i=0;i<10;i++){l[i]+=l[i-1];if(l[i]>=l[9]*(v1/((double)v1+v2)))break;}}} | ^ a.cc: At global scope: a.cc:3:233: error: expected declaration before '}' token 3 | int l[11],v1,v2;for(;~scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2);printf("%d\n",i+1))for(int i=0;i<10;i++){l[i]+=l[i-1];if(l[i]>=l[9]*(v1/((double)v1+v2)))break;}}} | ^
s994702804
p00034
C++
#include <cstdio> using namespace std; int main(){ int l[12], v1, v2; double sum,sum2; while( scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d", &l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&l[10],&v1,&v2) != EOF ){ sum = 0; for(int i=1 ; i<=10 ; i++){ sum += l[i]; } sum2 = ((double)sum)/(double)((v1+v2))*(double)(v1); sum = 0; for(int i=1 ; i<=10 ; i++){ sum += k[i]; if( sum <= sum2 ){ printf("%d\n", i); break; } } } return 0; }
a.cc: In function 'int main()': a.cc:18:32: error: 'k' was not declared in this scope 18 | sum += k[i]; | ^
s421223733
p00034
C++
#include<iostream> using namespace std; int main(){ int km[10],v1,v2; char a; &#160; &#160; double leng; while(1){ &#160; for(int i = 0; i < 10; i++) &#160; &#160; &#160; &#160; { &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; &#160; &#160; &#160; &#160; } &#160; &#160; &#160; &#160; if(!cin) &#160; &#160; &#160; &#160; &#160; &#160; break; &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; &#160; leng = 0.0; for(int k =0;k<10;k++) leng += km[k];&#160; double length = leng * v1 / (v1 +v2);&#160; leng = 0.0; &#160; for(int k=0;k<10;k++){ leng += &#160;km[k]; if(leng >= length ){ cout << k+1 <<endl; break; } } } }
a.cc:6:2: error: stray '#' in program 6 | &#160; &#160; double leng; | ^ a.cc:6:9: error: stray '#' in program 6 | &#160; &#160; double leng; | ^ a.cc:8:11: error: stray '#' in program 8 | &#160; for(int i = 0; i < 10; i++) | ^ a.cc:9:2: error: stray '#' in program 9 | &#160; &#160; &#160; &#160; { | ^ a.cc:9:9: error: stray '#' in program 9 | &#160; &#160; &#160; &#160; { | ^ a.cc:9:16: error: stray '#' in program 9 | &#160; &#160; &#160; &#160; { | ^ a.cc:9:23: error: stray '#' in program 9 | &#160; &#160; &#160; &#160; { | ^ a.cc:10:2: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:10:9: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:10:16: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:10:23: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:10:30: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:10:37: error: stray '#' in program 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:11:2: error: stray '#' in program 11 | &#160; &#160; &#160; &#160; } | ^ a.cc:11:9: error: stray '#' in program 11 | &#160; &#160; &#160; &#160; } | ^ a.cc:11:16: error: stray '#' in program 11 | &#160; &#160; &#160; &#160; } | ^ a.cc:11:23: error: stray '#' in program 11 | &#160; &#160; &#160; &#160; } | ^ a.cc:12:2: error: stray '#' in program 12 | &#160; &#160; &#160; &#160; if(!cin) | ^ a.cc:12:9: error: stray '#' in program 12 | &#160; &#160; &#160; &#160; if(!cin) | ^ a.cc:12:16: error: stray '#' in program 12 | &#160; &#160; &#160; &#160; if(!cin) | ^ a.cc:12:23: error: stray '#' in program 12 | &#160; &#160; &#160; &#160; if(!cin) | ^ a.cc:13:2: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:13:9: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:13:16: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:13:23: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:13:30: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:13:37: error: stray '#' in program 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^ a.cc:14:2: error: stray '#' in program 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^ a.cc:14:9: error: stray '#' in program 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^ a.cc:14:16: error: stray '#' in program 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^ a.cc:14:23: error: stray '#' in program 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^ a.cc:15:2: error: stray '#' in program 15 | &#160; | ^ a.cc:18:24: error: stray '#' in program 18 | leng += km[k];&#160; | ^ a.cc:19:47: error: stray '#' in program 19 | double length = leng * v1 / (v1 +v2);&#160; | ^ a.cc:20:22: error: stray '#' in program 20 | leng = 0.0; &#160; | ^ a.cc:22:18: error: stray '#' in program 22 | leng += &#160;km[k]; | ^ a.cc: In function 'int main()': a.cc:6:3: error: lvalue required as unary '&' operand 6 | &#160; &#160; double leng; | ^~~ a.cc:6:10: error: lvalue required as unary '&' operand 6 | &#160; &#160; double leng; | ^~~ a.cc:8:12: error: lvalue required as unary '&' operand 8 | &#160; for(int i = 0; i < 10; i++) | ^~~ a.cc:9:3: error: lvalue required as unary '&' operand 9 | &#160; &#160; &#160; &#160; { | ^~~ a.cc:9:10: error: lvalue required as unary '&' operand 9 | &#160; &#160; &#160; &#160; { | ^~~ a.cc:9:17: error: lvalue required as unary '&' operand 9 | &#160; &#160; &#160; &#160; { | ^~~ a.cc:9:24: error: lvalue required as unary '&' operand 9 | &#160; &#160; &#160; &#160; { | ^~~ a.cc:10:3: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:10: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:17: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:24: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:31: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:38: error: lvalue required as unary '&' operand 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^~~ a.cc:10:53: error: 'i' was not declared in this scope 10 | &#160; &#160; &#160; &#160; &#160; &#160; cin >> km[i] >> a; | ^ a.cc:11:3: error: lvalue required as unary '&' operand 11 | &#160; &#160; &#160; &#160; } | ^~~ a.cc:11:10: error: lvalue required as unary '&' operand 11 | &#160; &#160; &#160; &#160; } | ^~~ a.cc:11:17: error: lvalue required as unary '&' operand 11 | &#160; &#160; &#160; &#160; } | ^~~ a.cc:11:24: error: lvalue required as unary '&' operand 11 | &#160; &#160; &#160; &#160; } | ^~~ a.cc:12:3: error: lvalue required as unary '&' operand 12 | &#160; &#160; &#160; &#160; if(!cin) | ^~~ a.cc:12:10: error: lvalue required as unary '&' operand 12 | &#160; &#160; &#160; &#160; if(!cin) | ^~~ a.cc:12:17: error: lvalue required as unary '&' operand 12 | &#160; &#160; &#160; &#160; if(!cin) | ^~~ a.cc:12:24: error: lvalue required as unary '&' operand 12 | &#160; &#160; &#160; &#160; if(!cin) | ^~~ a.cc:13:3: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:13:10: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:13:17: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:13:24: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:13:31: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:13:38: error: lvalue required as unary '&' operand 13 | &#160; &#160; &#160; &#160; &#160; &#160; break; | ^~~ a.cc:14:3: error: lvalue required as unary '&' operand 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^~~ a.cc:14:10: error: lvalue required as unary '&' operand 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^~~ a.cc:14:17: error: lvalue required as unary '&' operand 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^~~ a.cc:14:24: error: lvalue required as unary '&' operand 14 | &#160; &#160; &#160; &#160; cin >> v1 >> a >> v2; | ^~~ a.cc:15:3: error: lvalue required as unary '&' operand 15 | &#160; | ^~~ a.cc:18:25: error: lvalue required as unary '&' operand 18 | leng += km[k];&#160; | ^~~ a.cc:19:48: error: lvalue required as unary '&' operand 19 | double length = leng * v1 / (v1 +v2);&#160; | ^~~ a.cc:20:23: error: lvalue required as unary '&' operand 20 | leng = 0.0; &#160; | ^~~ a.cc:22:19: error: lvalue required as unary '&' operand 22 | leng += &#160;km[k]; | ^~~
s166841740
p00034
C++
cout << " v1 " << v1 << endl;
a.cc:1:5: error: 'cout' does not name a type 1 | cout << " v1 " << v1 << endl; | ^~~~
s378638082
p00034
C++
#include <stdio.h> int main(){ double v1,v2,t,x; int a[10],i; while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%lf,%lf",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9],&v1,&v2)!=EOF){ x=0; for(i=0,i<10;i++){ x+=a[i]; } t=(v1)/(v1+v2); x=x*t; for(i=0;x>0;i++){ x-=a[i]; } printf("%d\n",i+1); } return 0; }
a.cc: In function 'int main()': a.cc:8:17: error: expected ';' before ')' token 8 | for(i=0,i<10;i++){ | ^ | ;
s434614745
p00034
C++
#include<iostream> #include<vector> int main(){ int first; while(std::cin>>first){ std::vector<int> distance(10); distance[0]=first; int sum=0; char dummy; sum+=first; for(int i=1;i<10;++i){ std::cin>>dummy; int s; std::cin>>s; sum+=s; a+=s; distance[i]=a; } double v1,v2; std::cin>>dummy>>v1>>dummy>>v2; int ans=0; for(int i=0;i<10;++i){ if(distance[i]<=sum/(v1+v2)*v1){ ans=i+1; } } std::cout<<ans<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:17:25: error: 'a' was not declared in this scope 17 | a+=s; | ^
s057892451
p00035
Java
import java.util.*; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String[] s = sc.nextLine().split(","); double[] a = new double[8]; for(int i=0;i < 8;i++) a[i] = Double.parseDouble(s[i]); } if(isCross(a[0],a[1],a[4],a[5],a[2],a[3],a[6],a[7]) > 0.0 || isCross(a[2],a[3],a[6],a[7],a[0],a[1],a[4],a[5]) > 0.0){ System.out.println("NO"); }else{ System.out.println("YES");} }} private static double isCross(double p1_x,double p1_y,double p2_x,double p2_y,double p3_x,double p3_y,double p4_x,double p4_y){ return ( (p1_x-p2_x)* (p3_y-p1_y) + (p1_y-p2_y)*(p1_x-p3_x)) * ((p1_x-p2_x)*(p4_y-p1_y) + (p1_y-p2_y)*(p1_x-p4_x)); } }
Main.java:17: error: unnamed classes are a preview feature and are disabled by default. private static double isCross(double p1_x,double p1_y,double p2_x,double p2_y,double p3_x,double p3_y,double p4_x,double p4_y){ ^ (use --enable-preview to enable unnamed classes) Main.java:24: error: class, interface, enum, or record expected } ^ 2 errors
s164878664
p00035
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; while((line=br.readLine())!=null){ String[] value=line.split(","); xa=Integer.parseInt(value[0]); ya=Integer.parseInt(value[1]); xb=Integer.parseInt(value[2]); yb=Integer.parseInt(value[3]); xc=Integer.parseInt(value[4]); yc=Integer.parseInt(value[5]); xd=Integer.parseInt(value[6]); yd=Integer.parseInt(value[7]); double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); if(area1==area2){ System.out.println("YES"); } else{ System.out.println("NO"); } } } static double area(double a,double b,double c,double d){ return Math.abs(a*d-b*c)/2; } }
Main.java:9: error: cannot find symbol xa=Integer.parseInt(value[0]); ^ symbol: variable xa location: class Main Main.java:10: error: cannot find symbol ya=Integer.parseInt(value[1]); ^ symbol: variable ya location: class Main Main.java:11: error: cannot find symbol xb=Integer.parseInt(value[2]); ^ symbol: variable xb location: class Main Main.java:12: error: cannot find symbol yb=Integer.parseInt(value[3]); ^ symbol: variable yb location: class Main Main.java:13: error: cannot find symbol xc=Integer.parseInt(value[4]); ^ symbol: variable xc location: class Main Main.java:14: error: cannot find symbol yc=Integer.parseInt(value[5]); ^ symbol: variable yc location: class Main Main.java:15: error: cannot find symbol xd=Integer.parseInt(value[6]); ^ symbol: variable xd location: class Main Main.java:16: error: cannot find symbol yd=Integer.parseInt(value[7]); ^ symbol: variable yd location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xb location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xa location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yb location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable ya location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xd location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xa location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yd location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable ya location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xb location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xc location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yb location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yc location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xd location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable xc location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yd location: class Main Main.java:17: error: cannot find symbol double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); ^ symbol: variable yc location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xa location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xb location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable ya location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yb location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xc location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xb location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yc location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yb location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xa location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xd location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable ya location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yd location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xc location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable xd location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yc location: class Main Main.java:18: error: cannot find symbol double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); ^ symbol: variable yd location: class Main 40 errors
s261492456
p00035
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; while((line=br.readLine())!=null){ String[] value=line.split(","); double xa=Double.parseDouble(value[0]); double ya=Double.parseDouble(value[1]); double xb=Double.parseDouble(value[2]); double yb=Double.parseDouble(value[3]); double xc=Double.parseDouble(value[4]); double yc=Double.parseDouble(value[5]); double xd=Double.parseDouble(value[6]); double yd=Double.parseDouble(value[7]); double area1=area(xb-xa,yb-ya,xd-xa,yd-ya)+area(xb-xc,yb-yc,xd-xc,yd-yc); double area2=area(xa-xb,ya-yb,xc-xb,yc-yb)+area(xa-xd,ya-yd,xc-xd,yc-yd); if(area1==area2){ System.out.println("YES"); } else{ System.out.println("NO"); } } } static double area(double a,double b,double c,double d){ return Math.abs(a*d-b*c)/2; } }
Main.java:7: error: unreported exception IOException; must be caught or declared to be thrown while((line=br.readLine())!=null){ ^ 1 error
s485463068
p00035
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); public static void main(String[] args){ while(scan.hasNext()){ double[] x = new double[4]; double[] y = new double[4]; for(int i = 0; i < 4; i++){ x[i] = scan.nextDouble(); y[i] = scan.nextDouble(); } System.out.println(solve(x,y)); } } static String solve(double[] x, double[] y){ boolean dirs[] = new boolean[4]; for(int i = 0; i < 4; i++){ int j = (i+1) % 4; int k = (i+2) % 4; dirs[i] = cross(x[j]-x[i], y[j]-y[i], x[k]-x[i], y[k]-y[i]); } boolean yes = true; for(int i = 1; i < 4; i++){ if(dirs[i-1] != dirs[i]){ yes = false; } return yes? "YES" : "NO"; } } private boolean cross(double x1, double y1, double x2, double y2){ return (x1*y2 - x2*y1) >= 0; } }
Main.java:26: error: non-static method cross(double,double,double,double) cannot be referenced from a static context dirs[i] = cross(x[j]-x[i], y[j]-y[i], x[k]-x[i], y[k]-y[i]); ^ 1 error
s597359707
p00035
Java
import java.util.*; public class A{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); static boolean dirs[] = new boolean[4]; public static void main(String[] args){ while(scan.hasNext()){ double[] x = new double[4]; double[] y = new double[4]; for(int i = 0; i < 4; i++){ x[i] = scan.nextDouble(); y[i] = scan.nextDouble(); } System.out.println(solve(x,y)); } } static String solve(double[] x, double[] y){ for(int i = 0; i < 4; i++){ int j = (i+1) % 4; int k = (i+2) % 4; dirs[i] = cross(x[j]-x[i], y[j]-y[i], x[k]-x[i], y[k]-y[i]); } boolean yes = true; for(int i = 1; i < 4; i++){ if(dirs[i-1] != dirs[i]){ yes = false; } return yes? "YES" : "NO"; } } private boolean cross(double x1, double y1, double x2, double y2){ return (x1*y2 - x2*y1) >= 0; } }
Main.java:3: error: class A is public, should be declared in a file named A.java public class A{ ^ Main.java:26: error: non-static method cross(double,double,double,double) cannot be referenced from a static context dirs[i] = cross(x[j]-x[i], y[j]-y[i], x[k]-x[i], y[k]-y[i]); ^ 2 errors
s460737670
p00035
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); static boolean dirs[] = new boolean[4]; public static void main(String[] args){ while(scan.hasNext()){ double[] x = new double[4]; double[] y = new double[4]; for(int i = 0; i < 4; i++){ x[i] = scan.nextDouble(); y[i] = scan.nextDouble(); } System.out.println(solve(x,y)); } } static String solve(double[] x, double[] y){ for(int i = 0; i < 4; i++){ int j = (i+1) % 4; int k = (i+2) % 4; dirs[i] = cross(x[j]-x[i], y[j]-y[i], x[k]-x[i], y[k]-y[i]); } boolean yes = true; for(int i = 1; i < 4; i++){ if(dirs[i-1] != dirs[i]){ yes = false; } return yes? "YES" : "NO"; } } private static boolean cross(double x1, double y1, double x2, double y2){ return (x1*y2 - x2*y1) >= 0; } }
Main.java:35: error: missing return statement } ^ 1 error
s332010137
p00035
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); public static void main(String[] args){ while(scan.hasNext()){ double[] x = new double[4]; double[] y = new double[4]; for(int i = 0; i < 4; i++){ x[i] = scan.nextDouble(); y[i] = scan.nextDouble(); } boolean flag = isIntersect(x[0], y[0], x[2], y[2], x[1], y[1], x[3], y[3]) && isIntersect(x[1], y[1], x[3], y[3], x[0], y[0], x[2], y[2]); System.out.printf("%s\n", flag? "Yes" : "NO"); } } public static boolean isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4){ //???A(x1,y1)??¨???B(x2,y2)????????¶??´?????¨???C(x3,y3)??¨???D(x4,y4)????????¶??????????????????????????????????????? double tc = (x1-x2)*(y3-y1)+(y1-y2)*(x1-x3); double td = (x1-x2)*(y4-y1)+(y1-y2)*(x1-x4) return tc * td < 0; } }
Main.java:27: error: ';' expected double td = (x1-x2)*(y4-y1)+(y1-y2)*(x1-x4) ^ 1 error
s590385388
p00035
Java
import java.io.*;class Main{ public static void main(String[]_)throws Exception{ int i,j; boolean f; float l[]=new float[8]; BufferedReader B=new BufferedReader(new InputStreamReader(System.in)); for(String s;(s=B.readLine())!=null;System.out.println(f?"NO":"YES")){ _=s.split(","); f=false; for(j=0;j<2;j++){ for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]); f|= ((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))* ((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0; } } } }
Main.java:2: error: as of release 9, '_' is a keyword, and may not be used as an identifier public static void main(String[]_)throws Exception{ ^ Main.java:8: error: as of release 9, '_' is a keyword, and may not be used as an identifier _=s.split(","); ^ Main.java:11: error: as of release 9, '_' is a keyword, and may not be used as an identifier for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]); ^ 3 errors
s780894286
p00035
Java
import java.io.*;class Main{ public static void main(String _[])throws Exception{ int i,j; boolean f; float l[]=new float[8]; BufferedReader B=new BufferedReader(new InputStreamReader(System.in)); for(String s;(s=B.readLine())!=null;System.out.println(f?"NO":"YES")){ _=s.split(","); f=false; for(j=0;j<2;j++){ for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]); f|= ((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))* ((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0; } } } }
Main.java:2: error: as of release 9, '_' is a keyword, and may not be used as an identifier public static void main(String _[])throws Exception{ ^ Main.java:8: error: as of release 9, '_' is a keyword, and may not be used as an identifier _=s.split(","); ^ Main.java:11: error: as of release 9, '_' is a keyword, and may not be used as an identifier for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]); ^ 3 errors
s443591260
p00035
Java
import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}}
Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ Main.java:1: error: ';' expected import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ Main.java:1: error: illegal start of expression import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ Main.java:1: error: ';' expected import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier import java.io.*;class Main{public static void main(String[]_)throws Exception{int i,j,k;float l[]=new float[8];BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;s=B.readLine())!=null;System.out.println(k>0?"NO":"YES")){_=s.split(",");for(k=j=0;j<2;j++){for(i=0;i<8;i++)l[i]=Float.valueOf(_[(4*j+i)%8]);if(((l[0]-l[2])*(l[5]-l[1])+(l[1]-l[3])*(l[0]-l[4]))*((l[0]-l[2])*(l[7]-l[1])+(l[1]-l[3])*(l[0]-l[6]))<0)k++;}}}} ^ 6 errors
s751785525
p00035
Java
import java.util.Scanner; public class A0035 { public static double[] equation(double a,double b,double c,double d,double e,double f){ double det = a*e-b*d; double[] ans = new double[2]; double x = (c*e-b*f)/det; double y = (a*f-c*d)/det; if(x==-0) x = 0; if(y==-0) y = 0; ans[0] = x; ans[1] = y; return ans; } public static String[] kommmaReader() { Scanner sc = new Scanner(System.in); String line; line=sc.nextLine(); String[] array = line.split(","); return array; } public static void main(String[] args) { Scanner sc = new Scanner(System.in); do{ String[] str = kommmaReader(); double[] p = new double[8]; for(int i=0; i<8; i++) p[i] = Double.parseDouble(str[i]); double[] ans = equation(p[0]-p[2],p[4]-p[2],p[6]-p[2],p[1]-p[3],p[5]-p[3],p[7]-p[3]); if(ans[0]+ans[1]>1 && ans[0]>0 && ans[1]>0) System.out.println("YES"); else System.out.println("NO"); }while(sc.hasNextLine()); } }
Main.java:3: error: class A0035 is public, should be declared in a file named A0035.java public class A0035 { ^ 1 error
s096016743
p00035
Java
import java.util.Scanner; public class Main { // ヘロンの公式(3つの辺から求めるver) public static double getArea (double a, double b, double c) { double s = (a + b + c) / 2; return Math.sqrt(s * (s - a) * (s - b) * (s - c)); } // 2点間の距離 public static double getDistance (double x1, double y1, double x2, double y2) { return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); double tol = 0.000000001; while (sc.hasNextLine()) { double[] nums = new double[8]; String[] str = sc.nextLine().split(","); for (int i = 0; i < nums.length; i++) nums[i] = Double.parseDouble(str[i]); double ab = getDistance(nums[0],nums[1],nums[2],nums[3]); double bc = getDistance(nums[2],nums[3],nums[4],nums[5]); double cd = getDistance(nums[4],nums[5],nums[6],nums[7]); double da = getDistance(nums[6],nums[7],nums[0],nums[1]); double bd = getDistance(nums[2],nums[3],nums[6],nums[7]); double ac = getDistance(nums[0],nums[1],nums[4],nums[5]); double area1 = Math.abs(getArea(ab,bc,ac) - getArea(da,cd,ac)); double area2 = Math.abs(getArea(bc,cd,bd) - getArea(ab,bd,da)); boolean b = area1 < tol && area2 < tol; // System.out.println(area1 + "," + area2); System.out.println(b ? "YES" : "NO"); } } }
Main.java:3: error: illegal character: '\u3000' public class?Main { ^ 1 error
s650601133
p00035
C
#include <stdio.h> #include <string.h> #include <stdlib.h> using namespace std; int main () { double xa, ya, xb, yb, xc, yc, xd, yd, xe, ye; double tac, tbd, sac, sbd; char c[10000]; int i; while(scanf("%s",&c)!=EOF) { xa=atof(strtok ( c, "," )); ya = atof ( strtok ( NULL, "," ) ); xb = atof ( strtok ( NULL, "," ) ); yb = atof ( strtok ( NULL, "," ) ); xc = atof ( strtok ( NULL, "," ) ); yc = atof ( strtok ( NULL, "," ) ); xd = atof ( strtok ( NULL, "," ) ); yd = atof ( strtok ( NULL, "," ) ); sac = ( yc - ya ) / ( xc - xa ); tac = ya - xa*sac; sbd = ( yd - yb ) / ( xd - xb ); tbd = yb - xb*sbd; xe = ( tac - tbd ) / ( sbd - sac ); ye = xe*sac + tac; if(( ( xa <= xe&&xe <= xc ) || ( xc <= xe&&xe <= xa ) ) && ( ( ya <= ye&&ye <= yc ) || ( yc <= ye&&ye <= ya ) )) { printf ( "YES\n" ); } else { printf ( "NO\n" ); } //printf ( "%f %f\n", xb, yb ); } return 0; }
main.c:5:1: error: unknown type name 'using' 5 | using namespace std; | ^~~~~ main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 5 | using namespace std; | ^~~
s287684538
p00035
C
#include <stdio.h> double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ return(x0-x1)*(y2-y0)-(y0-y1)*(x2-x0) } int main(){ double x0,y0,x1,y1,x2,y2,x3,y3; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ printf("%f\n",gaiseki(x0,y0,x1,y1,x3,y3)); printf("%f\n",gaiseki(x1,y1,x2,y2,x3,y3)); printf("%f\n",gaiseki(x2,y2,x0,y0,x3,y3)); if (gaiseki(x0,y0,x1,y1,x3,y3<0&&gaiseki(x1,y1,x2,y2,x3,y3)<0&&gaiseki(x2,y2,x0,y0,x3,y3)<0){ printf("YES\n"); }else{ printf("NO\n"); } }//while????????? return 0; }
main.c: In function 'gaiseki': main.c:4:40: error: expected ';' before '}' token 4 | return(x0-x1)*(y2-y0)-(y0-y1)*(x2-x0) | ^ | ; 5 | } | ~ main.c: In function 'main': main.c:12:97: error: expected ')' before '{' token 12 | if (gaiseki(x0,y0,x1,y1,x3,y3<0&&gaiseki(x1,y1,x2,y2,x3,y3)<0&&gaiseki(x2,y2,x0,y0,x3,y3)<0){ | ~ ^ | ) main.c:17:3: error: expected expression before '}' token 17 | }//while????????? | ^
s002388311
p00035
C
#include <stdio.h> double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ return(x0-x1)*(y2-y0)-(y0-y1)*(x2-x0) } int main(){ double x0,y0,x1,y1,x2,y2,x3,y3; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ printf("%f\n",gaiseki(x0,y0,x1,y1,x3,y3)); printf("%f\n",gaiseki(x1,y1,x2,y2,x3,y3)); printf("%f\n",gaiseki(x2,y2,x0,y0,x3,y3)); if (gaiseki(x0,y0,x1,y1,x3,y3<0)&&gaiseki(x1,y1,x2,y2,x3,y3)<0&&gaiseki(x2,y2,x0,y0,x3,y3)<0){ printf("YES\n"); }else{ printf("NO\n"); } }//while????????? return 0; }
main.c: In function 'gaiseki': main.c:4:40: error: expected ';' before '}' token 4 | return(x0-x1)*(y2-y0)-(y0-y1)*(x2-x0) | ^ | ; 5 | } | ~
s179236136
p00035
C
#include <stdio.h> ?? double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ ????return(x0-x1)*(y0-y1)-(x0-x2)*(y0-y2); } int main(){ ????double x0,y0,x1,y1,x2,y2,x3,y3; ????while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ ????????if (gaiseki(x0,y0,x1,y1,x3,y3)>=0&&gaiseki(x1,y1,x2,y2,x3,y3)>=0&&gaiseki(x2,y2,x0,y0,x3,y3)>=0){ ????????????printf("YES\n"); ????????}else{ ????????????printf("NO\n"); ????????} ????} ????return 0; }
main.c:2:1: error: expected identifier or '(' before '?' token 2 | ?? | ^ main.c: In function 'main': main.c:7:1: error: expected expression before '?' token 7 | ????double x0,y0,x1,y1,x2,y2,x3,y3; | ^ main.c:8:1: error: expected expression before '?' token 8 | ????while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^
s343021667
p00035
C
double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ return(x1-x0)*(y2-y0)-(x2-x0)*(y1-y0); } int main(){ double x0,y0,x1,y1,x2,y2,x3,y3; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)>0){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)<0||(x3-x2)*(y1-y2)-(x1-x2)*(y3-y2)<0||(x0-x3)*(y2-y3)-(x2-x3)*(y0-y3)<=0){ printf("NO\n"); }else{ printf("YES\n"); } }else if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)<0){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)<0||(x3-x2)*(y1-y2)-(x1-x2)*(y3-y2)<0||(x0-x3)*(y2-y3)-(x2-x3)*(y0-y3)>=0){ printf("NO\n"); }else{ printf("YES\n"); } }else{ printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:6:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ main.c:6:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~~~ main.c:6:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:84: error: 'EOF' undeclared (first use in this function) 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~ main.c:6:84: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:84: note: each undeclared identifier is reported only once for each function it appears in main.c:9:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 9 | printf("NO\n"); | ^~~~~~ main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:9:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 11 | printf("YES\n"); | ^~~~~~ main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:15:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 15 | printf("NO\n"); | ^~~~~~ main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:17:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 17 | printf("YES\n"); | ^~~~~~ main.c:17:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:20:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 20 | printf("NO\n"); | ^~~~~~ main.c:20:7: note: include '<stdio.h>' or provide a declaration of 'printf'
s754253005
p00035
C
double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ return(x1-x0)*(y2-y0)-(x2-x0)*(y1-y0); } int main(){ double x0,y0,x1,y1,x2,y2,x3,y3; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)>0){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)<=0||(x3-x2)*(y1-y2)-(x1-x2)*(y3-y2)<=0||(x0-x3)*(y2-y3)-(x2-x3)*(y0-y3)<=0){ printf("NO\n"); }else{ printf("YES\n"); } }else if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)<0){ if((x1-x0)*(y3-y0)-(x3-x0)*(y1-y0)>=0||(x3-x2)*(y1-y2)-(x1-x2)*(y3-y2)>=0||(x0-x3)*(y2-y3)-(x2-x3)*(y0-y3)>=0){ printf("NO\n"); }else{ printf("YES\n"); } }else{ printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:6:10: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | double gaiseki(double x0,double y0,double x1,double y1,double x2,double y2){ main.c:6:10: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~~~ main.c:6:10: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:84: error: 'EOF' undeclared (first use in this function) 6 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x0,&y0,&x1,&y1,&x2,&y2,&x3,&y3)!=EOF){ | ^~~ main.c:6:84: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:84: note: each undeclared identifier is reported only once for each function it appears in main.c:9:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 9 | printf("NO\n"); | ^~~~~~ main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:9:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:9:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 11 | printf("YES\n"); | ^~~~~~ main.c:11:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:15:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 15 | printf("NO\n"); | ^~~~~~ main.c:15:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:17:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 17 | printf("YES\n"); | ^~~~~~ main.c:17:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:20:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 20 | printf("NO\n"); | ^~~~~~ main.c:20:7: note: include '<stdio.h>' or provide a declaration of 'printf'
s138696422
p00035
C
#include<math.h> int main(){ double xa,ya,xb,yb,xc,yc,xd,yd; while(0<=scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yb,&xd,&yd)){ if(xc==xa){ if((xd-xc)*(xa-xc)>0){ printf("NO\n"); continue; }else{ printf("YES\n"); continue; } if(xb==xd){ if((xa-xb)*(xc-xb)>0){ printf("NO\n"); continue; }else{ printf("YES\n"); continue; } if((yb-(yc-ya)/(xc-xa)*(xb-xa)-ya)*(yd-(yc-ya)/(xc-xa)*(xd-xa)-ya)>0 || (ya-(yd-yb)/(xd-xb)*(xa-xb)-yb)*(yc-(yd-yb)/(xd-xb)*(xc-xb)-yb)>0){ printf("NO\n"); }else{ printf("YES\n"); } } return 0; }
main.c: In function 'main': main.c:6:18: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while(0<=scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yb,&xd,&yd)){ | ^~~~~ main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf' 1 | #include<math.h> +++ |+#include <stdio.h> 2 | main.c:6:18: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while(0<=scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&xa,&ya,&xb,&yb,&xc,&yb,&xd,&yd)){ | ^~~~~ main.c:6:18: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:10:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 10 | printf("NO\n"); | ^~~~~~ main.c:10:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:10:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:10:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:13:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 13 | printf("YES\n"); | ^~~~~~ main.c:13:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:19:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 19 | printf("NO\n"); | ^~~~~~ main.c:19:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:22:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 22 | printf("YES\n"); | ^~~~~~ main.c:22:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:27:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 27 | printf("NO\n"); | ^~~~~~ main.c:27:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:29:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 29 | printf("YES\n"); | ^~~~~~ main.c:29:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:33:17: error: expected declaration or statement at end of input 33 | } | ^ main.c:33:17: error: expected declaration or statement at end of input
s859412279
p00035
C
#define P(b,c)(x[b]*x[1+c]-x[1+b]*x[c]) float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;}
main.c:2:16: error: return type defaults to 'int' [-Wimplicit-int] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~ main.c: In function 'main': main.c:2:16: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:2:30: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #define P(b,c)(x[b]*x[1+c]-x[1+b]*x[c]) main.c:2:30: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~~ main.c:2:30: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:2:51: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | #define P(b,c)(x[b]*x[1+c]-x[1+b]*x[c]) main.c:2:51: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~~~ main.c:2:51: note: include '<string.h>' or provide a declaration of 'memset' main.c:2:65: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~ main.c:2:65: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:2:65: warning: too many arguments to built-in function 'puts' expecting 1 [-Wbuiltin-declaration-mismatch] main.c:2:51: error: too many arguments to function 'memset' 2 | float x[9],s,t;main(i){for(;~scanf("%f,",&s);i-9||memset(x,0,36,puts((s=P(3,5))*(t=P(5,7))>0&&P(1,3)*s>0&t*P(7,1)>0?"YES":"NO",i=1)))x[i]+=s,x[++i%8+1]-=s;} | ^~~~~~
s840864784
p00035
C
#include<stdio.h> #include<math.h> #include<string.h> /* 三辺a,b,c s=(a+b+c)/2 S={s(s-a)(s-b)(s-c)}^(1/2) */ double check(double a,double b,double c){ double s,S; s=(a+b+c)/2; S=sqrt(s*(s-a)*(s-b)*(s-c)); return S; } int main(void){ double x[4],y[4],s,t,a,b,c,s1,s2; int i,l,f,c1[20],c2[20]; while(1){ //for(i=0;i<4;i++)scanf("%lf,%lf,",&x[i],&y[i]); for(i=0;i<20;i++){ c1[i]=NULL; c2[i]=NULL; } scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); s1=s2=0; //点acで区切った三角形 //+b a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[1]-x[2]),2)+pow((y[1]-y[2]),2)); s1+=check(a,b,c); //+d a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); c=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2)); s1+=check(a,b,c); //点bdで区切った三角形 //+a a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); s2+=check(a,b,c); //+c a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[2]-x[1]),2)+pow((y[2]-y[1]),2)); c=sqrt(pow((x[2]-x[3]),2)+pow((y[2]-y[3]),2)); s2+=check(a,b,c); sprintf(c1,"%lf",s1); sprintf(c2,"%lf",s2); if(strcmp(c1,c2)==0){ printf("YES\n"); continue; } else{ printf("NO\n"); break; } } return 0; }
main.c: In function 'main': main.c:29:30: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 29 | c1[i]=NULL; | ^ main.c:30:30: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 30 | c2[i]=NULL; | ^ main.c:61:25: error: passing argument 1 of 'sprintf' from incompatible pointer type [-Wincompatible-pointer-types] 61 | sprintf(c1,"%lf",s1); | ^~ | | | int * In file included from main.c:1: /usr/include/stdio.h:365:38: note: expected 'char * restrict' but argument is of type 'int *' 365 | extern int sprintf (char *__restrict __s, | ~~~~~~~~~~~~~~~~~^~~ main.c:62:25: error: passing argument 1 of 'sprintf' from incompatible pointer type [-Wincompatible-pointer-types] 62 | sprintf(c2,"%lf",s2); | ^~ | | | int * /usr/include/stdio.h:365:38: note: expected 'char * restrict' but argument is of type 'int *' 365 | extern int sprintf (char *__restrict __s, | ~~~~~~~~~~~~~~~~~^~~ main.c:64:27: error: passing argument 1 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types] 64 | if(strcmp(c1,c2)==0){ | ^~ | | | int * In file included from main.c:3: /usr/include/string.h:156:32: note: expected 'const char *' but argument is of type 'int *' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~ main.c:64:30: error: passing argument 2 of 'strcmp' from incompatible pointer type [-Wincompatible-pointer-types] 64 | if(strcmp(c1,c2)==0){ | ^~ | | | int * /usr/include/string.h:156:50: note: expected 'const char *' but argument is of type 'int *' 156 | extern int strcmp (const char *__s1, const char *__s2) | ~~~~~~~~~~~~^~~~
s484440004
p00035
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> /* 三辺a,b,c s=(a+b+c)/2 S={s(s-a)(s-b)(s-c)}^(1/2) */ double check(double a,double b,double c){ double s,S; s=(a+b+c)/2; S=sqrt(s*(s-a)*(s-b)*(s-c)); return S; } int main(void){ double x[4],y[4],s,t,a,b,c,s1,s2; int i,l,f; char c1[20],c2[20]; while(1){ //for(i=0;i<4;i++)scanf("%lf,%lf,",&x[i],&y[i]); for(i=0;i<20;i++){ c1[i]=NULL; c2[i]=NULL; } scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); s1=s2=0; //点acで区切った三角形 //+b a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[1]-x[2]),2)+pow((y[1]-y[2]),2)); s1+=check(a,b,c); //+d a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); c=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2)); s1+=check(a,b,c); //点bdで区切った三角形 //+a a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); s2+=check(a,b,c); //+c a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[2]-x[1]),2)+pow((y[2]-y[1]),2)); c=sqrt(pow((x[2]-x[3]),2)+pow((y[2]-y[3]),2)); s2+=check(a,b,c); sprintf(c1,"%lf",s1); sprintf(c2,"%lf",s2); if(strcmp(c1,c2)==0){ printf("YES\n"); continue; } else{ printf("NO\n"); break; } } return 0; }
main.c: In function 'main': main.c:31:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 31 | c1[i]=NULL; | ^ main.c:32:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 32 | c2[i]=NULL; | ^
s224561848
p00035
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> /* 三辺a,b,c s=(a+b+c)/2 S={s(s-a)(s-b)(s-c)}^(1/2) */ double check(double a,double b,double c){ double s,S; s=(a+b+c)/2; S=sqrt(s*(s-a)*(s-b)*(s-c)); return S; } int main(void){ double x[4],y[4],s,t,a,b,c,s1,s2; int i,l,f; char c1[20],c2[20]; while(1){ //for(i=0;i<4;i++)scanf("%lf,%lf,",&x[i],&y[i]); for(i=0;i<20;i++){ c1[i]=NULL; c2[i]=NULL; } scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); s1=s2=0; //点acで区切った三角形 //+b a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[1]-x[2]),2)+pow((y[1]-y[2]),2)); s1+=check(a,b,c); //+d a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); c=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2)); s1+=check(a,b,c); //点bdで区切った三角形 //+a a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); s2+=check(a,b,c); //+c a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[2]-x[1]),2)+pow((y[2]-y[1]),2)); c=sqrt(pow((x[2]-x[3]),2)+pow((y[2]-y[3]),2)); s2+=check(a,b,c); sprintf(c1,"%lf",s1); sprintf(c2,"%lf",s2); if(strcmp(c1,c2)==0){ printf("YES\n"); continue; } else{ printf("NO\n"); break; } } return 0; }
main.c: In function 'main': main.c:31:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 31 | c1[i]=NULL; | ^ main.c:32:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 32 | c2[i]=NULL; | ^
s868655619
p00035
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> /* 三辺a,b,c s=(a+b+c)/2 S={s(s-a)(s-b)(s-c)}^(1/2) */ double check(double a,double b,double c){ double s,S; s=(a+b+c)/2; S=sqrt(s*(s-a)*(s-b)*(s-c)); return S; } int main(void){ double x[4],y[4],s,t,a,b,c,s1,s2; int i,l,f; char c1[20],c2[20]; while((scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]))!=EOF){ //for(i=0;i<4;i++)scanf("%lf,%lf,",&x[i],&y[i]); for(i=0;i<20;i++){ c1[i]=NULL; c2[i]=NULL; } //scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); s1=s2=0; //点acで区切った三角形 //+b a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[1]-x[2]),2)+pow((y[1]-y[2]),2)); s1+=check(a,b,c); //+d a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); c=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2)); s1+=check(a,b,c); //点bdで区切った三角形 //+a a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); s2+=check(a,b,c); //+c a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[2]-x[1]),2)+pow((y[2]-y[1]),2)); c=sqrt(pow((x[2]-x[3]),2)+pow((y[2]-y[3]),2)); s2+=check(a,b,c); sprintf(c1,"%lf",s1); sprintf(c2,"%lf",s2); if(strcmp(c1,c2)==0){ printf("YES\n"); continue; } else{ printf("NO\n"); break; } } return 0; }
main.c: In function 'main': main.c:31:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 31 | c1[i]=NULL; | ^ main.c:32:30: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 32 | c2[i]=NULL; | ^
s219536145
p00035
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<string.h> /* 三辺a,b,c s=(a+b+c)/2 S={s(s-a)(s-b)(s-c)}^(1/2) */ double check(double a,double b,double c){ double s,S; s=(a+b+c)/2; S=sqrt(s*(s-a)*(s-b)*(s-c)); return S; } int main(void){ double x[4],y[4],s,t,a,b,c,s1,s2; int i,l,f; char c1[20],c2[20]; while((scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]))!=EOF){ //for(i=0;i<4;i++)scanf("%lf,%lf,",&x[i],&y[i]); for(i=0;i<20;i++){ c1[i]='NULL'; c2[i]='NULL'; } //scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x[0],&y[0],&x[1],&y[1],&x[2],&y[2],&x[3],&y[3]); s1=s2=0; //点acで区切った三角形 //+b a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[1]-x[2]),2)+pow((y[1]-y[2]),2)); s1+=check(a,b,c); //+d a=sqrt(pow((x[0]-x[2]),2)+pow((y[0]-y[2]),2)); b=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); c=sqrt(pow((x[3]-x[2]),2)+pow((y[3]-y[2]),2)); s1+=check(a,b,c); //点bdで区切った三角形 //+a a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[0]-x[1]),2)+pow((y[0]-y[1]),2)); c=sqrt(pow((x[0]-x[3]),2)+pow((y[0]-y[3]),2)); s2+=check(a,b,c); //+c a=sqrt(pow((x[1]-x[3]),2)+pow((y[1]-y[3]),2)); b=sqrt(pow((x[2]-x[1]),2)+pow((y[2]-y[1]),2)); c=sqrt(pow((x[2]-x[3]),2)+pow((y[2]-y[3]),2)); s2+=check(a,b,c); sprintf(c1,"%lf",s1); sprintf(c2,"%lf",s2); if(strcmp(c1,c2)==0){ printf("YES\n"); continue; } else{ printf("NO\n"); break; } } return 0; }
main.c: In function 'main': main.c:31:31: warning: multi-character character constant [-Wmultichar] 31 | c1[i]='NULL'; | ^~~~~~ main.c:31:31: warning: overflow in conversion from 'int' to 'char' changes value from '1314212940' to '76' [-Woverflow] main.c:32:31: warning: multi-character character constant [-Wmultichar] 32 | c2[i]='NULL'; | ^~~~~~ main.c:32:31: warning: overflow in conversion from 'int' to 'char' changes value from '1314212940' to '76' [-Woverflow] /usr/bin/ld: /tmp/ccCvumlz.o: in function `check': main.c:(.text+0x71): undefined reference to `sqrt' /usr/bin/ld: /tmp/ccCvumlz.o: in function `main': main.c:(.text+0xfa): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x12f): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x14a): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x17c): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x1b1): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x1cc): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x1fe): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x233): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x24e): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x2ae): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x2e3): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x2fe): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x330): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x365): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x380): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x3b2): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x3e7): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x402): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x462): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x497): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x4b2): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x4e4): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x519): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x534): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x566): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x59b): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x5b6): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x616): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x64b): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x666): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x698): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x6cd): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x6e8): undefined reference to `sqrt' /usr/bin/ld: main.c:(.text+0x71a): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x74f): undefined reference to `pow' /usr/bin/ld: main.c:(.text+0x76a): undefined reference to `sqrt' collect2: error: ld returned 1 exit status
s567939504
p00035
C++
#include <iostream> #include <string> #include <cstdio> using namespace std; int main () { double xa, ya, xb, yb, xc, yc, xd, yd, xe, ye; double tac, tbd, sac, sbd; char c[10000]; int i; while(scanf("%s",&c)!=EOF) { xa=atof(strtok ( c, "," )); ya = atof ( strtok ( NULL, "," ) ); xb = atof ( strtok ( NULL, "," ) ); yb = atof ( strtok ( NULL, "," ) ); xc = atof ( strtok ( NULL, "," ) ); yc = atof ( strtok ( NULL, "," ) ); xd = atof ( strtok ( NULL, "," ) ); yd = atof ( strtok ( NULL, "," ) ); sac = ( yc - ya ) / ( xc - xa ); tac = ya - xa*sac; sbd = ( yd - yb ) / ( xd - xb ); tbd = yb - xb*sbd; xe = ( tac - tbd ) / ( sbd - sac ); ye = xe*sac + tac; if(( ( xa <= xe&&xe <= xc ) || ( xc <= xe&&xe <= xa ) ) && ( ( ya <= ye&&ye <= yc ) || ( yc <= ye&&ye <= ya ) )) { cout << "YES" << endl; } else { cout << "NO" << endl; } //printf ( "%f %f\n", xb, yb ); } return 0; }
a.cc: In function 'int main()': a.cc:14:25: error: 'strtok' was not declared in this scope; did you mean 'strtoq'? 14 | xa=atof(strtok ( c, "," )); | ^~~~~~ | strtoq
s156289683
p00035
C++
&#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> using namespace std; const double EPS = 1e-8; const double INF = 1e12; typedef complex<double> P; namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } } double cross(const P& a, const P& b) { return imag(conj(a)*b); } double dot(const P& a, const P& b) { return real(conj(a)*b); } int ccw(P a, P b, P c) { b -= a; c -= a; if (cross(b, c) > 0) return +1; // counter clockwise if (cross(b, c) < 0) return -1; // clockwise if (dot(b, c) < 0) return +2; // c--a--b on line if (norm(b) < norm(c)) return -2; // a--b--c on line return 0; } vector<P> convex_hull(vector<P> ps) { int n = ps.size(), k = 0; sort(ps.begin(), ps.end()); vector<P> ch(2*n); for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--]) // upper-hull while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; ch.resize(k-1); return ch; } int main(){ vector<P> v(4); while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ vector<P> q = convex_hull(v); cout << (q.size()==4?"YES":"NO") << endl; } }
a.cc:1:2: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:10: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:18: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:26: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:33: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:11: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:19: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:27: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:34: error: 'include' does not name a type 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~~~ a.cc:7:9: error: 'complex' does not name a type 7 | typedef complex<double> P; | ^~~~~~~ a.cc:10:28: error: 'P' does not name a type 10 | bool operator < (const P& a, const P& b) { | ^ a.cc:10:40: error: 'P' does not name a type 10 | bool operator < (const P& a, const P& b) { | ^ a.cc:10:10: error: 'bool std::operator<(const int&, const int&)' must have an argument of class or enumerated type 10 | bool operator < (const P& a, const P& b) { | ^~~~~~~~ a.cc:14:20: error: 'P' does not name a type 14 | double cross(const P& a, const P& b) { | ^ a.cc:14:32: error: 'P' does not name a type 14 | double cross(const P& a, const P& b) { | ^ a.cc: In function 'double cross(const int&, const int&)': a.cc:15:17: error: 'conj' was not declared in this scope 15 | return imag(conj(a)*b); | ^~~~ a.cc:15:12: error: 'imag' was not declared in this scope 15 | return imag(conj(a)*b); | ^~~~ a.cc: At global scope: a.cc:17:18: error: 'P' does not name a type 17 | double dot(const P& a, const P& b) { | ^ a.cc:17:30: error: 'P' does not name a type 17 | double dot(const P& a, const P& b) { | ^ a.cc: In function 'double dot(const int&, const int&)': a.cc:18:17: error: 'conj' was not declared in this scope 18 | return real(conj(a)*b); | ^~~~ a.cc:18:12: error: 'real' was not declared in this scope 18 | return real(conj(a)*b); | ^~~~ a.cc: At global scope: a.cc:21:9: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:14: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:19: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:22: error: expression list treated as compound expression in initializer [-fpermissive] 21 | int ccw(P a, P b, P c) { | ^ a.cc:30:1: error: 'vector' does not name a type 30 | vector<P> convex_hull(vector<P> ps) { | ^~~~~~ a.cc: In function 'int main()': a.cc:43:5: error: 'vector' was not declared in this scope 43 | vector<P> v(4); | ^~~~~~ a.cc:43:12: error: 'P' was not declared in this scope 43 | vector<P> v(4); | ^ a.cc:43:15: error: 'v' was not declared in this scope 43 | vector<P> v(4); | ^ a.cc:44:11: error: 'scanf' was not declared in this scope 44 | while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ | ^~~~~ a.cc:44:167: error: 'EOF' was not declared in this scope 44 | while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> a.cc:45:19: error: 'q' was not declared in this scope 45 | vector<P> q = convex_hull(v); | ^ a.cc:45:24: error: 'convex_hull' was not declared in this scope 45 | vector<P> q = convex_hull(v); | ^~~~~~~~~~~ a.cc:46:9: error: 'cout' was not declared in this scope 46 | cout << (q.size()==4?"YES":"NO") << endl; | ^~~~ a.cc:46:45: error: 'endl' was not declared in this scope 46 | cout << (q.size()==4?"YES":"NO") << endl; | ^~~~
s327168867
p00035
C++
&#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> using namespace std; const double EPS = 1e-8; const double INF = 1e12; typedef complex<double> P; namespace std { bool operator < (const P& a, const P& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } } double cross(const P& a, const P& b) { return imag(conj(a)*b); } double dot(const P& a, const P& b) { return real(conj(a)*b); } int ccw(P a, P b, P c) { b -= a; c -= a; if (cross(b, c) > 0) return +1; // counter clockwise if (cross(b, c) < 0) return -1; // clockwise if (dot(b, c) < 0) return +2; // c--a--b on line if (norm(b) < norm(c)) return -2; // a--b--c on line return 0; } vector<P> convex_hull(vector<P> ps) { int n = ps.size(), k = 0; sort(ps.begin(), ps.end()); vector<P> ch(2*n); for (int i = 0; i < n; ch[k++] = ps[i++]) // lower-hull while (k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; for (int i = n-2, t = k+1; i >= 0; ch[k++] = ps[i--]) // upper-hull while (k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; ch.resize(k-1); return ch; } int main(){ vector<P> v(4); while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ vector<P> q = convex_hull(v); cout << (q.size()==4?"YES":"NO") << endl; } }
a.cc:1:2: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:10: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:18: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:26: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:33: error: stray '#' in program 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^ a.cc:1:3: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:11: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:19: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:27: error: expected unqualified-id before numeric constant 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~ a.cc:1:34: error: 'include' does not name a type 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> | ^~~~~~~ a.cc:7:9: error: 'complex' does not name a type 7 | typedef complex<double> P; | ^~~~~~~ a.cc:10:28: error: 'P' does not name a type 10 | bool operator < (const P& a, const P& b) { | ^ a.cc:10:40: error: 'P' does not name a type 10 | bool operator < (const P& a, const P& b) { | ^ a.cc:10:10: error: 'bool std::operator<(const int&, const int&)' must have an argument of class or enumerated type 10 | bool operator < (const P& a, const P& b) { | ^~~~~~~~ a.cc:14:20: error: 'P' does not name a type 14 | double cross(const P& a, const P& b) { | ^ a.cc:14:32: error: 'P' does not name a type 14 | double cross(const P& a, const P& b) { | ^ a.cc: In function 'double cross(const int&, const int&)': a.cc:15:17: error: 'conj' was not declared in this scope 15 | return imag(conj(a)*b); | ^~~~ a.cc:15:12: error: 'imag' was not declared in this scope 15 | return imag(conj(a)*b); | ^~~~ a.cc: At global scope: a.cc:17:18: error: 'P' does not name a type 17 | double dot(const P& a, const P& b) { | ^ a.cc:17:30: error: 'P' does not name a type 17 | double dot(const P& a, const P& b) { | ^ a.cc: In function 'double dot(const int&, const int&)': a.cc:18:17: error: 'conj' was not declared in this scope 18 | return real(conj(a)*b); | ^~~~ a.cc:18:12: error: 'real' was not declared in this scope 18 | return real(conj(a)*b); | ^~~~ a.cc: At global scope: a.cc:21:9: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:14: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:19: error: 'P' was not declared in this scope 21 | int ccw(P a, P b, P c) { | ^ a.cc:21:22: error: expression list treated as compound expression in initializer [-fpermissive] 21 | int ccw(P a, P b, P c) { | ^ a.cc:30:1: error: 'vector' does not name a type 30 | vector<P> convex_hull(vector<P> ps) { | ^~~~~~ a.cc: In function 'int main()': a.cc:43:5: error: 'vector' was not declared in this scope 43 | vector<P> v(4); | ^~~~~~ a.cc:43:12: error: 'P' was not declared in this scope 43 | vector<P> v(4); | ^ a.cc:43:15: error: 'v' was not declared in this scope 43 | vector<P> v(4); | ^ a.cc:44:11: error: 'scanf' was not declared in this scope 44 | while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ | ^~~~~ a.cc:44:167: error: 'EOF' was not declared in this scope 44 | while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &v[0].real(), &v[0].imag(), &v[1].real(), &v[1].imag(), &v[2].real(), &v[2].imag(), &v[3].real(), &v[3].imag()) != EOF){ | ^~~ a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | &#65279;&#65279;&#65279;&#65279;#include<bits/stdc++.h> a.cc:45:19: error: 'q' was not declared in this scope 45 | vector<P> q = convex_hull(v); | ^ a.cc:45:24: error: 'convex_hull' was not declared in this scope 45 | vector<P> q = convex_hull(v); | ^~~~~~~~~~~ a.cc:46:9: error: 'cout' was not declared in this scope 46 | cout << (q.size()==4?"YES":"NO") << endl; | ^~~~ a.cc:46:45: error: 'endl' was not declared in this scope 46 | cout << (q.size()==4?"YES":"NO") << endl; | ^~~~
s585636240
p00035
C++
using namespace std; typedef long long int ll; typedef pair<int, int> pii; typedef vector<int> vi; typedef vector<pair<int, int> > vii; #define rrep(i, m, n) for(int (i)=(m); (i)<(n); (i)++) #define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++) #define rep(i, n) for(int (i)=0; (i)<(n); (i)++) #define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--) #define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--) #define rev(i, n) for(int (i)=(n)-1; (i)>=0; (i)--) #define vrep(i, c) for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++) #define ALL(v) (v).begin(), (v).end() #define mp make_pair #define pb push_back template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; } template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; } const int INF = 1000000000; const ll MOD = 1000000007LL; const double EPS = 1E-12; struct Point : public complex<double> { public: Point() { this->real(0); this->imag(0); } Point(const double& x, const double& y) { this->real(x); this->imag(y); } Point(const complex<double> w) { this->real(w.real()); this->imag(w.imag()); } inline double dot(Point p){ return (conj(*this) * p).real(); } // ?????? inline double det(Point p){ return (conj(*this) * p).imag(); } // ?????? }; namespace std { bool operator < (const Point& a, const Point& b) { return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); } } int ccw(Point a, Point b, Point c) { b -= a; c -= a; if(b.det(c) > 0.0) return 1; if(b.det(c) < 0.0) return -1; if(b.dot(c) < 0.0) return 2; if(norm(b) < norm(c)) return -2; return 0; } typedef vector<Point> Polygon; #define curr(P, i) P[(i) % P.size()] #define next(P, i) P[(i+1) % P.size()] #define prev(P, i) P[(i+P.size()-1) % P.size()] bool isConvex(const Polygon &P) { for (int i = 0; i < P.size(); ++i) if (ccw(prev(P, i), curr(P, i), next(P, i)) > 0) return false; return true; } // O(nlogn) vector<Point> AndrewMonotoneChain(vector<Point> ps) { int n = ps.size(), k = 0; sort(ps.begin(), ps.end()); vector<Point> ch(2*n); for(int i=0; i<n; ch[k++]=ps[i++]) // lower-hull while(k >= 2 && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; for(int i=n-2, t=k+1; i>= 0; ch[k++]=ps[i--]) // upper-hull while(k >= t && ccw(ch[k-2], ch[k-1], ps[i]) <= 0) --k; ch.resize(k-1); return ch; } template<typename T> ostream& operator <<(ostream& r, const vector<T> t){vrep(v,t)r<<*v<<(v+1==t.end()?"":" ");return r;} template<typename T> ostream& operator <<(ostream& r, const pair<vector<T>, int> p){int n=p.second;minup(n,p.first.size());rep(i,n-1)r<<p.first[i]<<' ';r<<p.first[n-1];return r;} template<typename T> ostream& operator <<(ostream& r, const pair<T*, int> p){int n=p.second-1;rep(i,n)r<<p.first[i]<<' ';return r<<p.first[n];} template<typename T, size_t S> ostream& operator <<(ostream& r, const T (&a)[S]){rep(i,S-1)r<<a[i]<<' ';return r<<a[S-1];} double x, y; bool ok = true; int main() { while(~scanf("%lf,%lf", &x, &y)){ Polygon P; P.pb(Point(x, y)); rep(i, 3){ scanf(",%lf,%lf", &x, &y); P.pb(Point(x, y)); } cerr << P << endl; // puts(isConvex(P) ? "NO" : "YES"); puts(AndrewMonotoneChain(P) == P ? "YES" : "NO"); } return 0; }
a.cc:4:9: error: 'pair' does not name a type 4 | typedef pair<int, int> pii; | ^~~~ a.cc:5:9: error: 'vector' does not name a type 5 | typedef vector<int> vi; | ^~~~~~ a.cc:6:9: error: 'vector' does not name a type 6 | typedef vector<pair<int, int> > vii; | ^~~~~~ a.cc:24:30: error: expected template-name before '<' token 24 | struct Point : public complex<double> | ^ a.cc:24:30: error: expected '{' before '<' token a.cc:24:30: error: expected unqualified-id before '<' token a.cc: In function 'bool std::operator<(const Point&, const Point&)': a.cc:38:12: error: 'real' was not declared in this scope 38 | return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); | ^~~~ a.cc:38:53: error: 'imag' was not declared in this scope 38 | return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b); | ^~~~ a.cc: At global scope: a.cc:42:15: error: 'a' has incomplete type 42 | int ccw(Point a, Point b, Point c) | ~~~~~~^ a.cc:24:8: note: forward declaration of 'struct Point' 24 | struct Point : public complex<double> | ^~~~~ a.cc:42:24: error: 'b' has incomplete type 42 | int ccw(Point a, Point b, Point c) | ~~~~~~^ a.cc:24:8: note: forward declaration of 'struct Point' 24 | struct Point : public complex<double> | ^~~~~ a.cc:42:33: error: 'c' has incomplete type 42 | int ccw(Point a, Point b, Point c) | ~~~~~~^ a.cc:24:8: note: forward declaration of 'struct Point' 24 | struct Point : public complex<double> | ^~~~~ a.cc: In function 'int ccw(Point, Point, Point)': a.cc:49:6: error: 'norm' was not declared in this scope 49 | if(norm(b) < norm(c)) return -2; | ^~~~ a.cc: At global scope: a.cc:53:9: error: 'vector' does not name a type 53 | typedef vector<Point> Polygon; | ^~~~~~ a.cc:59:21: error: 'Polygon' does not name a type 59 | bool isConvex(const Polygon &P) { | ^~~~~~~ a.cc: In function 'bool isConvex(const int&)': a.cc:60:25: error: request for member 'size' in 'P', which is of non-class type 'const int' 60 | for (int i = 0; i < P.size(); ++i) | ^~~~ a.cc:58:27: error: request for member 'size' in 'P', which is of non-class type 'const int' 58 | #define prev(P, i) P[(i+P.size()-1) % P.size()] | ^~~~ a.cc:61:13: note: in expansion of macro 'prev' 61 | if (ccw(prev(P, i), curr(P, i), next(P, i)) > 0) return false; | ^~~~ a.cc:58:41: error: request for member 'size' in 'P', which is of non-class type 'const int' 58 | #define prev(P, i) P[(i+P.size()-1) % P.size()] | ^~~~ a.cc:61:13: note: in expansion of macro 'prev' 61 | if (ccw(prev(P, i), curr(P, i), next(P, i)) > 0) return false; | ^~~~ a.cc:56:30: error: request for member 'size' in 'P', which is of non-class type 'const int' 56 | #define curr(P, i) P[(i) % P.size()] | ^~~~ a.cc:61:25: note: in expansion of macro 'curr' 61 | if (ccw(prev(P, i), curr(P, i), next(P, i)) > 0) return false; | ^~~~ a.cc:57:32: error: request for member 'size' in 'P', which is of non-class type 'const int' 57 | #define next(P, i) P[(i+1) % P.size()] | ^~~~ a.cc:61:37: note: in expansion of macro 'next' 61 | if (ccw(prev(P, i), curr(P, i), next(P, i)) > 0) return false; | ^~~~ a.cc: At global scope: a.cc:66:1: error: 'vector' does not name a type 66 | vector<Point> AndrewMonotoneChain(vector<Point> ps) | ^~~~~~ a.cc:80:22: error: 'ostream' does not name a type 80 | template<typename T> ostream& operator <<(ostream& r, const vector<T> t){vrep(v,t)r<<*v<<(v+1==t.end()?"":" ");return r;} | ^~~~~~~ a.cc:81:22: error: 'ostream' does not name a type 81 | template<typename T> ostream& operator <<(ostream& r, const pair<vector<T>, int> p){int n=p.second;minup(n,p.first.size());rep(i,n-1)r<<p.first[i]<<' ';r<<p.first[n-1];return r;} | ^~~~~~~ a.cc:82:22: error: 'ostream' does not name a type 82 | template<typename T> ostream& operator <<(ostream& r, const pair<T*, int> p){int n=p.second-1;rep(i,n)r<<p.first[i]<<' ';return r<<p.first[n];} | ^~~~~~~ a.cc:83:22: error: 'size_t' has not been declared 83 | template<typename T, size_t S> ostream& operator <<(ostream& r, const T (&a)[S]){rep(i,S-1)r<<a[i]<<' ';return r<<a[S-1];} | ^~~~~~ a.cc:83:32: error: 'ostream' does not name a type 83 | template<typename T, size_t S> ostream& operator <<(ostream& r, const T (&a)[S]){rep(i,S-1)r<<a[i]<<' ';return r<<a[S-1];} | ^~~~~~~ a.cc: In function 'int main()': a.cc:91:10: error: 'scanf' was not declared in this scope 91 | while(~scanf("%lf,%lf", &x, &y)){ | ^~~~~ a.cc:92:5: error: 'Polygon' was not declared in this scope 92 | Polygon P; | ^~~~~~~ a.cc:93:5: error: 'P' was not declared in this scope 93 | P.pb(Point(x, y)); | ^ a.cc:93:20: error: invalid use of incomplete type 'struct Point' 93 | P.pb(Point(x, y)); | ^ a.cc:24:8: note: forward declaration of 'struct Point' 24 | struct Point : public complex<double> | ^~~~~ a.cc:96:22: error: invalid use of incomplete type 'struct Point' 96 | P.pb(Point(x, y)); | ^ a.cc:24:8: note: forward declaration of 'struct Point' 24 | struct Point : public complex<double> | ^~~~~ a.cc:99:5: error: 'cerr' was not declared in this scope 99 | cerr << P << endl; | ^~~~ a.cc:1:1: note: 'std::cerr' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:99:18: error: 'endl' was not declared in this scope 99 | cerr << P << endl; | ^~~~ a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' +++ |+#include <ostream> 1 | using namespace std; a.cc:101:10: error: 'AndrewMonotoneChain' was not declared in this scope 101 | puts(AndrewMonotoneChain(P) == P ? "YES" : "NO"); | ^~~~~~~~~~~~~~~~~~~ a.cc:101:5: error: 'puts' was not declared in this scope 101 | puts(AndrewMonotoneChain(P) == P ? "YES" : "NO"); | ^~~~
s755242667
p00035
C++
type point = Pt of float * float let sub_vector (Pt (x1, y1)) (Pt (x2, y2)) = Pt (x2 -. x1, y2 -. y1) let cross_sign v1 v2 v3 = let Pt (xv, yv), Pt (xu, yu) = (sub_vector v1 v2), (sub_vector v2 v3) in compare 0. (xv *. yu -. yv *. xu) let rec loop () = try let line = read_line () in Scanf.sscanf line "%f,%f,%f,%f,%f,%f,%f,%f" begin fun x1 y1 x2 y2 x3 y3 x4 y4 -> let p1, p2, p3, p4 = Pt (x1, y1), Pt (x2, y2), Pt (x3, y3), Pt (x4, y4) in let sign = cross_sign p1 p2 p3 in let is_convex = List.for_all (fun (p, q, r) -> sign = cross_sign p q r) [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in print_endline @@ if is_convex then "YES" else "NO" end; loop () with End_of_file -> () let () = loop ();
a.cc:21:23: error: stray '@' in program 21 | print_endline @@ if is_convex then "YES" else "NO" | ^ a.cc:21:24: error: stray '@' in program 21 | print_endline @@ if is_convex then "YES" else "NO" | ^ a.cc:1:1: error: 'type' does not name a type; did you mean 'typeof'? 1 | type point = Pt of float * float | ^~~~ | typeof a.cc:20:42: error: expected ')' before ',' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ~ ^ | ) a.cc:20:46: error: expected constructor, destructor, or type conversion before ',' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ^ a.cc:20:50: error: expected constructor, destructor, or type conversion before ')' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ^ a.cc:20:56: error: expected ')' before ',' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ~ ^ | ) a.cc:20:60: error: expected constructor, destructor, or type conversion before ',' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ^ a.cc:20:64: error: expected constructor, destructor, or type conversion before ')' token 20 | [(p2, p3, p4); (p3, p4, p1); (p4, p1, p2)] in | ^ a.cc:24:3: error: expected constructor, destructor, or type conversion before 'with' 24 | with End_of_file -> () | ^~~~
s508960219
p00035
C++
???????????????????????????????????????????????§??£??????????????????????????§?????? #include <complex> #include <cstdio> #include <cmath> using namespace std; // ?????§?¨?????????¨?????? typedef complex<double> P; //XY??§?¨? #define X real() #define Y imag() // ??´???p1,p2??¨??????p3,p4??????????????? // (n < 0)<=>?????? , (n == 0)<=>??´??????, (n > 0)<=>????????????????????? double isIntersect(P p1, P p2, P p3, P p4){ return ( (p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X)); } int main(){ double xa, xb, xc, xd, ya, yb, yc, yd; while( scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &xa, &ya, &xb, &yb, &xc, &yc, &xd, &yd) != EOF ){ P a( xa , ya ); P b( xb , yb ); P c( xc , yc ); P d( xd , yd ); if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ printf("NO\n"); }else{ printf("YES\n"); } } }
a.cc:1:48: error: extended character § is not valid in an identifier 1 | ???????????????????????????????????????????????§??£??????????????????????????§?????? | ^ a.cc:1:51: error: extended character £ is not valid in an identifier 1 | ???????????????????????????????????????????????§??£??????????????????????????§?????? | ^ a.cc:1:78: error: extended character § is not valid in an identifier 1 | ???????????????????????????????????????????????§??£??????????????????????????§?????? | ^ a.cc:1:1: error: expected unqualified-id before '?' token 1 | ???????????????????????????????????????????????§??£??????????????????????????§?????? | ^ In file included from /usr/include/c++/14/complex:43, from a.cc:3: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity 164 | __is_null_pointer(std::nullptr_t) | ^ /usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)' 159 | __is_null_pointer(_Type) | ^~~~~~~~~~~~~~~~~ /usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std' 164 | __is_null_pointer(std::nullptr_t) | ^~~~~~~~~ In file included from /usr/include/c++/14/bits/stl_pair.h:60, from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/bits/specfun.h:43, from /usr/include/c++/14/cmath:3906, from /usr/include/c++/14/complex:44: /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/stdlib.h:32, from /usr/include/c++/14/bits/std_abs.h:38, from /usr/include/c++/14/cmath:49: /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; | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:65: /usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type 125 | template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t, | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' +++ |+#include <cstddef> 1 | // Types used in iterator implementation -*- C++ -*- /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type 214 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: error: 'ptrdiff_t' does not name a type 225 | typedef ptrdiff_t difference_type; | ^~~~~~~~~ /usr/include/c++/14/bits/stl_iterator_base_types.h:225:15: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>' In file included from /usr/include/c++/14/bits/stl_algobase.h:66: /usr/include/c++/14/bits/stl_iterator_base_funcs.h:112
s574706140
p00035
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef complex<double> P; typedef pair<int,int> pii; #define REP(i,n) for(ll i=0;i<n;++i) #define REPR(i,n) for(ll i=1;i<n;++i) #define FOR(i,a,b) for(ll i=a;i<b;++i) #define DEBUG(x) cout<<#x<<": "<<x<<endl #define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl #define ALL(a) (a).begin(),(a).end() #define MOD (ll)(1e9+7) #define ADD(a,b) a=((a)+(b))%MOD #define FIX(a) ((a)%MOD+MOD)%MOD double dot(P a,P b){return real(conj(a)*b);} double cross(P a,P b){return imag(conj(a)*b);} int main(){ double a,b,c,d,e,f,g,h; while(~scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h)){ P x[6]; x[0] = P(a,b); x[1] = P(c,d); x[2] = P(e,f); x[3] = P(g,h); x[4] = x[0]; x[5] = x[1]; double ccw = cross(x[2]-x[0],x[1]-x[0]) bool flag = true; REPR(i,4){ double ccc = cross(x[2+i]-x[i],x[1+i]-x[i]); if(ccw*ccc <= 0){ flag = false; break; } } if(flag){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:36:5: error: expected ',' or ';' before 'bool' 36 | bool flag = true; | ^~~~ a.cc:40:9: error: 'flag' was not declared in this scope 40 | flag = false; | ^~~~ a.cc:44:8: error: 'flag' was not declared in this scope 44 | if(flag){ | ^~~~
s833646091
p00035
C++
#include <cmath> #include <iostream> #include <algorithm> using namespace std; // ------ Classes ------ // class Point { public: long double px, py; Point(long double px_, long double py_) : px(px_), py(py_) {}; friend bool operator==(const Point& p1, const Point& p2) { return p1.px == p2.px && p1.py == p2.py; } friend bool operator!=(const Point& p1, const Point& p2) { return p1.px != p2.px || p1.py != p2.py; } friend Point operator+(const Point& p1, const Point& p2) { return Point(p1.px + p2.px, p1.py + p2.py); } friend Point operator-(const Point& p1, const Point& p2) { return Point(p1.px - p2.px, p1.py - p2.py); } friend Point operator*(const Point& p1, long double d) { return Point(p1.px * d, p1.py + d); } friend Point operator*(long double d, const Point& p1) { return p1 * d; } friend Point operator/(const Point& p1, long double d) { return Point(p1.px / d, p1.py / d); } Point& operator+=(const Point& p1) { px += p1.px; py += p1.py; return *this; } Point& operator-=(const Point& p1) { px -= p1.px; py -= p1.py; return *this; } Point& operator*=(long double d) { px *= d; py *= d; return *this; } Point& operator/=(long double d) { px /= d; py /= d; return *this; } }; class Segment { public: Point p1, p2; Segment(Point p1_, Point p2_) : p1(p1_), p2(p2_) {}; Segment(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {}; friend bool operator==(const Segment& s1, const Segment& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); } friend bool operator!=(const Segment& s1, const Segment& s2) { return !(s1 == s2); } }; class Line { public: Point p1, p2; Line(Point p1_, Point p2_) : p1(p1_), p2(p2_) {}; Line(long double p1x, long double p1y, long double p2x, long double p2y) : p1(Point(p1x, p1y)), p2(Point(p2x, p2y)) {}; friend bool operator==(const Line& s1, const Line& s2) { return (s1.p1 == s2.p1 && s1.p2 == s2.p2) || (s1.p1 == s2.p2 && s1.p2 == s2.p1); } friend bool operator!=(const Line& s1, const Line& s2) { return !(s1 == s2); } }; // ------ Functions ------ // long double norm(const Point& a) { return a.px * a.px + a.py * a.py; } long double abs(const Point& a) { return sqrtl(norm(a)); } long double dot(const Point& a, const Point& b) { return a.px * b.px + a.py * b.py; } long double crs(const Point& a, const Point& b) { return a.px * b.py - a.py * b.px; } int ccw(Point p0, Point p1, Point p2) { Point a = p1 - p0, b = p2 - p0; if (crs(a, b) > 1e-10) return 1; if (crs(a, b) < -1e-10) return -1; if (dot(a, b) < -1e-10) return 2; if (norm(a) < norm(b)) return -2; return 0; } // ------ Main ------ // Point p1, p2, p3, p4; int r1, r2, r3, r4; int main() { while (~scanf("%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf,%Lf", p1.px, p1.py, p2.px, p2.py, p3.px, p3.py, p4.px, p4.py)) { r1 = ccw(p1, p2, p3); r2 = ccw(p2, p3, p4); r3 = ccw(p3, p4, p1); r4 = ccw(p4, p1, p2); printf("%s\n", (r1 == r2 && r2 == r3 && r3 == r4 && abs(r1) == 1) ? "YES" : "NO"); } return 0; }
a.cc:52:7: error: no matching function for call to 'Point::Point()' 52 | Point p1, p2, p3, p4; int r1, r2, r3, r4; | ^~ a.cc:9:9: note: candidate: 'Point::Point(long double, long double)' 9 | Point(long double px_, long double py_) : px(px_), py(py_) {}; | ^~~~~ a.cc:9:9: note: candidate expects 2 arguments, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(const Point&)' 6 | class Point { | ^~~~~ a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(Point&&)' a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:52:11: error: no matching function for call to 'Point::Point()' 52 | Point p1, p2, p3, p4; int r1, r2, r3, r4; | ^~ a.cc:9:9: note: candidate: 'Point::Point(long double, long double)' 9 | Point(long double px_, long double py_) : px(px_), py(py_) {}; | ^~~~~ a.cc:9:9: note: candidate expects 2 arguments, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(const Point&)' 6 | class Point { | ^~~~~ a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(Point&&)' a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:52:15: error: no matching function for call to 'Point::Point()' 52 | Point p1, p2, p3, p4; int r1, r2, r3, r4; | ^~ a.cc:9:9: note: candidate: 'Point::Point(long double, long double)' 9 | Point(long double px_, long double py_) : px(px_), py(py_) {}; | ^~~~~ a.cc:9:9: note: candidate expects 2 arguments, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(const Point&)' 6 | class Point { | ^~~~~ a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(Point&&)' a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:52:19: error: no matching function for call to 'Point::Point()' 52 | Point p1, p2, p3, p4; int r1, r2, r3, r4; | ^~ a.cc:9:9: note: candidate: 'Point::Point(long double, long double)' 9 | Point(long double px_, long double py_) : px(px_), py(py_) {}; | ^~~~~ a.cc:9:9: note: candidate expects 2 arguments, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(const Point&)' 6 | class Point { | ^~~~~ a.cc:6:7: note: candidate expects 1 argument, 0 provided a.cc:6:7: note: candidate: 'constexpr Point::Point(Point&&)' a.cc:6:7: note: candidate expects 1 argument, 0 provided
s135861626
p00035
C++
#include <cstdio> #include <iostream> using namespace std; #define scanf scanf_s struct p { double x; double y; }; int check(p a, p b, p c, p d) { if (((a.x-b.x)*(c.y-a.y)+(a.y-b.y)*(a.x-c.x)) * ((a.x-b.x)*(d.y-a.y)+(a.y-b.y)+(a.x-d.x))) { return 1; } return 0; } int main() { double x1, x2, x3, x4, y1, y2, y3, y4; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { p a, b, c, d; a.x = x1, a.y = y1; b.x = x2, b.y = y2; c.x = x3, c.y = y3; d.x = x4, d.y = y4; if (check(a,c,b,d) && check(b,d,a,c)) { cout << "NO"; }else { cout << "YES"; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | #define scanf scanf_s | ^~~~~~~ a.cc:22:16: note: in expansion of macro 'scanf' 22 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { | ^~~~~
s436711058
p00035
C++
#include <cstdio> #include <iostream> using namespace std; #define scanf scanf_s struct p { double x; double y; }; int check(struct p a,struct p b,struct p c,struct p d) { if (((a.x-b.x)*(c.y-a.y)+(a.y-b.y)*(a.x-c.x)) * ((a.x-b.x)*(d.y-a.y)+(a.y-b.y)+(a.x-d.x))) { return 1; } return 0; } int main() { double x1, x2, x3, x4, y1, y2, y3, y4; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { p a, b, c, d; a.x = x1, a.y = y1; b.x = x2, b.y = y2; c.x = x3, c.y = y3; d.x = x4, d.y = y4; if (check(a,c,b,d) && check(b,d,a,c)) { cout << "NO"; }else { cout << "YES"; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | #define scanf scanf_s | ^~~~~~~ a.cc:22:16: note: in expansion of macro 'scanf' 22 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { | ^~~~~
s882924512
p00035
C++
#include <cstdio> #include <iostream> using namespace std; #define scanf scanf_s struct p { double x; double y; }; int check(struct p a,struct p b,struct p c,struct p d) { if (((a.x-b.x)*(c.y-a.y)+(a.y-b.y)*(a.x-c.x)) * ((a.x-b.x)*(d.y-a.y)+(a.y-b.y)+(a.x-d.x))) { return 1; } return 0; } int main() { double x1, x2, x3, x4, y1, y2, y3, y4; while (scanf("%f,%f,%f,%f,%f,%f,%f,%f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { p a, b, c, d; a.x = x1, a.y = y1; b.x = x2, b.y = y2; c.x = x3, c.y = y3; d.x = x4, d.y = y4; if (check(a,c,b,d) && check(b,d,a,c)) { cout << "NO"; }else { cout << "YES"; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 5 | #define scanf scanf_s | ^~~~~~~ a.cc:22:16: note: in expansion of macro 'scanf' 22 | while (scanf("%f,%f,%f,%f,%f,%f,%f,%f",&x1,&y1,&x2,&y2,&x3,&y3,&x4,&y4) != EOF) { | ^~~~~
s827871598
p00035
C++
#include <cstdio> #include <complex> #include <iostream> using namespace std; #define scanf scanf_s double cross(complex<double> z1, complex<double> z2) { return z1.real() * z2.imag() - z1.imag() * z2.real(); } int main() { double x1, y1, x2, y2, x3, y3, x4, y4; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF) { complex<double> a(x1, y1), b(x2, y2), c(x3, y3), d(x4, y4); double ab, bc, cd, da; ab = cross(b - a, c - b); bc = cross(c - b, d - c); cd = cross(d - c, a - d); da = cross(a - d, b - a); if ((ab > 0 && bc > 0 && cd > 0 && da > 0) || (ab < 0 && bc < 0 && cd < 0 && da < 0)) { cout << "YES"; }else { cout << "NO"; } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:6:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 6 | #define scanf scanf_s | ^~~~~~~ a.cc:14:16: note: in expansion of macro 'scanf' 14 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &x3, &y3, &x4, &y4) != EOF) { | ^~~~~
s296894608
p00035
C++
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in) .useDelimiter("[,\\s]+"); public static void main(String[] args){ while(scan.hasNext()){ double[] x = new double[4]; double[] y = new double[4]; for(int i = 0; i < 4; i++){ x[i] = scan.nextDouble(); y[i] = scan.nextDouble(); } boolean flag = isIntersect(x[0], y[0], x[2], y[2], x[1], y[1], x[3], y[3]) && isIntersect(x[1], y[1], x[3], y[3], x[0], y[0], x[2], y[2]); System.out.printf("%s\n", flag? "Yes" : "NO"); } } public static boolean isIntersect(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4){ //???A(x1,y1)??¨???B(x2,y2)????????¶??´?????¨???C(x3,y3)??¨???D(x4,y4)????????¶??????????????????????????????????????? double ta = (y3-y1)*(x1-x2) + (x1-x3)*(y1-y2); double tb = (y4-y1)*(x1-x2) + (x1-x4)*(y1-y2); return ta * tb < 0; } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s866544767
p00035
C++
#include<bits/stdc++.h> using namespace std; int main(){ double a,b,c,d,e,f,g,h; while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a,&b,&c,&d,&e,&f,&g,&h)!=EOF){ if((a==c&&g==e&&d==f&&b==h)||(a==g&&c==e&&b==d&&h==f)cout<<"YES"<<endl; else cout<<"NO"<<endl; } }
a.cc: In function 'int main()': a.cc:6:70: error: expected ';' before 'cout' 6 | if((a==c&&g==e&&d==f&&b==h)||(a==g&&c==e&&b==d&&h==f)cout<<"YES"<<endl; | ^~~~ | ; a.cc:7:17: error: expected primary-expression before 'else' 7 | else cout<<"NO"<<endl; | ^~~~ a.cc:6:88: error: expected ')' before 'else' 6 | if((a==c&&g==e&&d==f&&b==h)||(a==g&&c==e&&b==d&&h==f)cout<<"YES"<<endl; | ~ ^ | ) 7 | else cout<<"NO"<<endl; | ~~~~
s447890464
p00035
C++
#include <bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; #define EPS (1e-10) #define equals(a,b) (fabs((a)-(b))<EPS) //CCW??¨/////////////////////////////////// static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON_SEGMENT = 0; ///////////////////////////////////////// class Point{ public: double x,y; Point(double x=0,double y=0):x(x),y(y){} Point operator + (Point p){return Point(x+p.x,y+p.y);} Point operator - (Point p){return Point(x-p.x,y-p.y);} Point operator * (double a){return Point(a*x,a*y);} Point operator / (double a){return Point(x/a,y/a);} bool operator < (const Point &p) const{ return x!=p.x?x<p.x:y<p.y; } bool operator == (const Point &p) const{ return fabs(x-p.x)<EPS&&fabs(y-p.y)<EPS; } }; struct Circle{ Point c; double r; }; typedef Point vect; struct seg{Point p1,p2;}; //????????´????????????????????? double norm(Point p){return p.x*p.x+p.y*p.y;} //??¶????????????????????¬ double abs(Point p){return sqrt(norm(p));} //????????????????????????????????? double dot(Point a,Point b){ return a.x*b.x+a.y*b.y; } //?????? ???????????????????????? double cross(Point a,Point b){ return a.x*b.y-a.y*b.x; } //??´?????????????????¨?????\????????????????????? bool C90(seg s1,seg s2){ return equals(dot(s1.p2-s1.p1,s2.p2-s2.p1),0.0); } //????????????????????¨?????\?????????????????????????????????????????? bool C0(seg s1,seg s2){ return equals(cross(s1.p2-s1.p1,s2.p2-s2.p1),0.0); } //?°???± ??????????????´??????????????? Point project(seg s,Point p){ Point base = s.p2-s.p1; double r=dot(p-s.p1,base) / norm(base); return s.p1+base*r; } //????°???????????????????????????? Point reflection(seg s,Point p){ return p+(project(s,p)-p)*2.0; } //2???????????¢ ??????????????? double getDistancePP(Point a,Point b){ return abs(a-b); } //??´??????????????¢(????°?)??????????????? double getDistanceLP(seg l,Point p){ return abs(cross(l.p2-l.p1,p-l.p1)/abs(l.p2-l.p1)); } //?????????????????¢?????????????????? double getDistanceSP(seg s,Point p){ if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1); if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2); return getDistanceLP(s,p); } //????¨?????????????????¨?????????????????????????????????? int CCW(Point p0,Point p1,Point p2){ Point a=p1-p0; Point b=p2-p0; if(cross(a,b)>EPS)return COUNTER_CLOCKWISE; if(cross(a,b)<-EPS)return CLOCKWISE; if(dot(a,b)<-EPS)return ONLINE_BACK; if(norm(a)<norm(b))return ONLINE_FRONT; return ON_SEGMENT; } //????????????????????????????????????????????§?\???? bool intersect(Point p1,Point p2,Point p3,Point p4){ return(CCW(p1,p2,p3)*CCW(p1,p2,p4)<=0&&CCW(p3,p4,p1)*CCW(p3,p4,p2)<=0); } bool intersect(seg s1,seg s2){ return intersect(s1.p1,s1.p2,s2.p1,s2.p2); } //2??????????§???¢?????\??????????????????...???????????????????????? bool squareintersect(seg s1,seg s2){ if(s1.p2.x<s2.p1.x||s2.p2.x<s1.p1.x)return 0; if(s1.p2.y<s2.p1.y||s2.p2.y<s1.p1.y)return 0; return 1; } //??????????????¢?????????????????????????????§??¨??????????????? double getDistance(seg s1,seg s2){ if(intersect(s1,s2))return 0.0; return min(min(getDistanceSP(s1,s2.p1),getDistanceSP(s1,s2.p2)), min(getDistanceSP(s2,s1.p1),getDistanceSP(s2,s1.p2))); } //??????????????????????????????(?´????????`) Point getCrossPoint(seg s1,seg s2){ Point base=s2.p2-s2.p1; double d1=abs(cross(base,s1.p1-s2.p1)); double d2=abs(cross(base,s1.p2-s2.p1)); double t=d1/(d1+d2); return s1.p1+(s1.p2-s1.p1)*t; } //?????¨??´???????????????2?????? seg getCrossPoint(Circle c,seg l){ //assert(intersect(cc,l)); Point pr=project(l,c.c); Point e=(l.p2-l.p1)/abs(l.p2-l.p1); double base =sqrt(c.r*c.r-norm(pr-c.c)); seg pp;pp.p1=(pr+e*base);pp.p2=(pr-e*base); return pp; } //????´???°2D///////////A???)/////////// typedef complex<double> comp; typedef vector<comp> cvec; //????´??????? double dot(comp a,comp b){return real(b*conj(a));} //????´??????? double cross(comp a,comp b){return imag(b*conj(a));} double Area(cvec &a){ double b=0;int n=a.size(); for(int i=0;i<n;i++) b+=cross(a[i],a[(i+1==n?0:i+1)]); return abs(b/2.0); } ////how to use(exp)///////////////////// // double a,b; cvec t; cin>>n; // // while(n--){ // // cin>>a>>b; // // t.push_back(comp(a,b)); // // }printf("%.11f\n",Area(t)); // //////////////////////////////////////// //???????£????????????¢??????????????¢??????????????????????????\????????????????????§???????????£???????????????????????????????????§????????????????????? int intersectCC(Circle a,Circle b){ double dist=abs(a.c-b.c); if(dist>a.r+b.r+EPS)return 4; if(dist>a.r+b.r-EPS)return 3; if(dist>abs(a.r-b.r)+EPS)return 2; if(dist>abs(a.r-b.r)-EPS)return 1; return 0; } seg scan(){ seg a; scanf("%lf%lf%lf%lf",&a.p1.x,&a.p1.y,&a.p2.x,&a.p2.y); return a; } int main(){ Point a,b,c,d; while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.x,&a.y,&b.x,&b.y,&c.x,&c.y,&c.x,&c.y)!=EOF){ int q1=CCW(a,c,b),q2=CCW(b,d,c),q3=CCW(c,a,d),q4=CCW(d,b,a),q=CCW(a,c,b); if(q==1){if(q1==1&&q2==1&&q3==1&&q4==1)cout<<"YES"<<endl; else cout<<"NO"<<endl;} else{if(q1==-1&&q2==-1-&&q3==-1&&q4==-1)cout<<"YES"<<endl; else cout<<"NO"<<endl;} } }
a.cc: In function 'int main()': a.cc:166:27: error: invalid operands of types 'int' and 'void*' to binary 'operator-' 166 | else{if(q1==-1&&q2==-1-&&q3==-1&&q4==-1)cout<<"YES"<<endl; | ~~^~~~~ | | | | | void* | int a.cc:166:30: error: label 'q3' used but not defined 166 | else{if(q1==-1&&q2==-1-&&q3==-1&&q4==-1)cout<<"YES"<<endl; | ^~
s747946604
p00035
C++
#include <bits/stdc++.h> using namespace std; #include "../..//library/unfinished/convex_hull.cpp" #define fs first #define sc second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define pb emplace_back using pii = pair<int, int>; using vi = vector<int>; using lint = long long; const int inf = 1001001001; const lint linf = 1001001001001001001ll; const int mod = 1e9 + 7; const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1}; template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; } template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; } template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; } template<typename T> inline void print(const vector<T> &v, string s = " ") { rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); } inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; } inline lint in() { lint x; std::cin>>x; return x; } int main() { double a, b; char c; vector<Point> vi; while (cin >> a >> c >> b) { vi.clear(); vi.pb(Point(a, b)); rep(i, 3) { cin >> c >> a >> c >> b; vi.pb(Point(a, b)); } vector<Point> po = convex_hull(vi, vi.size()); cout << (po.size() == vi.size() ? "YES" : "NO") << endl; } }
a.cc:3:10: fatal error: ../..//library/unfinished/convex_hull.cpp: No such file or directory 3 | #include "../..//library/unfinished/convex_hull.cpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s381069903
p00035
C++
#include <bits/stdc++.h> using namespace std; #include "../..//library/unfinished/convex_hull.cpp" #define fs first #define sc second #define all(v) v.begin(), v.end() #define rall(v) v.rbegin(), v.rend() #define rep(i, n) for (int i = 0; i < n; ++i) #define pb emplace_back using pii = pair<int, int>; using vi = vector<int>; using lint = long long; const int inf = 1001001001; const lint linf = 1001001001001001001ll; const int mod = 1e9 + 7; const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1}; template<typename T> inline bool chmin(T &a, T b) { if (a > b) { a = b; } return a > b; } template<typename T> inline bool chmax(T &a, T b) { if (a < b) { a = b; } return a < b; } template<typename T> inline void print(const T &x, string s = "\n") { cout << x << s; } template<typename T> inline void print(const vector<T> &v, string s = " ") { rep(i, v.size()) cout << v[i] << (i + 1 == v.size() ? "\n" : s); } inline bool inside(int y, int x, int H, int W) { return 0 <= y && y < H && 0 <= x && x < W; } inline lint in() { lint x; std::cin>>x; return x; } int main() { double a, b; char c; vector<Point> vi; while (cin >> a >> c >> b) { vi.clear(); vi.pb(Point(a, b)); rep(i, 3) { cin >> c >> a >> c >> b; vi.pb(Point(a, b)); } vector<Point> po = convex_hull(vi, vi.size()); cout << (po.size() == vi.size() ? "YES" : "NO") << endl; } }
a.cc:3:10: fatal error: ../..//library/unfinished/convex_hull.cpp: No such file or directory 3 | #include "../..//library/unfinished/convex_hull.cpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s290401196
p00035
C++
import Data.List.Split import Control.Applicative data YesNo = YES | NO deriving(Show) type Coord = (Double, Double) reshape :: [Double] -> [Coord] reshape [] = [] reshape [_] = [] reshape (x:y:xs) = (x, y) : reshape xs normalForm :: [Coord] -> [Coord] normalForm xs = let minY = minimum (map snd xs) mins = filter (\c -> snd c == minY) xs st = head mins in st : (tail (dropWhile (/= st) xs) ++ takeWhile (/= st) xs) delta :: Coord -> Coord -> Coord -> Double delta x y z = ((fst y - fst x) * (snd z - snd x) - (fst z - fst x) * (snd y - snd x)) / 2 solver' :: [Double] -> YesNo solver' xs = let (p1:p2:p3:p4:_) = normalForm $ reshape xs in if (delta p1 p2 p3 * delta p2 p3 p4 * delta p3 p4 p1 > 0) && ((snd p2 > snd p1) || (snd p2 >= snd p3)) && ((snd p3 > snd p2) || (snd p3 >= snd p4)) && ((snd p4 > snd p3) || (snd p4 >= snd p1)) then YES else NO solver :: [[Double]] -> [YesNo] solver = map solver' main :: IO() main = do contents <- lines <$> getContents let xs = map (map (read :: String -> Double) . splitOn ",") contents mapM_ print $ solver xs
a.cc:15:22: error: stray '\' in program 15 | mins = filter (\c -> snd c == minY) xs | ^ a.cc:24:7: warning: missing terminating ' character 24 | solver' :: [Double] -> YesNo | ^ a.cc:24:7: error: missing terminating ' character 24 | solver' :: [Double] -> YesNo | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:25:7: warning: missing terminating ' character 25 | solver' xs = | ^ a.cc:25:7: error: missing terminating ' character 25 | solver' xs = | ^~~~~~ a.cc:36:20: warning: missing terminating ' character 36 | solver = map solver' | ^ a.cc:36:20: error: missing terminating ' character a.cc:1:1: error: 'import' does not name a type 1 | import Data.List.Split | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s133526926
p00035
C++
#include<iostream> int main() { while (true) { double xa, ya, xb, yb, xc, yc, xd, yd; char foo; std::cin >> xa >> foo >> ya >> foo >> xb >> foo >> yb >> foo >> xc >> foo >> yc >> foo >> xd >> foo >> yd; if (std::cin.eof()) { break; } const double A_C = hypot(xa - xc, ya - yc); const double B_D = hypot(xb - xd, yb - yd); const double AC_B = abs(((yc - ya)*(xb - xc) - (xc - xa)*(yb - yc)) / hypot(yc - ya, xc - xa)); const double BD_A = abs(((yd - yb)*(xa - xd) - (xd - xb)*(ya - yd)) / hypot(yd - yb, xd - xb)); std::cout << (A_C > BD_A&&B_D > AC_B ? "YES" : "NO") << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:36: error: 'hypot' was not declared in this scope 13 | const double A_C = hypot(xa - xc, ya - yc); | ^~~~~
s006904831
p00035
C++
#include<iostream> int main() { while (true) { double xa, ya, xb, yb, xc, yc, xd, yd; char foo; std::cin >> xa >> foo >> ya >> foo >> xb >> foo >> yb >> foo >> xc >> foo >> yc >> foo >> xd >> foo >> yd; if (std::cin.eof()) { break; } const double A_C = std::hypot(xa - xc, ya - yc); const double B_D = std::hypot(xb - xd, yb - yd); const double A_BD = std::abs((yd - yb) * (xa - xd) - (xd - xb) * (ya - yd)) / std::hypot(yd - yb, xd - xb); const double B_AC = std::abs((yc - ya) * (xb - xc) - (xc - xa) * (yb - yc)) / std::hypot(yc - ya, xc - xa); std::cout << (A_C > A_BD && B_D > B_AC ? "YES" : "NO") << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:41: error: 'hypot' is not a member of 'std' 13 | const double A_C = std::hypot(xa - xc, ya - yc); | ^~~~~ a.cc:14:41: error: 'hypot' is not a member of 'std' 14 | const double B_D = std::hypot(xb - xd, yb - yd); | ^~~~~ a.cc:15:100: error: 'hypot' is not a member of 'std' 15 | const double A_BD = std::abs((yd - yb) * (xa - xd) - (xd - xb) * (ya - yd)) / std::hypot(yd - yb, xd - xb); | ^~~~~ a.cc:16:100: error: 'hypot' is not a member of 'std' 16 | const double B_AC = std::abs((yc - ya) * (xb - xc) - (xc - xa) * (yb - yc)) / std::hypot(yc - ya, xc - xa); | ^~~~~
s023939594
p00035
C++
#include<vector> #include<algorithm> #define EPS 1e-9 #define pb(a) push_back(a); #define ID_CCW 0 #define ID_CW 1 #define ID_GO 2 #define ID_BACK 3 using namespace std; class Point{ public: double x,y; Point(){} Point(double xx,double yy) : x(xx),y(yy){} }; Point &operator -=(Point &a,const Point &b) { a.x-=b.x; a.y-=b.y; return a; } double dot(const Point &a,const Point &b) { return a.x*b.x+a.y*b.y; } double cross(const Point &a,const Point &b) { return a.x*b.y-a.y*b.x; } int ccw(const Point &a,Point b,Point c) { b-=a; c-=a; double rotdir=cross(b,c); if(rotdir>EPS) return ID_CCW; if(rotdir<-EPS) return ID_CW; if(dot(b,c)>EPS) return ID_GO; return ID_BACK; } int main() { Point p[4]; while(1){ if(scanf("%lf,%lf",&p[0].x,&p[0].y)==EOF) break; for(int i=1;i<4;i++) scanf(",%lf,%lf",&p[i].x,&p[i].y); bool b1=true; for(int i=0;i<4;i++) if(ccw(p[i],p[(i+1)%4],p[(i+2)%4])!=ID_CCW) b1=false; bool b2=true; for(int i=0;i<4;i++) if(ccw(p[i],p[(i+1)%4],p[(i+2)%4])!=ID_CW) b2=false; puts(b1||b2?"YES":"NO"); } return 0; }
a.cc: In function 'int main()': a.cc:53:20: error: 'scanf' was not declared in this scope 53 | if(scanf("%lf,%lf",&p[0].x,&p[0].y)==EOF) break; | ^~~~~ a.cc:53:54: error: 'EOF' was not declared in this scope 53 | if(scanf("%lf,%lf",&p[0].x,&p[0].y)==EOF) break; | ^~~ a.cc:3:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' 2 | #include<algorithm> +++ |+#include <cstdio> 3 | a.cc:54:41: error: 'scanf' was not declared in this scope 54 | for(int i=1;i<4;i++) scanf(",%lf,%lf",&p[i].x,&p[i].y); | ^~~~~ a.cc:59:17: error: 'puts' was not declared in this scope 59 | puts(b1||b2?"YES":"NO"); | ^~~~
s131267162
p00035
C++
#include<iostream> #include<complex> #define EPS 1.0e-10 using namespace std; typedef complex<double> P; P a[4]; double cross(P a, P b) { return (a.real() * b.imag() - a.imag() * b.real()); } int is_intersected_ls(P a1, P a2, P b1, P b2) { return ( cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1) < EPS ) && ( cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1) < EPS ); } int main(){ double x,y; char c; while(scanf("%lf,%lf",&x,&y)!=EOF){ a[0]=P(x,y); for(int i=1;i<4;i++){ scanf(",%lf,%lf",&x,&y);; a[i]=P(x,y); } if(is_intersected_ls(a[0],a[2],a[1],a[3])) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }ツ 
a.cc:28:2: error: extended character   is not valid in an identifier 28 | }ツ  | ^ a.cc:28:2: error: '\U000030c4\U00003000' does not name a type 28 | }ツ  | ^~~~
s424694644
p00035
C++
#include <iostream> #include <cmath> using namespace std; double tri2s(double xa, double ya, double xb, double yb, double xc, double yc){ double a, b, c, s; a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc)); b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc)); c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); s = (a+b+c) / 2; return sqrt(s * (s - a) * (s - b) * (s - c)); } int main(void){ double x[4], y[4]; double sq; double tri[4]; bool isok = true; while(cin >> x[0]){ cin.ignore(); cin >> y[0]; cin.ignore(); cin >> x[1]; cin.ignore(); cin >> y[1]; cin.ignore(); cin >> x[2]; cin.ignore(); cin >> y[2]; cin.ignore(); cin >> x[3]; cin.ignore(); cin >> y[3]; sq = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]); tri[0] = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]); tri[1] = tri2s(x[0], y[0], x[1], y[1], x[3], y[3]); tri[2] = tri2s(x[0], y[0], x[2], y[2], x[3], y[3]); tri[3] = tri2s(x[1], y[1], x[2], y[3], x[3], y[3]); for(int i=0;i<4;i++){ if(tri[i] > sq) isok = false; } if(isok){ cout << "YES" << endl; }else{ cout << "NO" << endl; } isok = true;0 } return 0; }
a.cc: In function 'int main()': a.cc:46:24: error: expected ';' before '}' token 46 | isok = true;0 | ^ | ; 47 | } | ~
s813208194
p00035
C++
#include <iostream> #include <cmath> typedef complex<double> P; using namespace std; double tri2s(double xa, double ya, double xb, double yb, double xc, double yc){ double a, b, c, s; a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc)); b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc)); c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); s = (a+b+c) / 2; cout << sqrt(s * (s - a) * (s - b) * (s - c)) << endl; return sqrt(s * (s - a) * (s - b) * (s - c)); } double p2deg(double xa, double ya, double xb, double yb, double xc, double yc){ double a, b, c, s, cos; a = sqrt((xb - xc) * (xb - xc) + (yb - yc) * (yb - yc)); b = sqrt((xa - xc) * (xa - xc) + (ya - yc) * (ya - yc)); c = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya)); cos = (b * b + c * c - a * a) / 2 * b * c; return acos(cos); } // ツ陳シツ静シp1,p2ツづ静シツ閉ェp3,p4ツづ個古ーツ債キツ板サツ津ィ // (n < 0)<=>ツ古ーツ債キ , (n == 0)<=>ツ陳シツ静シツ湘」, (n > 0)<=>ツ古ーツ債キツつオツづつ「ツづ按つ「 double isIntersect(P p1, P p2, P p3, P p4){ return ( (p1.X-p2.X)*(p3.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p3.X)) * ((p1.X-p2.X)*(p4.Y-p1.Y) + (p1.Y-p2.Y)*(p1.X-p4.X)); } int main(void){ double x[4], y[4]; double sq; double tri[4]; bool isok = true; while(cin >> x[0]){ cin.ignore(); cin >> y[0]; cin.ignore(); cin >> x[1]; cin.ignore(); cin >> y[1]; cin.ignore(); cin >> x[2]; cin.ignore(); cin >> y[2]; cin.ignore(); cin >> x[3]; cin.ignore(); cin >> y[3]; P a(x[0], y[0]); P b(x[1], y[1]); P c(x[2], y[2]); P d(x[3], y[3]); /* sq = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]); tri[0] = tri2s(x[0], y[0], x[1], y[1], x[2], y[2]); tri[1] = tri2s(x[0], y[0], x[1], y[1], x[3], y[3]); tri[2] = tri2s(x[0], y[0], x[2], y[2], x[3], y[3]); tri[3] = tri2s(x[1], y[1], x[2], y[3], x[3], y[3]); for(int i=0;i<4;i++){ if(tri[i] > sq) isok = false; } if(tri2s(x[0],y[0],x[1],y[1],x[2],y[2]) + tri2s(x[0],y[0],x[2],y[2],x[3],y[3]) == tri2s(x[0],y[0],x[1],y[1],x[3],y[3]) + tri2s(x[2],y[2],x[1],y[1],x[3],y[3]) ){ cout << "YES" << endl; }else{ cout << "NO" << endl; } isok = true; */ if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ printf("NO\n"); }else{ printf("YES\n"); } } return 0; }
a.cc:4:9: error: 'complex' does not name a type 4 | typedef complex<double> P; | ^~~~~~~ a.cc:37:20: error: 'P' was not declared in this scope 37 | double isIntersect(P p1, P p2, P p3, P p4){ | ^ a.cc:37:26: error: 'P' was not declared in this scope 37 | double isIntersect(P p1, P p2, P p3, P p4){ | ^ a.cc:37:32: error: 'P' was not declared in this scope 37 | double isIntersect(P p1, P p2, P p3, P p4){ | ^ a.cc:37:38: error: 'P' was not declared in this scope 37 | double isIntersect(P p1, P p2, P p3, P p4){ | ^ a.cc:37:42: error: expression list treated as compound expression in initializer [-fpermissive] 37 | double isIntersect(P p1, P p2, P p3, P p4){ | ^ a.cc: In function 'int main()': a.cc:53:19: error: 'P' was not declared in this scope 53 | P a(x[0], y[0]); | ^ a.cc:54:20: error: expected ';' before 'b' 54 | P b(x[1], y[1]); | ^~ | ; a.cc:55:20: error: expected ';' before 'c' 55 | P c(x[2], y[2]); | ^~ | ; a.cc:56:20: error: expected ';' before 'd' 56 | P d(x[3], y[3]); | ^~ | ; a.cc:77:35: error: 'a' was not declared in this scope 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ^ a.cc:77:37: error: 'c' was not declared in this scope 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ^ a.cc:77:39: error: 'b' was not declared in this scope 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ^ a.cc:77:41: error: 'd' was not declared in this scope 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ^ a.cc:77:42: error: 'isIntersect' cannot be used as a function 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ^ a.cc:77:64: error: 'isIntersect' cannot be used as a function 77 | if( isIntersect(a,c,b,d) > 0.0 || isIntersect(b,d,a,c) > 0.0 ){ | ~~~~~~~~~~~^~~~~~~~~
s555701766
p00035
C++
#include <cmath> #include <complex> #include <vector> #include <cfloat> #include <algorithm> using namespace std; class point; class line; point vec_add(point vec1,point vec2);//ベクトルの足し算 point vec_sub(point vec1,point vec2);//ベクトルの引き算 double inner_product(point a,point b);//内積 double outer_product(point a,point b);//外積 bool vec_parallel(point vec1,point vec2);//ベクトルの並行判定(交差判定falseとしても使える) bool vec_angle_right(point vec1,point vec2);//ベクトルの直行判定 bool cross_line_segment(line a,point p1,point p2);//直線と線分の交差判定 class point{ public: double x,y; point(){ x=0; y=0; } point(double a,double b){ x=a; y=b; } void in(double a,double b){ x=a; y=b; return ; } }; //直線クラス class line{ public: point s,v; public: line(point a,point b){ s=a; v=vec_sub(a,b); } }; //ベクトルの足し算 point vec_add(point vec1,point vec2){ point res(vec1.x+vec2.x,vec1.y+vec2.y); return res; } //ベクトルの引き算 point vec_sub(point vec1,point vec2){ point res(vec1.x-vec2.x,vec1.y-vec2.y); return res; } //内積 double inner_product(point a,point b){ return a.x * b.x + a.y * b.y; } //外積 double outer_product(point a,point b){ return a.x * b.y - a.y * b.x; } point p[6]; bool solve(){ bool judge; bool ans; if(outer_product(p[0],p[1])>0){ judge=true; }else{ judge =false; } for(int i=1;i<4;i++){ if(outer_product(p[i],p[i+1])>0){ if(judge!=true) return false; }else if(outer_product(p[i],p[i+1])==0){ return false; }else{ if(judge!=false) return false; } } return true; } int main(){ while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&p[0].x,&p[0].y,&p[1].x,&p[1].y,&p[2].x,&p[2].y,&p[3].x,&p[3].y)!=EOF){ p[4]=p[0]; p[5]=p[1]; for(int i=0;i<5;i++){ p[i]=vec_sub(p[i],p[i+1]); } bool ans=solve(); if(ans){ cout<<"YES"<<endl; }else{ cout<<"NO"<<endl; } } }
a.cc: In function 'int main()': a.cc:99:25: error: 'cout' was not declared in this scope 99 | cout<<"YES"<<endl; | ^~~~ a.cc:6:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 5 | #include <algorithm> +++ |+#include <iostream> 6 | using namespace std; a.cc:101:25: error: 'cout' was not declared in this scope 101 | cout<<"NO"<<endl; | ^~~~ a.cc:101:25: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
s621925788
p00035
C++
#include<iostream> #include<stdio.h> using namespace std; int main() { double ax,ay,bx,by,cx,cy,dx,dy; while(scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&ax,&ay,&bx,&by,&cx,&cy,&dx,&dy)) { if(((ax-cx)*(by-ay)+(ay-cy)*(ax-bx))*((ax-cx)*(dy-ay)+(ay-cy)*(ax-dx))<=0&& ((bx-dx)*(ay-by)+(by-dy)*(bx-ax))*((bx-dx)*(cy-by)+(by-dy)*(bx-cx))<=0) cout<<"Yes"<<endl; else cout<<"No"<<endl } }
a.cc: In function 'int main()': a.cc:12:30: error: expected ';' before '}' token 12 | else cout<<"No"<<endl | ^ | ; 13 | } | ~
s008245332
p00035
C++
#include<iostream> #include<complex> #define eps 10e-9 using namespace std; typedef complex<double> p; double cross(p x,p y) { return x.real()*y.imag()-x.imag()*y.real(); } int main() { p a,b,c,d; while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) { double tmp=1; tmp*=cross(b-a,d-a); bool flag=true; if(tmp*cross(c-b,a-b)<-eps||tmp*cross(d-c,b-c)<-eps||tmp*cross(a-d,c-d)<-eps) flag=false; cout<<(flag?"YES":"NO")<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:63: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:73: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:83: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:93: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:103: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:113: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:123: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~ a.cc:15:133: error: lvalue required as unary '&' operand 15 | while (scanf("%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf",&a.real(),&a.imag(),&b.real(),&b.imag(),&c.real(),&c.imag(),&d.real(),&d.imag())!=EOF) | ~~~~~~^~
s492037206
p00035
C++
#include <iostream> #include <cmath> #include <vector> #include <string> #include <algorithm> #include <climits> using namespace std; double EPS = 1e-12; //誤差を考慮して足し算を行う double add(double a, double b) { if( abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; } return a + b; } //二次元ベクトル構造体 struct P { double x, y; P() {}; P(double x, double y) : x(x), y(y) { } P operator + (P p) { return P(add(x, p.x), add(y, p.y)); } P operator - (P p) { return P(add(x, -p.x), add(y, -p.y)); } P operator * (double d) { return P(x * d, y * d); } double dot(P p) { // 内積 return add(x * p.x, y * p.y); } double det(P p) { // 外積 return add(x * p.y, -y * p.x); } }; // 線分p1-p2上に点qがあるか判定 bool on_seg(P p1, P p2, P q) { return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0; } // 直線p1-p2と直線q1-q2の交点 P intersection(P p1, P p2, P q1, P q2) { return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1)); } int ccw(P a, P b, P c) { a = b - a; b = b - c; if(a.det(b) < 0) { return -1; } else if(a.det(b) > 0) { return 1; } return 0; } int main() { string str; while (getline(cin, str)) { replace(str.begin(), str.end(), ',', ' '); stringstream buf(str); P p[4]; for (int i = 0; i < 4; i++) { buf >> p[i].x >> p[i].y; } int cnt = 0, n = 0; for (int i = 0; i < 4; i++) { int c = ccw(p[i], p[(i+1)%4], p[(i+2)%4]); cnt += c; n += abs(c); } cout << (abs(cnt) == n ? "YES" : "NO") << endl; } } }
a.cc: In function 'int main()': a.cc:74:29: error: variable 'std::stringstream buf' has initializer but incomplete type 74 | stringstream buf(str); | ^ a.cc: At global scope: a.cc:90:1: error: expected declaration before '}' token 90 | } | ^
s851657582
p00035
C++
#include <iostream> #include <cmath> #include <vector> #include <string> #include <algorithm> #include <climits> #include <sstream> using namespace std; double EPS = 1e-12; //誤差を考慮して足し算を行う double add(double a, double b) { if( abs(a + b) < EPS * (abs(a) + abs(b))) { return 0; } return a + b; } //二次元ベクトル構造体 struct P { double x, y; P() {}; P(double x, double y) : x(x), y(y) { } P operator + (P p) { return P(add(x, p.x), add(y, p.y)); } P operator - (P p) { return P(add(x, -p.x), add(y, -p.y)); } P operator * (double d) { return P(x * d, y * d); } double dot(P p) { // 内積 return add(x * p.x, y * p.y); } double det(P p) { // 外積 return add(x * p.y, -y * p.x); } }; // 線分p1-p2上に点qがあるか判定 bool on_seg(P p1, P p2, P q) { return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0; } // 直線p1-p2と直線q1-q2の交点 P intersection(P p1, P p2, P q1, P q2) { return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1)); } int ccw(P a, P b, P c) { a = b - a; b = b - c; if(a.det(b) < 0) { return -1; } else if(a.det(b) > 0) { return 1; } return 0; } int main() { string str; while (getline(cin, str)) { replace(str.begin(), str.end(), ',', ' '); stringstream buf(str); P p[4]; for (int i = 0; i < 4; i++) { buf >> p[i].x >> p[i].y; } int cnt = 0, n = 0; for (int i = 0; i < 4; i++) { int c = ccw(p[i], p[(i+1)%4], p[(i+2)%4]); cnt += c; n += abs(c); } cout << (abs(cnt) == n ? "YES" : "NO") << endl; } } }
a.cc:91:1: error: expected declaration before '}' token 91 | } | ^
s773737380
p00035
C++
#include <iostream> #include <cmath> #include <complex> using namespace std; typedef complex<double> P; #define x real() #define y imag() double isIntersect(P p1, P p2,P p3,P p4 ){ return (((p1.x - p2.x)*(p3.y - p1.y)+(p1.y-p2.y)*(p1.x-p3.x))*((p1.x - p2.x)*(p4.y - p1.y)+(p1.y-p2.y)*(p1.x-p4.x))); } int main(){ double xa,ya,xb,yb,xc,yc,xd,yd;
a.cc: In function 'int main()': a.cc:16:34: error: expected '}' at end of input 16 | double xa,ya,xb,yb,xc,yc,xd,yd; | ^ a.cc:15:11: note: to match this '{' 15 | int main(){ | ^
s749328703
p00035
C++
#include <iostream> using namespace std; int main(){ char trash; double x[4], y[4]; while(cin >> x[0] >> trash >> y[0]){ double p, q, r; for(int i = 1; i < 4; i++){ cin >> trash >> x[i] >> trash >> y[i]; } p = ((y[1]-y[0])*(x[3]-x[0])/(x[1]-x[0]))+y[0]; q = ((y[2]-y[1])*(x[3]-x[1])/(x[2]-x[1]))+y[1]; r = ((y[2]-y[0])*(x[3]-x[0])/(x[2]-x[0]))+y[0]; if(x[0] == x[2]){ if(x[0] > x[1]){ if(x[0] > x[3]){ cout << "NO" << endl; } else{ if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } else{ if(x[0] < x[3]){ cout << "NO" << endl; } else{ if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } } else if(x[0] == x[1]){ if(x[0] > x[2]){ if(x[0] < x[2]){ cout << "NO" << endl; } else{ if(q > y[3]){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } else{ if(x[0] > x[2]){ cout << "NO" << endl; } else{ if(q > y[3]){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } } else if(x[1] == x[2]){ if(x[0] > x[1]){ if(x[1] > x[3]){ cout << "NO" << endl; } else{ if(p < y[3]){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } else{ if(x[1] < x[3]){ cout << "NO" << endl; } else{ if(p < y[3]){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } } else{ if(r > y[1]){ if(r > y[3]){ cout << "NO" << endl; } else{ if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } else{ if(r < y[3]){ cout << "NO" << endl; } else{ if((p < y[3] && q > y[3]) || (p > y[3] && q < y[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } } }
a.cc: In function 'int main()': a.cc:126:18: error: expected '}' at end of input 126 | } | ^ a.cc:7:44: note: to match this '{' 7 | while(cin >> x[0] >> trash >> y[0]){ | ^ a.cc:126:18: error: expected '}' at end of input 126 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s251436260
p00035
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ char trash; double x[4], y[4]; while(cin >> x[0] >> trash >> y[0]){ double a,b,c,d,e,f,t; for(int i = 1; i < 4; i++){ cin >> trash >> x[i] >> trash >> y[i]; } a = y[2]-y[0]; b = -x[2]+x[0]; e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0])); c = y[3]-y[1]; d = -x[3]+x[1]; f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1])); t = (e*d-b*f)/(a*d-b*c); if(x[2] < x[0]){ swap(x[0],x[2]); } if(x[3] < x[1]){ swap(x[1],x[3]); } if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } }
a.cc: In function 'int main()': a.cc:26:24: error: expected primary-expression before '>' token 26 | if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ | ^ a.cc:26:52: error: expected primary-expression before '>' token 26 | if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ | ^
s103562036
p00035
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ char trash; double x[4], y[4]; while(cin >> x[0] >> trash >> y[0]){ double a,b,c,d,e,f,t; for(int i = 1; i < 4; i++){ cin >> trash >> x[i] >> trash >> y[i]; } a = y[2]-y[0]; b = -x[2]+x[0]; e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0])); c = y[3]-y[1]; d = -x[3]+x[1]; f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1])); t = (e*d-b*f)/(a*d-b*c); if(x[2] < x[0]){ swap(x[0],x[2]); } if(x[3] < x[1]){ swap(x[1],x[3]); } if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } } }
a.cc: In function 'int main()': a.cc:26:24: error: expected primary-expression before '>' token 26 | if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ | ^ a.cc:26:52: error: expected primary-expression before '>' token 26 | if((t => x[0] && t <= x[2]) && (t => x[1] && t <= x[3])){ | ^
s489807468
p00035
C++
#include <iostream> #include <algorithm> using namespace std; int main(){ char trash; double x[4], y[4]; while(cin >> x[0] >> trash >> y[0]){ double a,b,c,d,e,f,t; for(int i = 1; i < 4; i++){ cin >> trash >> x[i] >> trash >> y[i]; } a = y[2]-y[0]; b = -x[2]+x[0]; e = -1*(y[0]*(x[2]-x[0])-x[0]*(y[2]-y[0])); c = y[3]-y[1]; d = -x[3]+x[1]; f = -1*(y[1]*(x[3]-x[1])-x[1]*(y[3]-y[1])); t = (e*d-b*f)/(a*d-b*c); if(x[2] < x[0]){ swap(x[0],x[2]); } if(x[3] < x[1]){ swap(x[1],x[3]); } if((t >= x[0] && t <= x[2]) && (t >= x[1] && t <= x[3])){ cout << "YES" << endl; } else{ cout << "NO" << endl; } }
a.cc: In function 'int main()': a.cc:32:10: error: expected '}' at end of input 32 | } | ^ a.cc:5:11: note: to match this '{' 5 | int main(){ | ^
s168684336
p00035
C++
#include<iostream> #include<cfloat> #include<cassert> #include<cmath> #include<vector> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS ) #define dle(a, b) (equals(a, b) || a < b ) static const double PI = acos(-1); class Point{ public: double x, y; Point ( double x = 0, double y = 0): x(x), y(y){} Point operator + ( Point p ){ return Point(x + p.x, y + p.y); } Point operator - ( Point p ){ return Point(x - p.x, y - p.y); } Point operator * ( double a ){ return Point(x*a, y*a); } Point operator / ( double a ){ return Point(x/a, y/a); } double abs() { return sqrt(norm());} double norm() { return x*x + y*y; } bool operator < ( const Point &p ) const { return x != p.x ? x < p.x : y < p.y; } bool operator == ( const Point &p ) const { return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS; } }; class Segment{ public: Point p1, p2; Segment ( Point p1 = Point(0.0,0.0), Point p2 = Point(0.0,0.0)): p1(p1), p2(p2){} double abs() { return sqrt(norm());} double norm() { return (p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y); } }; typedef Segment Line; typedef Point Vector; typedef vector<Point> Polygon; double norm( Vector a ){ return a.x*a.x + a.y*a.y; } double abs( Vector a ){ return sqrt(norm(a)); } Point polar( double a, double r ){ return Point(cos(r)*a, sin(r)*a);} double getDistance( Vector a, Vector b ){ return abs(a - b); } double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; } double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; } bool isOrthogonal( Vector a, Vector b){ return equals(dot(a,b),0.0); } bool isOrthogonal(Segment s1,Segment s2){ return equals( dot(s1.p2-s1.p1 , s2.p2-s2.p1) ,0.0 ); } bool isParallel(Vector a, Vector b){ return equals(cross(a,b),0.0); } bool isParallel(Point a1,Point a2,Point b1,Point b2){ return isParallel(a1-a2,b1-b2); } bool isParallel(Segment s1,Segment s2){ return equals(cross(s1.p2 - s1.p1 , s2.p2 - s2.p1),0.0); } Point project(Segment s,Point p){ Vector base = s.p2-s.p1; double t = dot(p-s.p1,base)/norm(base); return s.p1+base*t; } Point reflect(Segment s,Point p){ return p + (project(s,p)-p)*2.0; } static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON_SEGMENT = 0; // EPS can be 0 // need to check for 920, 833, 866 int ccw( Point p0, Point p1, Point p2 ){ Vector a = p1 - p0; Vector b = p2 - p0; if ( cross(a, b) > EPS ) return COUNTER_CLOCKWISE; if ( cross(a, b) < -EPS ) return CLOCKWISE; if ( dot(a, b) < -EPS ) return ONLINE_BACK; if ( norm(a) < norm(b) ) return ONLINE_FRONT; return ON_SEGMENT; } bool isIntersect(Point p1, Point p2,Point p3,Point p4){ return (ccw(p1,p2,p3) * ccw(p1,p2,p4) <=0 && ccw(p3,p4,p1) * ccw(p3,p4,p2) <=0); } bool isIntersect(Segment s1,Segment s2){ return isIntersect(s1.p1 , s1.p2 , s2.p1 , s2.p2); } Point getCrossPoint(Segment s1,Segment s2){ assert(isIntersect(s1,s2)); Vector base = s2.p2 - s2.p1; double d1 = abs(cross(base, s1.p1-s2.p1)); double d2 = abs(cross(base, s1.p1-s2.p1)); double t = d1/(d1+d2); return s1.p1 + (s1.p2 - s1.p1)*t; } double getDistanceLP(Line s,Point p){ return abs(cross(s.p2-s.p1,p-s.p1)/abs(s.p2-s.p1)); } double getDistanceSP(Segment s,Point p){ if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1); if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2); return getDistanceLP(s,p); } double getDistance(Segment s1,Segment s2){ if(isIntersect(s1,s2))return 0.0; return min(min(getDistanceSP(s1,s2.p1),getDistanceSP(s1,s2.p2)), min(getDistanceSP(s2,s1.p1),getDistanceSP(s2,s1.p2))); } bool isConvex( Point P[4] ){ int c = ccw(P[0], P[1], P[2]); for ( int i = 1; i < 4; i++ ){ if ( c != ccw(P[i], P[(i+1)%4], P[(i+2)%4] )) return false; } return true; } bool isConvex( vector<Point> P ){ int c = ccw(P[0], P[1], P[2]); for ( int i = 1; i < 4; i++ ){ if ( c != ccw(P[i], P[(i+1)%4], P[(i+2)%4] )) return false; } return true; } Polygon andrewScan(Polygon s){ Polygon u,l; if(s.size()<3)return s; sort(s.begin(),s.end()); u.push_back(s[0]); u.push_back(s[1]); l.push_back(s[s.size()-1]); l.push_back(s[s.size()-2]); //int n; for(int i=2;i<(int)s.size();i++){ for(int n=u.size();n>=2&&ccw(l[n-2],l[n-1],s[i])!=CLOCKWISE;n--){ u.pop_back(); } u.push_back(s[i]); } for(int i=s.size()-3;i>=0;i--){ for(int n=l.size();n>=2&&ccw(l[n-2],l[n-1],s[i])!=CLOCKWISE;n--){ l.pop_back(); } l.push_back(s[i]); } reverse(l.begin(),l.end()); for(int i=u.size()-2;i>=1;i--)l.push_back(u[i]); return l; } int main(){ Point in; vector<Point> t; for(int i=0;i<4;i++){ cin>>in.x>>in.y; t.push_back(in); } cout<<(isConvex(t)==true?"YES":"NO")<<endl; return 0; }
a.cc: In function 'Polygon andrewScan(Polygon)': a.cc:147:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 147 | sort(s.begin(),s.end()); | ^~~~ | sqrt a.cc:168:3: error: 'reverse' was not declared in this scope 168 | reverse(l.begin(),l.end()); | ^~~~~~~
s911637169
p00035
C++
#include<cfloat> #include<cassert> #include<cmath> #include<vector> #include<algorithm> #include<stdio.h> using namespace std; #define EPS (1e-10) #define equals(a, b) (fabs((a) - (b)) < EPS ) #define dle(a, b) (equals(a, b) || a < b ) static const double PI = acos(-1); class Point{ public: double x, y; Point ( double x = 0, double y = 0): x(x), y(y){} Point operator + ( Point p ){ return Point(x + p.x, y + p.y); } Point operator - ( Point p ){ return Point(x - p.x, y - p.y); } Point operator * ( double a ){ return Point(x*a, y*a); } Point operator / ( double a ){ return Point(x/a, y/a); } double abs() { return sqrt(norm());} double norm() { return x*x + y*y; } bool operator < ( const Point &p ) const { return x != p.x ? x < p.x : y < p.y; } bool operator == ( const Point &p ) const { return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS; } }; class Segment{ public: Point p1, p2; Segment ( Point p1 = Point(0.0,0.0), Point p2 = Point(0.0,0.0)): p1(p1), p2(p2){} double abs() { return sqrt(norm());} double norm() { return (p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y); } }; typedef Segment Line; typedef Point Vector; typedef vector<Point> Polygon; double norm( Vector a ){ return a.x*a.x + a.y*a.y; } double abs( Vector a ){ return sqrt(norm(a)); } Point polar( double a, double r ){ return Point(cos(r)*a, sin(r)*a);} double getDistance( Vector a, Vector b ){ return abs(a - b); } double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; } double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; } bool isOrthogonal( Vector a, Vector b){ return equals(dot(a,b),0.0); } bool isOrthogonal(Segment s1,Segment s2){ return equals( dot(s1.p2-s1.p1 , s2.p2-s2.p1) ,0.0 ); } bool isParallel(Vector a, Vector b){ return equals(cross(a,b),0.0); } bool isParallel(Point a1,Point a2,Point b1,Point b2){ return isParallel(a1-a2,b1-b2); } bool isParallel(Segment s1,Segment s2){ return equals(cross(s1.p2 - s1.p1 , s2.p2 - s2.p1),0.0); } Point project(Segment s,Point p){ Vector base = s.p2-s.p1; double t = dot(p-s.p1,base)/norm(base); return s.p1+base*t; } Point reflect(Segment s,Point p){ return p + (project(s,p)-p)*2.0; } static const int COUNTER_CLOCKWISE = 1; static const int CLOCKWISE = -1; static const int ONLINE_BACK = 2; static const int ONLINE_FRONT = -2; static const int ON_SEGMENT = 0; // EPS can be 0 // need to check for 920, 833, 866 int ccw( Point p0, Point p1, Point p2 ){ Vector a = p1 - p0; Vector b = p2 - p0; if ( cross(a, b) > EPS ) return COUNTER_CLOCKWISE; if ( cross(a, b) < -EPS ) return CLOCKWISE; if ( dot(a, b) < -EPS ) return ONLINE_BACK; if ( norm(a) < norm(b) ) return ONLINE_FRONT; return ON_SEGMENT; } bool isIntersect(Point p1, Point p2,Point p3,Point p4){ return (ccw(p1,p2,p3) * ccw(p1,p2,p4) <=0 && ccw(p3,p4,p1) * ccw(p3,p4,p2) <=0); } bool isIntersect(Segment s1,Segment s2){ return isIntersect(s1.p1 , s1.p2 , s2.p1 , s2.p2); } Point getCrossPoint(Segment s1,Segment s2){ assert(isIntersect(s1,s2)); Vector base = s2.p2 - s2.p1; double d1 = abs(cross(base, s1.p1-s2.p1)); double d2 = abs(cross(base, s1.p1-s2.p1)); double t = d1/(d1+d2); return s1.p1 + (s1.p2 - s1.p1)*t; } double getDistanceLP(Line s,Point p){ return abs(cross(s.p2-s.p1,p-s.p1)/abs(s.p2-s.p1)); } double getDistanceSP(Segment s,Point p){ if(dot(s.p2-s.p1,p-s.p1)<0.0)return abs(p-s.p1); if(dot(s.p1-s.p2,p-s.p2)<0.0)return abs(p-s.p2); return getDistanceLP(s,p); } double getDistance(Segment s1,Segment s2){ if(isIntersect(s1,s2))return 0.0; return min(min(getDistanceSP(s1,s2.p1),getDistanceSP(s1,s2.p2)), min(getDistanceSP(s2,s1.p1),getDistanceSP(s2,s1.p2))); } bool isConvex( Point P[4] ){ int c = ccw(P[0], P[1], P[2]); for ( int i = 1; i < 4; i++ ){ if ( c != ccw(P[i], P[(i+1)%4], P[(i+2)%4] )) return false; } return true; } bool isConvex( vector<Point> P ){ int c = ccw(P[0], P[1], P[2]); for ( int i = 1; i < 4; i++ ){ if ( c != ccw(P[i], P[(i+1)%4], P[(i+2)%4] )) return false; } return true; } Polygon andrewScan(Polygon s){ Polygon u,l; if(s.size()<3)return s; sort(s.begin(),s.end()); u.push_back(s[0]); u.push_back(s[1]); l.push_back(s[s.size()-1]); l.push_back(s[s.size()-2]); //int n; for(int i=2;i<(int)s.size();i++){ for(int n=u.size();n>=2&&ccw(l[n-2],l[n-1],s[i])!=CLOCKWISE;n--){ u.pop_back(); } u.push_back(s[i]); } for(int i=s.size()-3;i>=0;i--){ for(int n=l.size();n>=2&&ccw(l[n-2],l[n-1],s[i])!=CLOCKWISE;n--){ l.pop_back(); } l.push_back(s[i]); } reverse(l.begin(),l.end()); for(int i=u.size()-2;i>=1;i--)l.push_back(u[i]); return l; } int main(){ char ch; Point in[4]; while(cin>>in[0].x>>ch>>in[0].y>>ch>>in[1].x>>ch>>in[1].y>>ch>>in[2].x>>ch>>in[2].y>>ch>>in[3].x>>ch>>in[3].y){ vector<Point> t; for(int i=0;i<4;i++){ t.push_back(in[i]); } cout<<(isConvex(t)==true?"YES":"NO")<<endl; //cout<<"a"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:184:9: error: 'cin' was not declared in this scope 184 | while(cin>>in[0].x>>ch>>in[0].y>>ch>>in[1].x>>ch>>in[1].y>>ch>>in[2].x>>ch>>in[2].y>>ch>>in[3].x>>ch>>in[3].y){ | ^~~ a.cc:7:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 6 | #include<stdio.h> +++ |+#include <iostream> 7 | using namespace std; a.cc:190:5: error: 'cout' was not declared in this scope 190 | cout<<(isConvex(t)==true?"YES":"NO")<<endl; | ^~~~ a.cc:190:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' a.cc:190:43: error: 'endl' was not declared in this scope 190 | cout<<(isConvex(t)==true?"YES":"NO")<<endl; | ^~~~ a.cc:7:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 6 | #include<stdio.h> +++ |+#include <ostream> 7 | using namespace std;
s047729644
p00036
Java
import java.util.Scanner; public class AOJ_Volume0036 { private static int[][] a = new int[8][8]; public static void main(String[] args){ Scanner sc = new Scanner(System.in); while(sc.hasNext()){ String[] s = new String[8]; for(int i=0;i<8;i++){ s[i] = sc.nextLine(); String[] temp = s[i].split(""); for(int j=0;j<8;j++){ a[i][j] = Integer.parseInt(temp[j+1]); } } boolean flag = true; for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ if(Check_A(i,j) && flag){ System.out.println("A"); flag = false; } if(Check_B(i,j) && flag){ System.out.println("B"); flag = false; } if(Check_C(i,j) && flag){ System.out.println("C"); flag = false; } if(Check_D(i,j) && flag){ System.out.println("D"); flag = false; } if(Check_E(i,j) && flag){ System.out.println("E"); flag = false; } if(Check_F(i,j) && flag){ System.out.println("F"); flag = false; } if(Check_G(i,j) && flag){ System.out.println("G"); flag = false; } } } } } private static boolean ch(int i,int j){ if(a[i][j] == 1) return true; return false; } private static boolean Check_A(int i,int j){ if(i+1 < 8 && j+1 < 8){ if(ch(i,j) && ch(i+1,j) && ch(i,j+1) && ch(i+1,j+1)) return true; } return false; } private static boolean Check_B(int i,int j){ if(i+1 < 8 && i+2 < 8 && i+3 < 8){ if(ch(i,j) && ch(i+1,j) && ch(i+2,j) && ch(i+3,j)) return true; } return false; } private static boolean Check_C(int i,int j){ if(j+1 < 8 && j+2 < 8 && j+3 < 8){ if(ch(i,j) && ch(i,j+1) && ch(i,j+2) && ch(i,j+3)) return true; } return false; } private static boolean Check_D(int i,int j){ if(j-1 >= 0 && i+1 < 8 && i+2 < 8){ if(ch(i,j) && ch(i+1,j) && ch(i+1,j-1) && ch(i+2,j-1)) return true; } return false; } private static boolean Check_E(int i,int j){ if(i+1 < 8 && j+1 < 8 && j+2 < 8){ if(ch(i,j) && ch(i,j+1) && ch(i+1,j+1) && ch(i+1,j+2)) return true; } return false; } private static boolean Check_F(int i,int j){ if(i+1 < 8 && i+2 < 8 && j+1 < 8){ if(ch(i,j) && ch(i+1,j) && ch(i+1,j+1)&& ch(i+2,j+1)) return true; } return false; } private static boolean Check_G(int i,int j){ if(i+1 < 8 && j+1 < 8 && j-1 >= 0){ if(ch(i,j) && ch(i+1,j) && ch(i,j+1) && ch(i+1,j-1)) return true; } return false; } }
Main.java:4: error: class AOJ_Volume0036 is public, should be declared in a file named AOJ_Volume0036.java public class AOJ_Volume0036 { ^ 1 error
s874834225
p00036
Java
import java.util.Scanner; public class Main2 { public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ int[] a=new int[8]; for(int i=0;i<8;i++){ a[i]=Integer.parseInt(sc.next(),2); } for(int i=0;i<8;i++){ if(a[i]>0){ if(i==7){System.out.println("C");break;} else if(a[i+1]==0){System.out.println("C"); break;} else{ if(a[i]==a[i+1]){ if(i+2==8){System.out.println("A");break;} else{ if(a[i]==a[i+2]){System.out.println("B"); break; } else{System.out.println("A");break;} } }else if(a[i+1]==a[i]+a[i]*2){System.out.println("D"); break; }else if(a[i]==a[i+1]*2){System.out.println("E"); break; }else if(a[i+1]==a[i]+a[i]/2){System.out.println("F"); break; }else{System.out.println("G"); break; } } } } } } }
Main.java:2: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s911475583
p00036
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; char[][] map=new char[8][8]; int[] ax={1,0,1}; int[] ay={0,1,1}; int[] bx={1,2,3}; int[] by={0,0,0}; int[] cx={0,0,0}; int[] cy={1,2,3}; int[] dx={1,1,2}; int[] dy={0,-1,-1}; int[] ex={0,1,1}; int[] ey={1,1,2}; int[] fx={1,1,2}; int[] fy={0,1,1}; int[] gx={0,1,1}; int[] gy={1,0,-1}; while((line=br.readLine()!=null){ if(line.isEmpty()){ line=br.readLine(); } boolean flag=false; boolean f=false; for(int j=0;j<8;i++){ map[0][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } for(int i=1;i<8;i++){ line=br.readLine(); for(int j=0;j<8;i++){ map[i][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } } } for(int i=0;i<3;i++){ if(map[tx+ax[i]][ty+ay[i]]!='1'){ break; } else if(i==2){ System.out.println("A") f=true; } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+bx[i]][ty+by[i]]!='1'){ break; } else if(i==2){ System.out.println("B") f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+cx[i]][ty+cy[i]]!='1'){ break; } else if(i==2){ System.out.println("C") f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+dx[i]][ty+dy[i]]!='1'){ break; } else if(i==2){ System.out.println("D") f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+ex[i]][ty+ey[i]]!='1'){ break; } else if(i==2){ System.out.println("E") f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+fx[i]][ty+fy[i]]!='1'){ break; } else if(i==2){ System.out.println("F") f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+gx[i]][ty+gy[i]]!='1'){ break; } else if(i==2){ System.out.println("G") f=true; } } } } } }
Main.java:22: error: ')' expected while((line=br.readLine()!=null){ ^ Main.java:55: error: ';' expected System.out.println("A") ^ Main.java:65: error: ';' expected System.out.println("B") ^ Main.java:76: error: ';' expected System.out.println("C") ^ Main.java:87: error: ';' expected System.out.println("D") ^ Main.java:98: error: ';' expected System.out.println("E") ^ Main.java:109: error: ';' expected System.out.println("F") ^ Main.java:120: error: ';' expected System.out.println("G") ^ Main.java:127: error: reached end of file while parsing } ^ 9 errors
s569670564
p00036
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; char[][] map=new char[8][8]; int[] ax={1,0,1}; int[] ay={0,1,1}; int[] bx={1,2,3}; int[] by={0,0,0}; int[] cx={0,0,0}; int[] cy={1,2,3}; int[] dx={1,1,2}; int[] dy={0,-1,-1}; int[] ex={0,1,1}; int[] ey={1,1,2}; int[] fx={1,1,2}; int[] fy={0,1,1}; int[] gx={0,1,1}; int[] gy={1,0,-1}; while((line=br.readLine())!=null){ if(line.isEmpty()){ line=br.readLine(); } boolean flag=false; boolean f=false; for(int j=0;j<8;i++){ map[0][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } for(int i=1;i<8;i++){ line=br.readLine(); for(int j=0;j<8;i++){ map[i][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } } } for(int i=0;i<3;i++){ if(map[tx+ax[i]][ty+ay[i]]!='1'){ break; } else if(i==2){ System.out.println("A"); f=true; } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+bx[i]][ty+by[i]]!='1'){ break; } else if(i==2){ System.out.println("B"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+cx[i]][ty+cy[i]]!='1'){ break; } else if(i==2){ System.out.println("C"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+dx[i]][ty+dy[i]]!='1'){ break; } else if(i==2){ System.out.println("D"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+ex[i]][ty+ey[i]]!='1'){ break; } else if(i==2){ System.out.println("E"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+fx[i]][ty+fy[i]]!='1'){ break; } else if(i==2){ System.out.println("F"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+gx[i]][ty+gy[i]]!='1'){ break; } else if(i==2){ System.out.println("G"); f=true; } } } } } }
Main.java:127: error: reached end of file while parsing } ^ 1 error
s049601544
p00036
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; char[][] map=new char[8][8]; int[] ax={1,0,1}; int[] ay={0,1,1}; int[] bx={1,2,3}; int[] by={0,0,0}; int[] cx={0,0,0}; int[] cy={1,2,3}; int[] dx={1,1,2}; int[] dy={0,-1,-1}; int[] ex={0,1,1}; int[] ey={1,1,2}; int[] fx={1,1,2}; int[] fy={0,1,1}; int[] gx={0,1,1}; int[] gy={1,0,-1}; while((line=br.readLine())!=null){ if(line.isEmpty()){ line=br.readLine(); } boolean flag=false; boolean f=false; for(int j=0;j<8;i++){ map[0][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } for(int i=1;i<8;i++){ line=br.readLine(); for(int j=0;j<8;i++){ map[i][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } } } for(int i=0;i<3;i++){ if(map[tx+ax[i]][ty+ay[i]]!='1'){ break; } else if(i==2){ System.out.println("A"); f=true; } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+bx[i]][ty+by[i]]!='1'){ break; } else if(i==2){ System.out.println("B"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+cx[i]][ty+cy[i]]!='1'){ break; } else if(i==2){ System.out.println("C"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+dx[i]][ty+dy[i]]!='1'){ break; } else if(i==2){ System.out.println("D"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+ex[i]][ty+ey[i]]!='1'){ break; } else if(i==2){ System.out.println("E"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+fx[i]][ty+fy[i]]!='1'){ break; } else if(i==2){ System.out.println("F"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+gx[i]][ty+gy[i]]!='1'){ break; } else if(i==2){ System.out.println("G"); f=true; } } } } } }
Main.java:127: error: reached end of file while parsing } ^ 1 error
s407214838
p00036
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; char[][] map=new char[8][8]; int[] ax={1,0,1}; int[] ay={0,1,1}; int[] bx={1,2,3}; int[] by={0,0,0}; int[] cx={0,0,0}; int[] cy={1,2,3}; int[] dx={1,1,2}; int[] dy={0,-1,-1}; int[] ex={0,1,1}; int[] ey={1,1,2}; int[] fx={1,1,2}; int[] fy={0,1,1}; int[] gx={0,1,1}; int[] gy={1,0,-1}; while((line=br.readLine())!=null){ if(line.isEmpty()){ line=br.readLine(); } boolean flag=false; boolean f=false; for(int j=0;j<8;i++){ map[0][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } for(int i=1;i<8;i++){ line=br.readLine(); for(int j=0;j<8;i++){ map[i][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } } } for(int i=0;i<3;i++){ if(map[tx+ax[i]][ty+ay[i]]!='1'){ break outer; } else if(i==2){ System.out.println("A"); f=true; } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+bx[i]][ty+by[i]]!='1'){ break outer; } else if(i==2){ System.out.println("B"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+cx[i]][ty+cy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("C"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+dx[i]][ty+dy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("D"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+ex[i]][ty+ey[i]]!='1'){ break outer; } else if(i==2){ System.out.println("E"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+fx[i]][ty+fy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("F"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+gx[i]][ty+gy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("G"); f=true; } } } } } }
Main.java:127: error: reached end of file while parsing } ^ 1 error
s494273500
p00036
Java
import java.io.*; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line; char[][] map=new char[8][8]; int[] ax={1,0,1}; int[] ay={0,1,1}; int[] bx={1,2,3}; int[] by={0,0,0}; int[] cx={0,0,0}; int[] cy={1,2,3}; int[] dx={1,1,2}; int[] dy={0,-1,-1}; int[] ex={0,1,1}; int[] ey={1,1,2}; int[] fx={1,1,2}; int[] fy={0,1,1}; int[] gx={0,1,1}; int[] gy={1,0,-1}; while((line=br.readLine())!=null){ if(line.isEmpty()){ line=br.readLine(); } boolean flag=false; boolean f=false; for(int j=0;j<8;i++){ map[0][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } for(int i=1;i<8;i++){ line=br.readLine(); for(int j=0;j<8;i++){ map[i][j]=line.charAt(j); if(!flag){ if(map[i][j]=='1'){ final int tx=i; final int ty=j; flag=true; } } } } for(int i=0;i<3;i++){ if(map[tx+ax[i]][ty+ay[i]]!='1'){ break outer; } else if(i==2){ System.out.println("A"); f=true; } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+bx[i]][ty+by[i]]!='1'){ break outer; } else if(i==2){ System.out.println("B"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+cx[i]][ty+cy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("C"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+dx[i]][ty+dy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("D"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+ex[i]][ty+ey[i]]!='1'){ break outer; } else if(i==2){ System.out.println("E"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+fx[i]][ty+fy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("F"); f=true; } } } if(!f){ for(int i=0;i<3;i++){ if(map[tx+gx[i]][ty+gy[i]]!='1'){ break outer; } else if(i==2){ System.out.println("G"); f=true; } } } } }
Main.java:126: error: reached end of file while parsing } ^ 1 error
s299560951
p00036
Java
import java.io.*; import java.util.*; import java.lang.Math.*; public class Main{ public static void main(String[] args)throws IOException{ try{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); String line; int[][] f=new int[8][8]; do{ for(int i=0;i<8;i++){ line=br.readLine(); if(line.equals("")) i--; else{ for(int j=0;j<8;j++){ f[i][j]=Character.getNumericValue(line.charAt(j)); } } } hantei(f); }while((line=br.readLine())!=null); }catch(java.lang.NumberFormatException e) { } catch(java.lang.StringIndexOutOfBoundsException e){ } }
Main.java:33: error: reached end of file while parsing } ^ 1 error
s486167894
p00036
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ while(scan.hasNext()){ int[][] mas = new int[8][8]; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ mas[i][j] = scan.nextInt(); } } String type = ""; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ if(mas[i][j] == 1){ if(i+1 < 8 && j+1 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j] == 1 && mas[i+1][j+1] == 1){ type = "A"; break; } } if(i+1 < 8 && i+2 < 8 && i+3 < 8){ if(mas[i+1][j] == 1 && mas[i+2][j] == 1 && mas[i+3][j] == 1){ type = "B"; break; } } if(j+1 < 8 && j+2 < 8 && j+3 < 8){ if(mas[i][j+1] == 1 && mas[i][j+2] == 1 && mas[i][j+3] == 1){ type = "C"; break; } } if(i+1 < 8 && j-1 >= 0 && i+2 < 8){ if(mas[i+1][j-1] == 1 && mas[i+1][j] == 1 && mas[i+2][j-1] == 1){ type = "D"; break; } } if(j+1 < 8 && i+1 < 8 && j+2 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j+1] == 1 && mas[i+1][j+2] == 1){ type = "E"; break; } } if(i+1 < 8 && j+1 < 8 && i+2 < 8){ if(mas[i+1][j] == 1 && mas[i+1][j+1] == 1 && mas[i+2][[j+1] == 1){ type = "F"; break; } } if(j+1 < 8 && j-1 >= 0){ if(mas[i][j+1] == 1 && mas[i+1][j-1] == 1 && mas[i+1][j] == 1){ type = "G"; break; } } } } } System.out.printf("%s\n", type); } } }
Main.java:56: error: illegal start of expression && mas[i+2][[j+1] == 1){ ^ 1 error
s179540924
p00036
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ while(scan.hasNext()){ int[][] mas = new int[8][8]; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ mas[i][j] = scan.nextInt(); } } String type = ""; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ if(mas[i][j] == 1){ if(i+1 < 8 && j+1 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j] == 1 && mas[i+1][j+1] == 1){ type = "A"; break; } } if(i+1 < 8 && i+2 < 8 && i+3 < 8){ if(mas[i+1][j] == 1 && mas[i+2][j] == 1 && mas[i+3][j] == 1){ type = "B"; break; } } if(j+1 < 8 && j+2 < 8 && j+3 < 8){ if(mas[i][j+1] == 1 && mas[i][j+2] == 1 && mas[i][j+3] == 1){ type = "C"; break; } } if(i+1 < 8 && j-1 >= 0 && i+2 < 8){ if(mas[i+1][j-1] == 1 && mas[i+1][j] == 1 && mas[i+2][j-1] == 1){ type = "D"; break; } } if(j+1 < 8 && i+1 < 8 && j+2 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j+1] == 1 && mas[i+1][j+2] == 1){ type = "E"; break; } } if(i+1 < 8 && j+1 < 8 && i+2 < 8){ if(mas[i+1][j] == 1 && mas[i+1][j+1] == 1 && mas[i+2][[j+1] == 1){ type = "F"; break; } } if(j+1 < 8 && j-1 >= 0){ if(mas[i][j+1] == 1 && mas[i+1][j-1] == 1 && mas[i+1][j] == 1){ type = "G"; break; } } } } } System.out.printf("%s\n", type); } } }
Main.java:50: error: illegal start of expression if(mas[i+1][j] == 1 && mas[i+1][j+1] == 1 && mas[i+2][[j+1] == 1){ ^ 1 error
s992595575
p00036
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ while(scan.hasNext()){ int[][] mas = new int[8][8]; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ mas[i][j] = scan.nextInt(); } } String type = ""; for(int i = 0; i < 8; i++){ for(int j = 0; j < 8; j++){ if(mas[i][j] == 1){ if(i+1 < 8 && j+1 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j] == 1 && mas[i+1][j+1] == 1){ type = "A"; break; } } if(i+1 < 8 && i+2 < 8 && i+3 < 8){ if(mas[i+1][j] == 1 && mas[i+2][j] == 1 && mas[i+3][j] == 1){ type = "B"; break; } } if(j+1 < 8 && j+2 < 8 && j+3 < 8){ if(mas[i][j+1] == 1 && mas[i][j+2] == 1 && mas[i][j+3] == 1){ type = "C"; break; } } if(i+1 < 8 && j-1 >= 0 && i+2 < 8){ if(mas[i+1][j-1] == 1 && mas[i+1][j] == 1 && mas[i+2][j-1] == 1){ type = "D"; break; } } if(j+1 < 8 && i+1 < 8 && j+2 < 8){ if(mas[i][j+1] == 1 && mas[i+1][j+1] == 1 && mas[i+1][j+2] == 1){ type = "E"; break; } } if(i+1 < 8 && j+1 < 8 && i+2 < 8){ if(mas[i+1][j] == 1 && mas[i+1][j+1] == 1 && mas[i+2][[j+1] == 1){ type = "F"; break; } } if(j+1 < 8 && j-1 >= 0){ if(mas[i][j+1] == 1 && mas[i+1][j-1] == 1 && mas[i+1][j] == 1){ type = "G"; break; } } } } } System.out.printf("%s\n", type); } } }
Main.java:50: error: illegal start of expression if(mas[i+1][j] == 1 && mas[i+1][j+1] == 1 && mas[i+2][[j+1] == 1){ ^ 1 error
s924891695
p00036
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); static String A = "1100000011"; static String B = "10000000100000001"; static String C = "1111"; static String D = "1000000110000001"; static String E = "11000000011"; static String F = "100000001100000001"; static String G = "110000011"; static String[] blocks = {A, B, C, D, E, F, G}; static String[] dic = {"A", "B", "C", "D", "E", "F", "G"}; public static void main(String[] args){ while(scan.hasNext()){ StringBuffer sb = new StringBuffer(); for(int i = 0; i < 8; i++){ sb.append(scan.next()); } System.out.printf("%s\n", dic[solve(sb.toString())]); } } public static int solve(String str){ Loop;for(int i = 0; i < 8 * 8; i++){ for(int j = 0; j < 7; j++){ if(8 * 8 < i + blocks[j].length()){ break Loop; } String s = str.substring(i, i + blocks[j].length()); if(s.equals(blocks[j])){ return j; } } } return -1; } }
Main.java:27: error: not a statement Loop;for(int i = 0; i < 8 * 8; i++){ ^ 1 error
s920010043
p00036
Java
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main_format(); } public Main() { sc = new Scanner(System.in); while (sc.hasNext() == true) { int[][] map = new int[8][8]; for (int i = 0; i < 8; i++) { String line = sc.nextLine(); for (int j = 0; j < 8; j++) { map[i][j] = line.charAt(j) - '0'; } } int state = 0; int max = 8; int k = 0; boolean end = false; for (int i = 0; i < max; i++) { for (int j = k; j < 8; j++) { if (map[i][j] == 1) { switch (state) { case 0: state = 1; max = i + 4; k = j - 1; break; case 1: state = 2; break; case 2: state = 3; break; case 3: System.out.println("C"); end = true; break; case 4: if (j == k) { System.out.println("D"); end = true; } else { state = 6; } break; case 5: if (j == k) { System.out.println("G"); end = true; } else if (j == (k + 1)) { System.out.println("A"); end = true; } else { System.out.println("E"); end = true; } case 6: System.out.println("F"); end = true; break; } } if (end == true) break; } if ((state == 1) || (state == 2)) { state = state + 3; } if (state == 6) { System.out.println("B"); end = true; } if (end == true) break; } } } }
Main.java:7: error: cannot find symbol new Main_format(); ^ symbol: class Main_format location: class Main 1 error
s599434713
p00036
Java
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main_format(); } public Main() { sc = new Scanner(System.in); while (sc.hasNext() == true) { int[][] map = new int[8][8]; for (int i = 0; i < 8; i++) { String line = sc.nextLine(); for (int j = 0; j < 8; j++) { map[i][j] = line.charAt(j) - '0'; } } int state = 0; int max = 8; int k = 0; boolean end = false; for (int i = 0; i < max; i++) { for (int j = k; j < 8; j++) { if (map[i][j] == 1) { switch (state) { case 0: state = 1; max = i + 4; k = j - 1; break; case 1: state = 2; break; case 2: state = 3; break; case 3: System.out.println("C"); end = true; break; case 4: if (j == k) { System.out.println("D"); end = true; } else { state = 6; } break; case 5: if (j == k) { System.out.println("G"); end = true; } else if (j == (k + 1)) { System.out.println("A"); end = true; } else { System.out.println("E"); end = true; } case 6: System.out.println("F"); end = true; break; } } if (end == true) break; } if ((state == 1) || (state == 2)) { state = state + 3; } if (state == 6) { System.out.println("B"); end = true; } if (end == true) break; } } } }
Main.java:7: error: cannot find symbol new Main_format(); ^ symbol: class Main_format location: class Main 1 error
s157484970
p00036
Java
import java.util.Scanner; public class Main { private Scanner sc; public static void main(String[] args) { new Main_format(); } public Main() { sc = new Scanner(System.in); while (sc.hasNext() == true) { int[][] map = new int[8][8]; for (int i = 0; i < 8; i++) { String line = sc.nextLine(); for (int j = 0; j < 8; j++) { map[i][j] = line.charAt(j) - '0'; } } int state = 0; int max = 8; int k = 0; boolean end = false; for (int i = 0; i < max; i++) { for (int j = k; j < 8; j++) { if (map[i][j] == 1) { switch (state) { case 0: state = 1; max = i + 4; k = j - 1; break; case 1: state = 2; break; case 2: state = 3; break; case 3: System.out.println("C"); end = true; break; case 4: if (j == k) { System.out.println("D"); end = true; } else { state = 6; } break; case 5: if (j == k) { System.out.println("G"); end = true; } else if (j == (k + 1)) { System.out.println("A"); end = true; } else { System.out.println("E"); end = true; } case 6: System.out.println("F"); end = true; break; } } if (end == true) break; } if ((state == 1) || (state == 2)) { state = state + 3; } if (state == 6) { System.out.println("B"); end = true; } if (end == true) break; } } } }
Main.java:7: error: cannot find symbol new Main_format(); ^ symbol: class Main_format location: class Main 1 error
s376549484
p00036
Java
import java.util.Scanner; public class Main { static Scanner sc = new java.util.Scanner(System.in); // static int[][] num =new int [8][8]; public static void main(String[] args) { int[][] num = new int[15][15]; String str = ""; while (sc.hasNextLine()) { // num[][]???????????? syokika(num); // ???????????¨????????????????´? for (int i = 0; i < 8; i++) { str = sc.next(); String[] st = str.split(""); for (int j = 0; j < 8; j++) { num[i][j] = Integer.parseInt(st[j]); } } // ???????????? for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { if(num[i][j]==1&&num[i][j+1]==1&&num[i+1][j]==1&&num[i+1][j+1]==1){ System.out.println("A"); }else if(num[i][j]==1&&num[i+1][j]==1&&num[i+2][j]==1&&num[i+3][j]==1){ System.out.println("B"); }else if(num[i][j]==1&&num[i][j+1]==1&&num[i][j+2]==1&&num[i][j+3]==1){ System.out.println("C"); }else if(num[i][j+1]==1&&num[i+1][j]==1&&num[i][j+1]==1&&num[i+2][j]==1){ System.out.println("D"); }else if(num[i][j]==1&&num[i][j+1]==1&&num[i+1][j+1]==1&&num[i+1][j+2]==1){ System.out.println("E"); }else if(num[i][j]==1&&num[i+1][j]==1&&num[i+1][j+1]==1&&num[i+2][j+1]==1){ System.out.println("F"); }else if(num[i][j+1]==1&&num[i][j+2]==1&&num[i+1][j]==1&&num[i+1][j+1]==1){ System.out.println("B"); } } } } } // ???????????¢??° public static int[][] syokika(int[][] num) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { num[i][j] = 0; } } return num; }
Main.java:60: error: reached end of file while parsing } ^ 1 error
s472349716
p00036
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! String[] inputPlane = new String[8]; //入力を受付、計算しやすいようにintに変換 List<int[][]> planeList = new ArrayList<int[][]>(); Scanner scan = new Scanner(System.in); int row = 0; while(scan.hasNext()){ String str = scan.next(); if(str.length() != 0){ if(row == 8){ row = 0; int[][] plane = new int[8][8]; for(int i = 0;i < inputPlane.length;i++){ for(int j = 0;j < inputPlane[i].length();j++){ plane[i][j] = Integer.parseInt(inputPlane[i].substring(j,j+1)); } } planeList.add(plane); } inputPlane[row++] = str; } } if(!scan.hasNext()){ int[][] plane = new int[8][8]; for(int i = 0;i < inputPlane.length;i++){ for(int j = 0;j < inputPlane[i].length();j++){ plane[i][j] = Integer.parseInt(inputPlane[i].substring(j,j+1)); } } planeList.add(plane); } //debug for(int i = 0;i < planeList.size();i++){ int[][] debug = planeList.get(i); for(int k = 0;k < debug.length;k++){ for(int j = 0;j < debug[k].length;j++){ System.out.print(debug[k][j]); } System.out.println(); } System.out.println(); } try{ for(int i = 0;i < planeList.size();i++){ int[][] plane = planeList.get(i); if(blockJudgeA(plane))continue; if(blockJudgeB(plane))continue; if(blockJudgeC(plane))continue; if(blockJudgeD(plane))continue; if(blockJudgeE(plane))continue; if(blockJudgeF(plane))continue; if(blockJudgeG(plane))continue; }}chatch(IndexOutOfBoundsException){} } //以下各判定 static boolean blockJudgeA(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i < 7 && j < 7 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j] == 1){ System.out.println("A"); return true; } } } return false; } static boolean blockJudgeB(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(j < 4 && plane[i][j] == 1 && plane[i+1][j] == 1 && plane[i+2][j] == 1){ System.out.println("B"); return true; } } } return false; } static boolean blockJudgeC(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(j < 5 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i][j+2] == 1){ System.out.println("C"); return true; } } } return false; } static boolean blockJudgeD(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i < 5 && j < 6 && j > 0 && plane[i][j] == 1 && plane[i+1][j] == 1 && plane[i+2][j-1] == 1){ System.out.println("D"); return true; } } } return false; } static boolean blockJudgeE(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i < 6 && j < 5 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j+2] == 1){ System.out.println("E"); return true; } } } return false; } static boolean blockJudgeF(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i < 5 && j < 6 && plane[i][j] == 1 && plane[i+1][j] == 1 && plane[i+1][j+2] == 1){ System.out.println("F"); return true; } } } return false; } static boolean blockJudgeG(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i < 6 && j < 5 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j-1] == 1){ System.out.println("G"); return true; } } } return false; } }
Main.java:50: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:60: error: ';' expected }}chatch(IndexOutOfBoundsException){} ^ 2 errors
s109338833
p00036
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args) throws Exception { // Your code here! String[] inputPlane = new String[8]; //入力を受付、計算しやすいようにintに変換 List<int[][]> planeList = new ArrayList<int[][]>(); Scanner scan = new Scanner(System.in); int row = 0; while(scan.hasNext()){ String str = scan.next(); if(str.length() != 0){ if(row == 8){ row = 0; int[][] plane = new int[8][8]; for(int i = 0;i < inputPlane.length;i++){ for(int j = 0;j < inputPlane[i].length();j++){ plane[i][j] = Integer.parseInt(inputPlane[i].substring(j,j+1)); } } planeList.add(plane); } inputPlane[row++] = str; } } if(planeList.size()==0){return;} //if(!scan.hasNext()){ int[][] planes = new int[8][8]; for(int i = 0;i < inputPlane.length;i++){ for(int j = 0;j < inputPlane[i].length();j++){ planes[i][j] = Integer.parseInt(inputPlane[i].substring(j,j+1)); } } planeList.add(planes); //} //debug /*for(int i = 0;i < planeList.size();i++){ int[][] debug = planeList.get(i); for(int k = 0;k < debug.length;k++){ for(int j = 0;j < debug[k].length;j++){ System.out.print(debug[k][j]); } System.out.println(); } System.out.println(); }*/ try{ for(int i = 0;i < planeList.size();i++){ //System.out.print(i); int[][] plane = planeList.get(i); if(blockJudgeD(plane))continue; if(blockJudgeG(plane))continue; if(blockJudgeE(plane))continue; if(blockJudgeF(plane))continue; if(blockJudgeA(plane))continue; if(blockJudgeB(plane))continue; if(blockJudgeC(plane))continue; } catch(IndexOutOfBoundsException e){} } //以下各判定 static boolean blockJudgeA(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 6 && j <= 6 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j] == 1){ System.out.println("A"); return true; } } } return false; } static boolean blockJudgeB(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 4 && plane[i][j] == 1 && plane[i+1][j] == 1 && plane[i+2][j] == 1){ System.out.println("B"); return true; } } } return false; } static boolean blockJudgeC(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(j <= 4 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i][j+2] == 1){ System.out.println("C"); return true; } } } return false; } static boolean blockJudgeD(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 5 && j <= 7 && j > 0 && plane[i][j] == 1 && plane[i+1][j-1] == 1 && plane[i+2][j-1] == 1){ System.out.println("D"); return true; } } } return false; } static boolean blockJudgeE(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 6 && j <= 5 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j+2] == 1){ System.out.println("E"); return true; } } } return false; } static boolean blockJudgeF(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 5 && j <= 6 && plane[i][j] == 1 && plane[i+1][j] == 1 && plane[i+2][j+1] == 1){ System.out.println("F"); return true; } } } return false; } static boolean blockJudgeG(int[][] plane){ for(int i = 0;i < plane.length;i++){ for(int j = 0;j < plane[i].length;j++){ if(i <= 6 && j <= 6 && plane[i][j] == 1 && plane[i][j+1] == 1 && plane[i+1][j-1] == 1){ System.out.println("G"); return true; } } } return false; } }
Main.java:64: error: 'catch' without 'try' catch(IndexOutOfBoundsException e){} ^ Main.java:52: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ Main.java:67: error: illegal start of expression static boolean blockJudgeA(int[][] plane){ ^ 3 errors
s888602639
p00036
Java
import java.util.*;   class Main{     public static void main(String args[]){         Scanner s=new Scanner(System.in);         while(s.hasNext()){             char [][] a=new char[20][20];             for(int i=0;i<20;i++)                 for(int j=0;j<20;j++)                     a[i][j]='0';             for(int i=0;i<8;i++){                 String now=s.next();                 for(int j=0;j<8;j++)                     a[i][j]=now.charAt(j);             }             char ans=' ';                           for(int i=0;i<8;i++){                 for(int j=0;j<8;j++){                     if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1')ans='A';                     if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+2][j]=='1'&&a[i+3][j]=='1')ans='B';                     if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i][j+3]=='1')ans='C';                     if(a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j]=='1'&&a[i+2][j]=='1')ans='D';                     if(a[i][j]=='1'&&a[i][j+1]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j+2]=='1')ans='E';                     if(a[i][j]=='1'&&a[i+1][j]=='1'&&a[i+1][j+1]=='1'&&a[i+2][j+1]=='1')ans='F';                     if(a[i][j+1]=='1'&&a[i][j+2]=='1'&&a[i+1][j+1]=='1'&&a[i+1][j]=='1')ans='G';                 }             }             System.out.println(""+ans);         }     } }
Main.java:2: error: illegal character: '\u00a0' ? ^ Main.java:3: error: class, interface, enum, or record expected class Main{ ^ Main.java:4: error: illegal character: '\u00a0' ????public static void main(String args[]){ ^ Main.java:4: error: illegal character: '\u00a0' ????public static void main(String args[]){ ^ Main.java:4: error: illegal character: '\u00a0' ????public static void main(String args[]){ ^ Main.java:4: error: illegal character: '\u00a0' ????public static void main(String args[]){ ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:5: error: illegal character: '\u00a0' ????????Scanner s=new Scanner(System.in); ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:6: error: illegal character: '\u00a0' ????????while(s.hasNext()){ ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:7: error: illegal character: '\u00a0' ????????????char [][] a=new char[20][20]; ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:8: error: illegal character: '\u00a0' ????????????for(int i=0;i<20;i++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:9: error: illegal character: '\u00a0' ????????????????for(int j=0;j<20;j++) ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:10: error: illegal character: '\u00a0' ????????????????????a[i][j]='0'; ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:11: error: illegal character: '\u00a0' ????????????for(int i=0;i<8;i++){ ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ Main.java:12: error: illegal character: '\u00a0' ????????????????String now=s.next(); ^ 100 errors only showing the first 100 errors, of 405 total; use -Xmaxerrs if you would like to see more