submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s446875114 | p00332 | C++ | #include <bits/stdc++.h>
using namespace std;
class data {
int p[5]={1868,1912,1926,1989,2017};
char c[4]={'M','T','S','H'};
};
int main() {
int E, Y;
cin >> E >> Y;
data d;
if (E==0) {
int idx;
for (int i=0; i<4; i++) {
if (d.p[i]<=Y && Y<d.p[i+1]) {
idx = i;
break;
}
}
printf("%c%d\n", d.c[idx], Y-d.p[idx]+1);
} else {
printf("%d\n", Y+d.p[E-1]-1);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:3: error: reference to 'data' is ambiguous
11 | data d;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:4:7: note: 'class data'
4 | class data {
| ^~~~
a.cc:15:11: error: 'd' was not declared in this scope
15 | if (d.p[i]<=Y && Y<d.p[i+1]) {
| ^
a.cc:20:22: error: 'd' was not declared in this scope
20 | printf("%c%d\n", d.c[idx], Y-d.p[idx]+1);
| ^
a.cc:22:22: error: 'd' was not declared in this scope
22 | printf("%d\n", Y+d.p[E-1]-1);
| ^
|
s929828330 | p00332 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,tosi;
cin>>a>>b;
if(a == 0){
if(b >= 1868&&b <= 1911){
tosi = b - 1869;
cout >> "M" >> tosi >> endl;
}else if(b >= 1912&&b <= 1925){
tosi = b - 1913;
cout >> "T" >> tosi >> endl;
}else if(b >= 1926&&b <= 1988){
tosi = b - 1926;
cout << "S" << tosi << endl;
}else if(b >= 1989&&b <= 2016){
tosi = b - 1990;
cout << "H" << tosi << endl;
}
}else if(a == 1){
tosi = b + 1868;
cout << tosi << endl;
}else if(a == 2){
tosi = b + 1912;
cout << tosi << endl;
}else if(a == 3){
tosi = b + 1926;
cout << tosi << endl;
}else if(a == 4){
tosi = b + 1989;
cout << tosi << endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:15: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [2]')
10 | cout >> "M" >> tosi >> endl;
| ~~~~ ^~ ~~~
| | |
| | const char [2]
| std::ostream {aka std::basic_ostream<char>}
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41,
from a.cc:1:
/usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)'
131 | operator>>(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte'
10 | cout >> "M" >> tosi >> endl;
| ^~~~
In file included from /usr/include/c++/14/string:55,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
835 | operator>>(basic_istream<_CharT, _Traits>& __in,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/bitset:1597:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, bitset<_Nb>&)'
1597 | operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
| ^~~~~~~~
/usr/include/c++/14/bitset:1597:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
In file included from /usr/include/c++/14/istream:1109,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)'
978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c)
| ^~~~~~~~
/usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)'
849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)'
854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c)
| ^~~~~~~~
/usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)'
896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)'
939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)'
945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[2]]':
a.cc:10:18: required from here
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
1099 | operator>>(_Istream&& __is, _Tp&& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: candidate: 'template<class _Tp, class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, complex<_Tp>&)'
509 | operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x)
| ^~~~~~~~
/usr/include/c++/14/complex:509:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:143:
/usr/include/c++/14/iomanip:76:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Resetiosflags)'
76 | operator>>(basic_istream<_CharT, _Traits>& __is, _Resetiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:76:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/iomanip:106:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setiosflags)'
106 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setiosflags __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:106:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/iomanip:137:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setbase)'
137 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setbase __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:137:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/iomanip:177:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setfill<_CharT>)'
177 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setfill<_CharT> __f)
| ^~~~~~~~
/usr/include/c++/14/iomanip:177:5: note: template argument deduction/substitution failed:
a.cc:10:18: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>'
10 | cout >> "M" >> tosi >> endl;
| ^~~
/usr/include/c++/14/iomanip:207:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _Setprecision)'
207 | operator>>(basic_istream<_CharT, _Traits>& __is, _Setpreci |
s172846371 | p00332 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int E,Y;
cin>>E>>Y;
if(E==0){
if(Y>=1989&&Y<=2016)cout<<"H"<<Y-1988<<endl;
if(Y>=1926&&Y<=1988)cout<<"S"<<Y-1925<<endl;
if(Y>=1912&&Y<=1925)cout<<"T"<<Y-1911<<endl;
if(Y>=1868&&Y<=1911)cout<<"M"<<Y-1867<<endl;
}
else{
if(E=1)cout<<Y+1867<<endl;}
else{
if(E=2)cout<<Y+1911<<endl;}
else{
if(E=3)cout<<Y+1925<<endl;}
else{
if(E=4)cout<<Y+1988<<endl;}
return 0;
}
| a.cc: In function 'int main()':
a.cc:22:1: error: 'else' without a previous 'if'
22 | else{
| ^~~~
a.cc:24:1: error: 'else' without a previous 'if'
24 | else{
| ^~~~
a.cc:26:1: error: 'else' without a previous 'if'
26 | else{
| ^~~~
|
s040464665 | p00333 | Java | import math
W,H,C = map(int,input().split(' '))
x = ma.gcd(thW,H)
print((W//x)*(H//x)*C) | Main.java:1: error: '.' expected
import math
^
Main.java:3: error: ';' expected
W,H,C = map(int,input().split(' '))
^
2 errors
|
s224631155 | p00333 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int W = s.nextInt();
int H = s.nextInt();
int C = s.nextInt();
int a = 0;
int b = 0;
int c = 0;
int x = 0;
if(W>H){
a = W;
b = H;
}else{
a = H;
b = W;
}
while(C>0){
if(a%b != 0){
c = a;
a = b;
b = c%b;
}else{
x = b;
break;
}
}
System.out.printl(W/x * H/x * C);
}
} | Main.java:36: error: cannot find symbol
System.out.printl(W/x * H/x * C);
^
symbol: method printl(int)
location: variable out of type PrintStream
1 error
|
s785479453 | p00333 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int W = s.nextInt();
int H = s.nextInt();
int C = s.nextInt();
int a = 0;
int b = 0;
int c = 0;
int x = 0;
if(W>H){
a = W;
b = H;
}else{
a = H;
b = W;
}
while(C>0){
if(a%b != 0){
c = a;
a = b;
b = c%b;
}else{
x = b;
break;
}
}
System.out.println(W/x * H/x * C);;
s.close();
}
}
} | Main.java:43: error: class, interface, enum, or record expected
}
^
1 error
|
s800683609 | p00333 | C | #include<stdio.h>
int func(int a,int b)
{
int r;
r = a % b;
while (r > 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
int main()
{
int w,h,c;
int s;
scanf("%d %d %d",&w,&h,&c);
s = func( w,h );
h /= s;
w /= s;
printf("%d\n",h*w*c);
return 0;
}
| main.c: In function 'func':
main.c:7:1: error: stray '\343' in program
7 | <U+3000><U+3000><U+3000><U+3000>while (r > 0) {
| ^~~~~~~~
main.c:7:3: error: stray '\343' in program
7 | <U+3000><U+3000><U+3000><U+3000>while (r > 0) {
| ^~~~~~~~
main.c:7:5: error: stray '\343' in program
7 | <U+3000><U+3000><U+3000><U+3000>while (r > 0) {
| ^~~~~~~~
main.c:7:7: error: stray '\343' in program
7 | <U+3000><U+3000><U+3000><U+3000>while (r > 0) {
| ^~~~~~~~
main.c:8:1: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:8:3: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:8:5: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:8:7: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:8:9: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:8:11: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:1: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:9:3: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:9:5: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:9:7: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:9:9: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:9:11: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:1: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:10:3: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:10:5: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:10:7: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:10:9: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:10:11: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:1: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:11:3: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:11:5: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:11:7: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:12:1: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>return b;
| ^~~~~~~~
main.c:12:3: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>return b;
| ^~~~~~~~
main.c:12:5: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>return b;
| ^~~~~~~~
main.c:12:7: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>return b;
| ^~~~~~~~
|
s016606390 | p00333 | C | #include<stdio.h>
int func(int a,int b)
{
int r;
r = a % b;
while (r > 0)
{
a = b;
b = r;
r = a % b;
}
return b;
}
int main()
{
int w,h,c;
int s;
scanf("%d %d %d",&w,&h,&c);
s = func( w,h );
h /= s;
w /= s;
printf("%d\n",h*w*c);
return 0;
}
| main.c: In function 'func':
main.c:7:1: error: stray '\343' in program
7 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:7:3: error: stray '\343' in program
7 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:8:1: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:8:3: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:8:5: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:8:7: error: stray '\343' in program
8 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:9:1: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:3: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:5: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:7: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:9: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:9:11: error: stray '\343' in program
9 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:10:1: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:3: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:5: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:7: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:9: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:10:11: error: stray '\343' in program
10 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:11:1: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:3: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:5: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:7: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:9: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:11:11: error: stray '\343' in program
11 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:12:1: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:12:3: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:12:5: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:12:7: error: stray '\343' in program
12 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:13:1: error: stray '\343' in program
13 | <U+3000><U+3000>return b;
| ^~~~~~~~
main.c:13:3: error: stray '\343' in program
13 | <U+3000><U+3000>return b;
| ^~~~~~~~
|
s716770652 | p00333 | C | #include<stdio.h>
int func(int,int);
int main()
{
int w,h,c;
int s;
scanf("%d %d %d",&w,&h,&c);
s = func( w,h );
h /= s;
w /= s;
printf("%d\n",h*w*c);
return 0;
}
int func(int a,int b)
{
int r;
r = a % b;
while (r > 0)
{
a = b;
b = r;
r = a % b;
}
return b;
}
| main.c: In function 'func':
main.c:24:1: error: stray '\343' in program
24 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:24:3: error: stray '\343' in program
24 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:25:1: error: stray '\343' in program
25 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:25:3: error: stray '\343' in program
25 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:25:5: error: stray '\343' in program
25 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:25:7: error: stray '\343' in program
25 | <U+3000><U+3000><U+3000><U+3000>{
| ^~~~~~~~
main.c:26:1: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:26:3: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:26:5: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:26:7: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:26:9: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:26:11: error: stray '\343' in program
26 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>a = b;
| ^~~~~~~~
main.c:27:1: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:27:3: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:27:5: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:27:7: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:27:9: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:27:11: error: stray '\343' in program
27 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>b = r;
| ^~~~~~~~
main.c:28:1: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:28:3: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:28:5: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:28:7: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:28:9: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:28:11: error: stray '\343' in program
28 | <U+3000><U+3000><U+3000><U+3000><U+3000><U+3000>r = a % b;
| ^~~~~~~~
main.c:29:1: error: stray '\343' in program
29 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:29:3: error: stray '\343' in program
29 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:29:5: error: stray '\343' in program
29 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:29:7: error: stray '\343' in program
29 | <U+3000><U+3000><U+3000><U+3000>}
| ^~~~~~~~
main.c:30:1: error: stray '\343' in program
30 | <U+3000><U+3000>return b;
| ^~~~~~~~
main.c:30:3: error: stray '\343' in program
30 | <U+3000><U+3000>return b;
| ^~~~~~~~
|
s090555406 | p00333 | C | #include<stdio.h>
int func(int,int);
int main()
{
int w,h,c;
int s;
scanf("%d %d %d",&w,&h,&c);
s = func( w,h );
h /= s;
w /= s;
printf("%d\n",h*w*c);
return 0;
}
int func(int a,int b)
{
int r;
r = a % b;
while (r > 0)
{
a = b;
b = r;
r = a % b;
}
return b;
}
| main.c: In function 'func':
main.c:24:1: error: stray '\343' in program
24 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:24:3: error: stray '\343' in program
24 | <U+3000><U+3000>while (r > 0)
| ^~~~~~~~
main.c:25:1: error: stray '\343' in program
25 | <U+3000><U+3000>{
| ^~~~~~~~
main.c:25:3: error: stray '\343' in program
25 | <U+3000><U+3000>{
| ^~~~~~~~
main.c:29:1: error: stray '\343' in program
29 | <U+3000><U+3000>}
| ^~~~~~~~
main.c:29:3: error: stray '\343' in program
29 | <U+3000><U+3000>}
| ^~~~~~~~
|
s152147460 | p00333 | C | #include<stdio.h>
int func(int,int);
int main()
{
int w,h,c;
int s;
scanf("%d %d %d",&w,&h,&c);
s = func( w,h );
h /= s;
w /= s;
printf("%d\n",h*w*c);
return 0;
}
int func(int a,int b)
{
int r;
r = a % b;
while(r>0)
{
a = b;
b = r;
r = a % b;
}
return b;
}
| main.c: In function 'func':
main.c:24:1: error: stray '\343' in program
24 | <U+3000><U+3000>while(r>0)
| ^~~~~~~~
main.c:24:3: error: stray '\343' in program
24 | <U+3000><U+3000>while(r>0)
| ^~~~~~~~
main.c:25:1: error: stray '\343' in program
25 | <U+3000><U+3000>{
| ^~~~~~~~
main.c:25:3: error: stray '\343' in program
25 | <U+3000><U+3000>{
| ^~~~~~~~
main.c:26:1: error: stray '\343' in program
26 | <U+3000><U+3000> a = b;
| ^~~~~~~~
main.c:26:3: error: stray '\343' in program
26 | <U+3000><U+3000> a = b;
| ^~~~~~~~
main.c:27:1: error: stray '\343' in program
27 | <U+3000><U+3000> b = r;
| ^~~~~~~~
main.c:27:3: error: stray '\343' in program
27 | <U+3000><U+3000> b = r;
| ^~~~~~~~
main.c:28:1: error: stray '\343' in program
28 | <U+3000><U+3000> r = a % b;
| ^~~~~~~~
main.c:28:3: error: stray '\343' in program
28 | <U+3000><U+3000> r = a % b;
| ^~~~~~~~
main.c:29:1: error: stray '\343' in program
29 | <U+3000><U+3000>}
| ^~~~~~~~
main.c:29:3: error: stray '\343' in program
29 | <U+3000><U+3000>}
| ^~~~~~~~
main.c:30:1: error: stray '\343' in program
30 | <U+3000><U+3000>return b;
| ^~~~~~~~
main.c:30:3: error: stray '\343' in program
30 | <U+3000><U+3000>return b;
| ^~~~~~~~
|
s452195456 | p00333 | C | #include<stdio.h>
int lcm(int,int);
int main(){
int w,h,c,a,b;
scanf("%d%d%d",&w,&h,&c);
if(w>h){
a=lcm(w,h);
}
else if(w=h){
a=w;
}
else[
a=lcm(h,w);
}
b=(w/a)*(h/a)*c;
printf("%d",b);
return 0;
}
int lcm(int x,int y){
int z;
while(x%y!=0){
z=x%y;
x=y;
y=z;
}
return y;
} | main.c: In function 'main':
main.c:12:6: error: expected expression before '[' token
12 | else[
| ^
main.c:13:14: error: expected ';' before '}' token
13 | a=lcm(h,w);
| ^
| ;
14 | }
| ~
main.c: At top level:
main.c:15:2: warning: data definition has no type or storage class
15 | b=(w/a)*(h/a)*c;
| ^
main.c:15:2: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
main.c:15:5: error: 'w' undeclared here (not in a function)
15 | b=(w/a)*(h/a)*c;
| ^
main.c:15:7: error: 'a' undeclared here (not in a function)
15 | b=(w/a)*(h/a)*c;
| ^
main.c:15:11: error: 'h' undeclared here (not in a function)
15 | b=(w/a)*(h/a)*c;
| ^
main.c:15:16: error: 'c' undeclared here (not in a function)
15 | b=(w/a)*(h/a)*c;
| ^
main.c:16:9: error: expected declaration specifiers or '...' before string constant
16 | printf("%d",b);
| ^~~~
main.c:16:14: error: expected declaration specifiers or '...' before 'b'
16 | printf("%d",b);
| ^
main.c:17:2: error: expected identifier or '(' before 'return'
17 | return 0;
| ^~~~~~
main.c:18:1: error: expected identifier or '(' before '}' token
18 | }
| ^
|
s156431283 | p00333 | C | #include<stdio.h>
int lcm(int,int);
int main(){
int w,h,c,a,e,f;
scanf("%d%d%d",&w,&h,&c);
if(w>h){
a=lcm(w,h);
}
else if(w=h){
a=w;
}
else{
a=lcm(h,w);
}
e=w/a;
f=h/a;
b=c*e*f;
printf("%d",b);
return 0;
}
int lcm(int x,int y){
int z;
while(x%y!=0){
z=x%y;
x=y;
y=z;
}
return y;
} | main.c: In function 'main':
main.c:17:2: error: 'b' undeclared (first use in this function)
17 | b=c*e*f;
| ^
main.c:17:2: note: each undeclared identifier is reported only once for each function it appears in
|
s657953819 | p00333 | C | #include<stdio.h>
int gcd(int,int);
int main(){
int w,h,a,b,c,d;
scanf("%d%d%d",&w,&h,&c);
if(w>h){
a=gcd(w,h);
else if(w==h){
a=w;
}
else{
a=gcm(h,w);
}
b=w*h*c;
d=b/a;
printf("%d",d/a);
return(0);
}
int gcd(int p,int q){
int r;
r=p%q;
while(r!=0){
p=q;
q=r;
r=p%q;
}
return q;
}
| main.c: In function 'main':
main.c:8:2: error: expected '}' before 'else'
8 | else if(w==h){
| ^~~~
main.c:12:5: error: implicit declaration of function 'gcm'; did you mean 'gcd'? [-Wimplicit-function-declaration]
12 | a=gcm(h,w);
| ^~~
| gcd
|
s320906063 | p00333 | C | #include<stdio.h>
int gcd(int,int);
int main(void)
{
int a,b,c,d,h,w;
scanf("%d%d%d",&w,%h,&c);
if(w>h){
a=gcm(w,h);
}
else if(w==h){
a=w;
}
else{
a=gcm(h,w);
}
b=w/a;
d=h/a;
printf("%d",b*c*d);
return(0);
}
int gcd(int p,int q)
{
int r;
r=p%q;
while(r!=0){
p=q;
q=r;
r=p%q;
}
return q;
} | main.c: In function 'main':
main.c:6:20: error: expected expression before '%' token
6 | scanf("%d%d%d",&w,%h,&c);
| ^
main.c:8:5: error: implicit declaration of function 'gcm'; did you mean 'gcd'? [-Wimplicit-function-declaration]
8 | a=gcm(w,h);
| ^~~
| gcd
|
s150293562 | p00333 | C | #include<stdio.h>
int gcd(int,int);
int main(void)
{
int a,b,c,d,h,w;
scanf("%d%d%d",&w,&h,&c);
if(w>h){
a=gcm(w,h);
}
else if(w==h){
a=w;
}
else{
a=gcm(h,w);
}
b=w/a;
d=h/a;
printf("%d",b*c*d);
return(0);
}
int gcd(int p,int q)
{
int r;
r=p%q;
while(r!=0){
p=q;
q=r;
r=p%q;
}
return q;
} | main.c: In function 'main':
main.c:8:5: error: implicit declaration of function 'gcm'; did you mean 'gcd'? [-Wimplicit-function-declaration]
8 | a=gcm(w,h);
| ^~~
| gcd
|
s208207799 | p00333 | C | #include<stdio.h>
int gcd(int p,int q)
{
int r;
r=p%q;
while(r!=0){
p=q;
q=r;
r=p%q;
}
return q;
}
int main(void)
{
int a,b,c,d,h,w;
scanf("%d%d%d",&w,&h,&c);
if(w>h){
a=gcm(w,h);
}
else if(w==h){
a=w;
}
else{
a=gcm(h,w);
}
b=w/a;
d=h/a;
printf("%d",b*c*d);
return(0);
} | main.c: In function 'main':
main.c:20:5: error: implicit declaration of function 'gcm'; did you mean 'gcd'? [-Wimplicit-function-declaration]
20 | a=gcm(w,h);
| ^~~
| gcd
|
s533057685 | p00333 | C++ | #include<iostream>
using namespace std;
int gcd(){
if(n==0)
return m;
return gcd(n, m%n);
}
int main(){
int W,H,C;
cin >> W > H >> C;
int g = gcd(W, H);
cout << W/g*H/g*C << endl;
return 0;
}
| a.cc: In function 'int gcd()':
a.cc:5:6: error: 'n' was not declared in this scope
5 | if(n==0)
| ^
a.cc:6:12: error: 'm' was not declared in this scope; did you mean 'tm'?
6 | return m;
| ^
| tm
a.cc:7:14: error: 'n' was not declared in this scope
7 | return gcd(n, m%n);
| ^
a.cc:7:17: error: 'm' was not declared in this scope; did you mean 'tm'?
7 | return gcd(n, m%n);
| ^
| tm
a.cc: In function 'int main()':
a.cc:12:12: error: no match for 'operator>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'int')
12 | cin >> W > H >> C;
| ~~~~~~~~ ^ ~~~~~~
| | |
| | int
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
a.cc:12:12: note: candidate: 'operator>(int, int)' (built-in)
12 | cin >> W > H >> C;
| ~~~~~~~~~^~~~~~~~
a.cc:12:12: 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/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
12 | cin >> W > H >> C;
| ^
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:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
12 | cin >> W > H >> C;
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
12 | cin >> W > H >> C;
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
12 | cin >> W > H >> C;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:12:19: note: 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
12 | cin >> W > H >> C;
| ^
a.cc:14:14: error: too many arguments to function 'int gcd()'
14 | int g = gcd(W, H);
| ~~~^~~~~~
a.cc:4:5: note: declared here
4 | int gcd(){
| ^~~
|
s157217641 | p00333 | C++ | #include<iostream>
using namespace std;
int gcd(){
if(n==0)
return m;
return gcd(n, m%n);
}
int main(){
int W,H,C;
cin >> W >> H >> C;
int g = gcd(W, H);
cout << W/g*H/g*C << endl;
return 0;
}
| a.cc: In function 'int gcd()':
a.cc:5:6: error: 'n' was not declared in this scope
5 | if(n==0)
| ^
a.cc:6:12: error: 'm' was not declared in this scope; did you mean 'tm'?
6 | return m;
| ^
| tm
a.cc:7:14: error: 'n' was not declared in this scope
7 | return gcd(n, m%n);
| ^
a.cc:7:17: error: 'm' was not declared in this scope; did you mean 'tm'?
7 | return gcd(n, m%n);
| ^
| tm
a.cc: In function 'int main()':
a.cc:14:14: error: too many arguments to function 'int gcd()'
14 | int g = gcd(W, H);
| ~~~^~~~~~
a.cc:4:5: note: declared here
4 | int gcd(){
| ^~~
|
s775712956 | p00333 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int maxi(int x,int y){
if(y==0 || x==y) return x;
else if(x==1 || y==1) return 1;
else if(x>y) return maxi(y,x%y);
else return maxi(x,y%x);
}
int pow(int x) return x*x;
int main(){
int w,h,c;
cin >> w >> h >> c;
cout << (w*h/pow(maxi(w,h)))*c << endl
return 0;
}
| a.cc: In function 'int pow(int)':
a.cc:14:16: error: named return values are no longer supported
14 | int pow(int x) return x*x;
| ^~~~~~
a.cc:20:41: error: expected ';' before 'return'
20 | cout << (w*h/pow(maxi(w,h)))*c << endl
| ^
| ;
21 |
22 | return 0;
| ~~~~~~
a.cc:23:1: warning: no return statement in function returning non-void [-Wreturn-type]
23 | }
| ^
|
s895826525 | p00333 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int maxi(int x,int y){
if(y==0 || x==y) return x;
else if(x==1 || y==1) return 1;
else if(x>y) return maxi(y,x%y);
else return maxi(x,y%x);
}
int powx(int x) return x*x;
int main(){
int w,h,c;
cin >> w >> h >> c;
cout << (w*h/powx(maxi(w,h)))*c << endl;
return 0;
}
| a.cc: In function 'int powx(int)':
a.cc:14:17: error: named return values are no longer supported
14 | int powx(int x) return x*x;
| ^~~~~~
|
s143165768 | p00333 | C++ | #include<bits/std++.h>
using namespace std;
int main(){
int w,h,c;
int sum = 0;
cin >> w >> h >> c;
while(w==0 || h==0){
if(w>h){
w = w-h;
sum = sum+c;
}
if(h>w){
h = h-w;
sum = sum+c;
}
if(h==w){
h=h-w;
sum = sum+c;
}
}
cout << sum <<endl;
}
| a.cc:1:9: fatal error: bits/std++.h: No such file or directory
1 | #include<bits/std++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s184921332 | p00333 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int W,H,C,X;
cin>>W>>H>>C;
if((W*H)%(X*X)==0){
cout<<C*X*X<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:4: error: expected '}' at end of input
13 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s271293922 | p00333 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int w,h,c,i,num;
int sum = 0;
cin >> w >> h >> c;
if(h == w) cout << c << endl;
while(1){
if(w>h){
if(w%h == 0){
num = h;
break;
}
w = w%h;
}
if(h>w){
if(h%w == 0){
num =w;
break;
}
h = h%w;
}
cout << ((h*w)/(num*num))*c << endl;
}
| a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s857148058 | p00333 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,d,e;
cin>>a>>b>>c;
d=__gcd(a,b);
cout<<(a/d)*(b/d)*c<<endl;
} | a.cc: In function 'int main()':
a.cc:6:5: error: '__gcd' was not declared in this scope
6 | d=__gcd(a,b);
| ^~~~~
|
s415775798 | p00333 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int W,H,C;
cin>>W>>H>>C;
int squares=gcd(W,H);
cout<<square*C<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'gcd' was not declared in this scope
9 | int squares=gcd(W,H);
| ^~~
a.cc:10:9: error: 'square' was not declared in this scope; did you mean 'squares'?
10 | cout<<square*C<<endl;
| ^~~~~~
| squares
|
s932816093 | p00333 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int W,H,C;
cin>>W>>H>>C;
int squares=gcd(W,H);
cout<<square*C<<endl;
#include <iostream>
#include <algorithm>
using namespace std;
int gcd( int m, int n )
{
// ?????°?????????????????´??????????????????
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
// ???????????????????????????
while( m != n )
{
if ( m > n ) m = m - n;
else n = n - m;
}
return m;
}//gcd
int main(){
int W,H,C;
cin>>W>>H>>C;
int squares=gcd(W,H);
cout<<W/squares*H/squares*C<<endl;
return 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'gcd' was not declared in this scope
9 | int squares=gcd(W,H);
| ^~~
a.cc:10:9: error: 'square' was not declared in this scope; did you mean 'squares'?
10 | cout<<square*C<<endl;
| ^~~~~~
| squares
a.cc:16:1: error: a function-definition is not allowed here before '{' token
16 | {
| ^
a.cc:29:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
29 | int main(){
| ^~
a.cc:29:9: note: remove parentheses to default-initialize a variable
29 | int main(){
| ^~
| --
a.cc:29:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:29:11: error: a function-definition is not allowed here before '{' token
29 | int main(){
| ^
|
s162699201 | p00333 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int W,H,C;
cin>>W>>H>>C;
int squares=gcd(W,H);
cout<<square*C<<endl;
#include <iostream>
#include <algorithm>
using namespace std;
int gcd( int m, int n )
{
// ?????°?????????????????´??????????????????
if ( ( 0 == m ) || ( 0 == n ) )
return 0;
// ???????????????????????????
while( m != n )
{
if ( m > n ) m = m - n;
else n = n - m;
}
return m;
}//gcd
int main(){
int W,H,C;
cin>>W>>H>>C;
int squares=gcd(W,H);
cout<<W/squares*H/squares*C<<endl;
return 0;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'gcd' was not declared in this scope
9 | int squares=gcd(W,H);
| ^~~
a.cc:10:9: error: 'square' was not declared in this scope; did you mean 'squares'?
10 | cout<<square*C<<endl;
| ^~~~~~
| squares
a.cc:16:1: error: a function-definition is not allowed here before '{' token
16 | {
| ^
a.cc:29:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
29 | int main(){
| ^~
a.cc:29:9: note: remove parentheses to default-initialize a variable
29 | int main(){
| ^~
| --
a.cc:29:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:29:11: error: a function-definition is not allowed here before '{' token
29 | int main(){
| ^
|
s913034480 | p00333 | C++ | #include<iostream>
using namespace std;
int gcd(int m,int n)
{
if(n==0){
return m;
}
return gcd(n,m%n)
}
int main()
{
int W,H,C;
cin>>W>>H>>C;
int g=gcd(W,H);
cout<<W/g*H/g*C<<endl;
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:9:20: error: expected ';' before '}' token
9 | return gcd(n,m%n)
| ^
| ;
10 | }
| ~
|
s405112867 | p00333 | C++ | #include<iostream>
using namespace std;
int gcd(int m,int n)
{
if(n==0){
return m;
}
return gcd(n,m%n)
}
int main()
{
int W,H,C;
cin>>W>>H>>C;
int g=gcd(W,H);
cout<<W/g*H/g*C<<endl;
return 0;
} | a.cc: In function 'int gcd(int, int)':
a.cc:9:20: error: expected ';' before '}' token
9 | return gcd(n,m%n)
| ^
| ;
10 | }
| ~
|
s521258542 | p00333 | C++ | #include<iostream>
using namespace std;
int main(void){
int w,h,c;
cin>>w;
cin>>h;
int a=w;
int b=h;
while(a%b!=0){
int d=a%b
a=b;
b=d;
}
int e=w/b;
int f=h/b;
int g=e*f*c;
cout<<c<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:4: error: expected ',' or ';' before 'a'
11 | a=b;
| ^
|
s985773738 | p00333 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s472190959 | p00333 | C++ | #include <bits/stdc++.h>
using namespace std;
//#define int long long
#define FOR(i, j, k) for(int i = j; i < (int)k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define INF (1 << 30)
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> Pi;
const int MOD = 1e9 + 7;
const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
signed main() {
cin.tie(0);
ios::sync_with_stdio(false);
int w, h, c;
cin >> w >> h >> c;
int tmp = gcd(w, h);
cout << ((w * h) / (tmp * tmp)) * c2 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:30:39: error: 'c2' was not declared in this scope; did you mean 'c'?
30 | cout << ((w * h) / (tmp * tmp)) * c2 << endl;
| ^~
| c
|
s629640934 | p00333 | C++ | #include <iostream>
using namespace std;
int main ()
{
int a[2],z,p = 0,pp = 0,q = 0;
cin >> a[0] >> a[1] >> z;
sort (a,a + 2);
for (int i = a[1]; i > 0; i--)
{
for (int j = 1; j < 100; j++)
{
for (int k = 1; k < 100; k++)
{
if (i * j == a[0] && i * k == a[1])
{
p = j;
pp = k;
q += 1;
break;
}
}
if (q != 0)
{
break;
}
}
if (q != 0)
{
break;
}
}
cout << (p * pp) * z << endl;
}
| a.cc: In function 'int main()':
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
10 | sort (a,a + 2);
| ^~~~
| short
|
s506126377 | p00333 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W,H,C,cost;
cin>>W>>H>>C;
if(W==H)cost=C;
if(W>H){
for(int i=W;i>0;i--){
if(W%i==0){
if(H%i==0){
cost=((W/i)*(H/i))*C;
break;
}}}
cout<<C<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s395227515 | p00333 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W,H,C,cost;
cin>>W>>H>>C;
if(W==H)cost=C;
if(W>H){
for(int i=W;i>0;i--){
if(W%i==0){
if(H%i==0){
cost=((W/i)*(H/i))*C;
break;}
}
cout<<C<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:13:8: note: to match this '{'
13 | if(W>H){
| ^
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s741739877 | p00333 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int W,H,C,cost;
cin>>W>>H>>C;
if(W==H)cost=C;
if(W>H){
for(int i=W;i>0;i--){
if(W%i==0){
if(H%i==0){
cost=((W/i)*(H/i))*C;
break;}
}
cout<<C<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:13:8: note: to match this '{'
13 | if(W>H){
| ^
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s588280716 | p00333 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int W,H,C,A,B;
cin >> W >> H >> C;
A = 1;
if(W = H){W = A}
if(W > H){
for(int i =2; i<=H;i++)if(W % i == 0) A = i;}
if(H > W){
for(int i=2;i<=W;i++)if(H % i == 0) A = i;}
B = (W / A) * (H / A) * C;
cout << B << endl;
}
| a.cc: In function 'int main()':
a.cc:11:16: error: expected ';' before '}' token
11 | if(W = H){W = A}
| ^
| ;
|
s047100213 | p00333 | C++ | import fractions
A, B, C = [int(k) for k in raw_input().split(' ')]
print(C * ((A * B)/ (fractions.gcd(A, B) ** 2 )))
| a.cc:1:1: error: 'import' does not name a type
1 | import fractions
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s794141525 | p00333 | C++ | #include<iostream>
using namespace std;
int gcd(int a,int b){
while(a && b){
if(a<b)b %= a;
else a %= b
}
return max(a,b);
}
int main(){
int w,h,c;
cin>>w>>h>>c;
cout<<w*h/gcd(w,h)/gcd(w,h)*c<<endl;
return 0;
}
| a.cc: In function 'int gcd(int, int)':
a.cc:7:20: error: expected ';' before '}' token
7 | else a %= b
| ^
| ;
8 | }
| ~
|
s781123355 | p00333 | C++ | #include <iostream>
using namespace std;
int gcd(int m,int n){
if(n==0)return m;
return gcd(n,m%n);
}
int main(){
int W,H,C;
cin >> W >> H >> C;
int g = gcd(W,H);
cout << W*G*C/(g*g) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:19: error: 'G' was not declared in this scope
16 | cout << W*G*C/(g*g) << endl;
| ^
|
s288266194 | p00333 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int H,H,C;cin>>W>>H>>C;
int sum,cube;
int ans;
sum = W*H;
for(int i = 0; i < 10000;i++){
if(sum % i ==0){
cube = i;
break;
}
}
ans = cube * C;
std::cout << ans << std::endl;
}
| a.cc: In function 'int main()':
a.cc:5:8: error: redeclaration of 'int H'
5 | int H,H,C;cin>>W>>H>>C;
| ^
a.cc:5:6: note: 'int H' previously declared here
5 | int H,H,C;cin>>W>>H>>C;
| ^
a.cc:5:17: error: 'W' was not declared in this scope
5 | int H,H,C;cin>>W>>H>>C;
| ^
|
s434972619 | p00334 | C | #include<stdio.h>
int main(void){
while(1){
int n,p[1000][1000][1000]={0},i,o=0,j[3],r,f;
scanf("%d",&n);
if(n==0){
break;
}
for(i=0;i<n;i++){
scanf("%d%d%d",&j[0],&j[1],&j[2]);
for(r=0;r<3;r++){
for(e=r+1;e<3;e++){
if(j[r]>j[e])
f=j[r];
j[r]=j[e];
j[e]=f;
}
}
if(p[j[0]][j[1]][j[2]]==1){
o++;
}
p[j[0]][j[1]][j[2]]=1;
}
printf("%d\n",o);
}
return 0;
} | main.c: In function 'main':
main.c:12:37: error: 'e' undeclared (first use in this function)
12 | for(e=r+1;e<3;e++){
| ^
main.c:12:37: note: each undeclared identifier is reported only once for each function it appears in
|
s737038334 | p00334 | C | #include<stdio.h>
int main(void)
{
int n,a,i,b;
b=0;
scanf("%d",&n);
int p[4][n]
for(i=0;i<n;i++){
scanf("%d %d %d",&p[0][i],&p[1][i],&p[2][i]);
if(p[0][i]<p[1][i]){
a=p[0][i];
p[0][i]=p[1][i];
p[1][i]=a;
}
if(p[0][i]<p[2][i]){
a=p[0][i];
p[0][i]=p[2][i];
p[2][i]=a;
}
if(p[1][i]<p[2][i]){
a=p[1][i];
p[1][i]=p[2][i];
p[2][i]=a;
???}
}
for(a=0;a<n;a++){
for(i=a+1;i<n;i++){
if(p[0][a]==p[0][i]){
if(p[1][a]==p[1][i]){
if(p[2][a]==p[2][i]){
p[0][i]='\0';
p[1][i]='\0';
p[2][i]='\0';
}
}
}
}
}
for(a=0;a<n;a++){
if(p[0][a]=='\0'){
b++;
}
}
printf("%d",b);
return(0);
} | main.c: In function 'main':
main.c:8:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'for'
8 | for(i=0;i<n;i++){
| ^~~
main.c:9:21: error: 'p' undeclared (first use in this function)
9 | scanf("%d %d %d",&p[0][i],&p[1][i],&p[2][i]);
| ^
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:1: error: expected expression before '?' token
24 | ???}
| ^
|
s189306444 | p00334 | C | #include <stdio.h>
void swap(int *x, int *y){
int temp = *x;
*x = *y;
*y = temp;
}
int main(void)
{
int n, i, j, h = 0;
int a[128];
scanf("%d", &n);
n *= 3;
for(i = 0; i < n; i += 3)
scanf("%d %d %d", &a[i], &a[i + 1], &a[i + 2]);
for(i = 0; i < n; i += 3) {
if(a[i] > a[i + 1]) swap(&a[i], &a[i + 1]);
if(a[i] > a[i + 2]) swap(&a[i], &a[i + 2]);
if(a[i + 1] > a[i + 2]) swap(&a[i + 1], &a[i + 2]);
}
for(i = 0; i < n; i += 3) {
for(j = 0; i < n; i += 3) {
if(a[i] == a[j] && a[i + 1] == a[j + 1] && a[i + 2] == a[j + 2]) {
h++;
a[j] = 0:
a[j + 1] = 0:
a[j + 2] = 0:
}
}
}
for(i = 0; i < n; i += 3)
printf("%d %d %d\n", a[i], a[i + 1], a[i + 2]);
printf("%d\n", h);
return 0;
}
| main.c: In function 'main':
main.c:33:25: error: expected ';' before ':' token
33 | a[j] = 0:
| ^
| ;
|
s371162968 | p00334 | C | #include<stdio.h>
#define emt 1000 + 1
bool check[ emt ][ emt ][ emt ] ;
int ans ;
int min( int a ,int b )
{
return a > b ? b : a ;
}
int max( int a ,int b )
{
return a > b ? a : b ;
}
int main()
{
int n ;
scanf( "%d" ,&n ) ;
int a ,b ,c ;
int i ;
for( i = 0 ; i < n ; ++i )
{
scanf( "%d %d %d" ,&a ,&b ,&c ) ;
int aa = min( a ,min( b ,c ) ) ;
int bb = min( max( a ,b ) ,min( max( b ,c ) ,max( a ,c ) ) ) ;
int cc = max( a ,max( b ,c ) ) ;
if( check[ aa ][ bb ][ cc ] == true )
{
ans += check[ aa ][ bb ][ cc ] ;
}
else
{
check[ aa ][ bb ][ cc ] = true ;
}
}
printf( "%d\n" ,ans ) ;
return 0 ;
} | main.c:8:1: error: unknown type name 'bool'
8 | bool check[ emt ][ emt ][ emt ] ;
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'main':
main.c:50:48: error: 'true' undeclared (first use in this function)
50 | if( check[ aa ][ bb ][ cc ] == true )
| ^~~~
main.c:50:48: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:50:48: note: each undeclared identifier is reported only once for each function it appears in
|
s496533909 | p00334 | C | #include<stdio.h>
#define emt 1000 + 1
bool check[ emt ][ emt ][ emt ] ;
int ans ;
int min( int a ,int b )
{
return a > b ? b : a ;
}
int max( int a ,int b )
{
return a > b ? a : b ;
}
int main()
{
int n ;
scanf( "%d" ,&n ) ;
int a ,b ,c ;
int aa ,bb ,cc ;
int i ;
for( i = 0 ; i < n ; ++i )
{
scanf( "%d %d %d" ,&a ,&b ,&c ) ;
aa = min( a ,min( b ,c ) ) - 1 ;
bb = min( max( a ,b ) ,min( max( b ,c ) ,max( a ,c ) ) ) - 1 ;
cc = max( a ,max( b ,c ) ) - 1 ;
if( check[ aa ][ bb ][ cc ] == true )
{
ans += check[ aa ][ bb ][ cc ] ;
}
else
{
check[ aa ][ bb ][ cc ] = true ;
}
}
printf( "%d\n" ,ans ) ;
return 0 ;
} | main.c:7:1: error: unknown type name 'bool'
7 | bool check[ emt ][ emt ][ emt ] ;
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c: In function 'main':
main.c:51:48: error: 'true' undeclared (first use in this function)
51 | if( check[ aa ][ bb ][ cc ] == true )
| ^~~~
main.c:51:48: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:51:48: note: each undeclared identifier is reported only once for each function it appears in
|
s765014150 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main(){
map<int, bool> memo;
int N;
cin>>N;
for(int i=0;i<N;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
}
cout<<cnt<<endll
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
16 | cnt++;
| ^~~
| int
a.cc:21:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
21 | cout<<cnt<<endll
| ^~~
| int
a.cc:21:14: error: 'endll' was not declared in this scope
21 | cout<<cnt<<endll
| ^~~~~
|
s790366637 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main(){
map<int, bool> memo;
int N;
cin>>N;
for(int i=0;i<N;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
}
cout<<cnt<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
16 | cnt++;
| ^~~
| int
a.cc:21:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
21 | cout<<cnt<<endl;
| ^~~
| int
|
s824886398 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main(){
map<int,bool> memo;
int N;
cin >> N;
int cnt=0;
for(int i=0;i<N;i++){
int p[3];
cin >> p[0] >> p[1] >> p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)){
cnt++;
}else{
memo[k] = true;
}
}
cout << cnt << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:22:17: error: could not convert 'memo.std::map<int, bool>::find(k)' from 'std::map<int, bool>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, bool>, std::_Select1st<std::pair<const int, bool> >, std::less<int>, std::allocator<std::pair<const int, bool> > >::iterator'} to 'bool'
22 | if(memo.find(k)){
| ~~~~~~~~~^~~
| |
| std::map<int, bool>::iterator {aka std::_Rb_tree<int, std::pair<const int, bool>, std::_Select1st<std::pair<const int, bool> >, std::less<int>, std::allocator<std::pair<const int, bool> > >::iterator}
|
s164495873 | p00334 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int F_get(){
int temp; cin >> temp;
return temp;
}
int main() {
int n; cin >> n; vector<vector<int>> v(n);
for (int i = 0; i < 3 * n; i++) v[(int)(i / 3)].insert(F_get());
for (int i = 0; i < n; i++) sort(v[i].begin(), v[i].end());
v.erase(unique(v.begin(), v.end()), v.end());
cout << n - v.size() << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:13:63: error: no matching function for call to 'std::vector<int>::insert(int)'
13 | for (int i = 0; i < 3 * n; i++) v[(int)(i / 3)].insert(F_get());
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1484:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Alloc = std::allocator<int>]'
1484 | insert(const_iterator __position, _InputIterator __first,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1484:9: note: candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/vector:72:
/usr/include/c++/14/bits/vector.tcc:133:5: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator; value_type = int]'
133 | vector<_Tp, _Alloc>::
| ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:133:5: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1395:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator; value_type = int]'
1395 | insert(const_iterator __position, value_type&& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1395:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1413:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator]'
1413 | insert(const_iterator __position, initializer_list<value_type> __l)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1413:7: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_vector.h:1439:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, size_type, const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; iterator = std::vector<int>::iterator; const_iterator = std::vector<int>::const_iterator; size_type = long unsigned int; value_type = int]'
1439 | insert(const_iterator __position, size_type __n, const value_type& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:1439:7: note: candidate expects 3 arguments, 1 provided
|
s497385140 | p00334 | C++ | #include<iostream>
using namespace std;
main(){
int n,i,i2,ans=0;
cin >> n;
int p[n*3],s[n],b[n],m[n];
for (i=1;1<=n;i++) cin >> p[i*3-2] >> p[i*3-1] >> p[i*3];
for (i=1;1<=n;i++) {
if (p[i*3]<=p[i*3-2] && p[i*3]==p[i2*3-1]) {
s[n]=p[i*3];
if (p[i*3-2]<=p[i*3-1])
m[n]=p[i*3-2]
b[n]=p[i*3-1]
}
if (p[i*3-1]<=p[i*3-2]) {
m[n]=p[i*3-1]
b[n]=p[i*3-2]
}
}
else if (p[i*3-1]<=p[i*3-2] && p[i*3-1]==p[i2*3]) {
s[n]=p[i*3-1];
if (p[i*3-2]<=p[i*3])
m[n]=p[i*3-2]
b[n]=p[i*3]
}
if (p[i*3]<=p[i*3-2])
m[n]=p[i*3]
b[n]=p[i*3-2]
}
}
else {
s[n]=p[i*3-2];
if (p[i*3-1]<=p[i*3])
m[n]=p[i*3-1]
b[n]=p[i*3]
}
if (p[i*3]<=p[i*3-1])
m[n]=p[i*3]
b[n]=p[i*3-1]
}
}
}
for (i=1;i<=n;i++){
for (i2=i+1;i2<=n;i2++){
if (s[i]==s[i2] && m[i]==m[i2] && b[i]==b[i2]) ans++
}
}
cout << ans << endl;
}
| a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:30: error: expected ';' before 'b'
13 | m[n]=p[i*3-2]
| ^
| ;
14 | b[n]=p[i*3-1]
| ~
a.cc:17:30: error: expected ';' before 'b'
17 | m[n]=p[i*3-1]
| ^
| ;
18 | b[n]=p[i*3-2]
| ~
a.cc:21:9: error: 'else' without a previous 'if'
21 | else if (p[i*3-1]<=p[i*3-2] && p[i*3-1]==p[i2*3]) {
| ^~~~
a.cc:24:30: error: expected ';' before 'b'
24 | m[n]=p[i*3-2]
| ^
| ;
25 | b[n]=p[i*3]
| ~
a.cc:28:28: error: expected ';' before 'b'
28 | m[n]=p[i*3]
| ^
| ;
29 | b[n]=p[i*3-2]
| ~
a.cc: At global scope:
a.cc:31:9: error: expected declaration before '}' token
31 | }
| ^
a.cc:32:9: error: expected unqualified-id before 'else'
32 | else {
| ^~~~
a.cc:38:13: error: expected unqualified-id before 'if'
38 | if (p[i*3]<=p[i*3-1])
| ^~
a.cc:41:13: error: expected declaration before '}' token
41 | }
| ^
a.cc:42:9: error: expected declaration before '}' token
42 | }
| ^
a.cc:43:5: error: expected declaration before '}' token
43 | }
| ^
a.cc:44:5: error: expected unqualified-id before 'for'
44 | for (i=1;i<=n;i++){
| ^~~
a.cc:44:14: error: 'i' does not name a type
44 | for (i=1;i<=n;i++){
| ^
a.cc:44:19: error: 'i' does not name a type
44 | for (i=1;i<=n;i++){
| ^
a.cc:49:5: error: 'cout' does not name a type
49 | cout << ans << endl;
| ^~~~
a.cc:50:1: error: expected declaration before '}' token
50 | }
| ^
|
s854387887 | p00334 | C++ | #include<iostream>
using namespace std;
main(){
int n,i,i2,ans=0;
cin >> n;
int p[n*3],s[n],b[n],m[n];
for (i=1;1<=n;i++) cin >> p[i*3-2] >> p[i*3-1] >> p[i*3];
for (i=1;1<=n;i++) {
if (p[i*3]<=p[i*3-2] && p[i*3]==p[i2*3-1]) {
s[n]=p[i*3];
if (p[i*3-2]<=p[i*3-1]){
m[n]=p[i*3-2];
b[n]=p[i*3-1];
}
if (p[i*3-1]<=p[i*3-2]) {
m[n]=p[i*3-1];
b[n]=p[i*3-2];
}
}
else if (p[i*3-1]<=p[i*3-2] && p[i*3-1]==p[i2*3]) {
s[n]=p[i*3-1];
if (p[i*3-2]<=p[i*3]){
m[n]=p[i*3-2];
b[n]=p[i*3];
}
if (p[i*3]<=p[i*3-2]){
m[n]=p[i*3];
b[n]=p[i*3-2];
}
}
else {
s[n]=p[i*3-2];
if (p[i*3-1]<=p[i*3]){
m[n]=p[i*3-1];
b[n]=p[i*3];
}
if (p[i*3]<=p[i*3-1]){
m[n]=p[i*3];
b[n]=p[i*3-1];
}
}
}
for (i=1;i<=n;i++){
for (i2=i+1;i2<=n;i2++){
if (s[i]==s[i2] && m[i]==m[i2] && b[i]==b[i2]) ans++
}
}
cout << ans << endl;
}
| a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:46:65: error: expected ';' before '}' token
46 | if (s[i]==s[i2] && m[i]==m[i2] && b[i]==b[i2]) ans++
| ^
| ;
47 | }
| ~
|
s902641308 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n;
cin << n;
int p[1005][3]={};
int x[1005];
for(int i=0;i<n;++i){
for(int j=0;j<3;++j) cin >> p[i][j];
sort(p[i].begin(),p[i].end());
x[i]=100*p[i][0]+10*p[i][1]+p[i][2];
}
sort(x[i].begin(),x[i].end());
int num=0;
int j=0;
for(int i=0;i<n;++i){
for(;;++j){
if(x[j]==x[j+1]) num++;
else {
j++;
break;
}
}
}
cout << num <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:7: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
10 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:10:7: note: candidate: 'operator<<(int, int)' (built-in)
10 | cin << n;
| ~~~~^~~~
a.cc:10:7: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:10:3: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
10 | cin << n;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsigned char*)'
689 | operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:689:5: note: template argument deduction/substitution failed:
a.cc:10:10: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
10 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: note: candidate: 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&)'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
/usr/include/c++/14/ostream:810:5: note: template argument deduction/substitution failed:
/usr/include/c++/14/ostream: In substitution of 'template<class _Ostream, class _Tp> _Ostream&& std::operator<<(_Ostream&&, const _Tp&) [with _Ostream = std::basic_istream<char>&; _Tp = int]':
a.cc:10:10: required from here
10 | cin << n;
| ^
/usr/include/c++/14/ostream:810:5: error: no type named 'type' in 'struct std::enable_if<false, void>'
810 | operator<<(_Ostream&& __os, const _Tp& __x)
| ^~~~~~~~
a.cc:16:15: error: request for member 'begin' in 'p[i]', which is of non-class type 'int [3]'
16 | sort(p[i].begin(),p[i].end());
| ^~~~~
a.cc:16:28: error: request for member 'end' in 'p[i]', which is of non-class type 'int [3]'
16 | sort(p[i].begin(),p[i].end());
| ^~~
a.cc:20:10: error: 'i' was not declared in this scope
20 | sort(x[i].begin(),x[i].end());
| ^
|
s771114582 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
int p[1005][3]={};
int x[1005];
for(int i=0;i<n;++i){
for(int j=0;j<3;++j) cin >> p[i][j];
sort(p[i].begin(),p[i].end());
x[i]=100*p[i][0]+10*p[i][1]+p[i][2];
}
sort(x[i].begin(),x[i].end());
int num=0;
int j=0;
for(int i=0;i<n;++i){
for(;;++j){
if(x[j]==x[j+1]) num++;
else {
j++;
break;
}
}
}
cout << num <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:15: error: request for member 'begin' in 'p[i]', which is of non-class type 'int [3]'
16 | sort(p[i].begin(),p[i].end());
| ^~~~~
a.cc:16:28: error: request for member 'end' in 'p[i]', which is of non-class type 'int [3]'
16 | sort(p[i].begin(),p[i].end());
| ^~~
a.cc:20:10: error: 'i' was not declared in this scope
20 | sort(x[i].begin(),x[i].end());
| ^
|
s671006773 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
int n;
cin >> n;
vector<vector<int>> p(n,vector<int> (3,0));
vector<int> x(n);
for(int i=0;i<n;++i){
for(int j=0;j<3;++j) cin >> p[i][j];
sort(p[i].begin(),p[i].end());
x[i]=100*p[i][0]+10*p[i][1]+p[i][2];
}
sort(x[i].begin(),x[i].end());
int num=0;
int j=0;
for(int i=0;i<n;++i){
for(;;++j){
if(x[j]==x[j+1]) num++;
else {
j++;
break;
}
}
}
cout << num <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:10: error: 'i' was not declared in this scope
20 | sort(x[i].begin(),x[i].end());
| ^
|
s251721445 | p00334 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int a, b, c;
vector<int> x;
vector<vector<int> > y;
for(int i = 0; i < n; i++) {
cin >> a >> b >> c;
x.push_back(a);
x.push_back(b);
x.push_back(c);
sort(x.begin(), x.end());
y.push_back(x);
}
sort(y.begin(), y.end());
y.erase(unique(y.begin(), y.end()), y.end);
cout << n - y.size() << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >, <unresolved overloaded function type>)'
17 | y.erase(unique(y.begin(), y.end()), y.end);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1536 | erase(const_iterator __position)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1564 | erase(const_iterator __first, const_iterator __last)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:52: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'std::vector<std::vector<int> >::const_iterator'
1564 | erase(const_iterator __first, const_iterator __last)
| ~~~~~~~~~~~~~~~^~~~~~
|
s616284457 | p00334 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n;
int a, b, c;
vector<int> x;
vector<vector<int> > y;
for(int i = 0; i < n; i++) {
cin >> a >> b >> c;
x.push_back(a);
x.push_back(b);
x.push_back(c);
sort(x.begin(), x.end());
y.push_back(x);
}
sort(y.begin(), y.end());
y.erase(unique(y.begin(), y.end()), y.end);
cout << n - y.size() << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:12: error: no matching function for call to 'std::vector<std::vector<int> >::erase(__gnu_cxx::__normal_iterator<std::vector<int>*, std::vector<std::vector<int> > >, <unresolved overloaded function type>)'
17 | y.erase(unique(y.begin(), y.end()), y.end);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1536 | erase(const_iterator __position)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1564 | erase(const_iterator __first, const_iterator __last)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:52: note: no known conversion for argument 2 from '<unresolved overloaded function type>' to 'std::vector<std::vector<int> >::const_iterator'
1564 | erase(const_iterator __first, const_iterator __last)
| ~~~~~~~~~~~~~~~^~~~~~
|
s311592667 | p00334 | C++ | #include <iostream>
#include <algorihm>
using namespace std;
int main()
{
int N;
cin>>N;
int p[N][3];
for(int i=0; i<N; i++){
cin>>p[i][0]>>p[i][1]>>p[i][2];
sort(p[i][0],p[i][2]);
for(int j=0; j<i; j++){
if(p[j][0]==p[i][0] && p[j][1]==p[i][1] && p[j][2]==p[i][2])
}
}
} | a.cc:2:10: fatal error: algorihm: No such file or directory
2 | #include <algorihm>
| ^~~~~~~~~~
compilation terminated.
|
s407785337 | p00334 | C++ | #include<iostream>
#include<algorithm>
#include<map>
using namespace std;
main(){
map<int,bool>memo;
int n;
cin>>n;
int cnt=0;
for(int i=0;i<n;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1)*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
cout<<cnt<<endl;
return 0;
} | a.cc:8:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
8 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:21:52: error: expected ')' before ';' token
21 | int k=((p[0]-1)*1000+(p[1]-1)*1000+(p[2]-1);
| ~ ^
| )
a.cc:31:2: error: expected '}' at end of input
31 | }
| ^
a.cc:8:7: note: to match this '{'
8 | main(){
| ^
|
s173842729 | p00334 | C++ | #include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
map<int ,bool> memo;
int N;
cin>>N;
int cnt=0;
for(int i=0;i<N;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
}
cont<<cnt<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:9: error: 'cont' was not declared in this scope; did you mean 'cnt'?
31 | cont<<cnt<<endl;
| ^~~~
| cnt
|
s481592916 | p00334 | C++ | #include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
map<int ,bool> memo;
int N;
cin>>N;
int cnt=0;
for(int i=0;i<N;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
}
cont<<cnt<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:9: error: 'cont' was not declared in this scope; did you mean 'cnt'?
31 | cont<<cnt<<endl;
| ^~~~
| cnt
|
s977185719 | p00334 | C++ | #include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
map<int ,bool> memo;
int N;
cin>>N;
int cnt=0;
for(int i=0;i<N;i++){
int p[3];
cin>>p[0]>>p[1]>>p[2];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
cnt++;
}else{
memo[k]=true;
}
}
cont<<cnt<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:9: error: 'cont' was not declared in this scope; did you mean 'cnt'?
31 | cont<<cnt<<endl;
| ^~~~
| cnt
|
s524052486 | p00334 | C++ | #include <iostream>
#include <algorithm>
#include <map>
using namespace std;
int main(){
map<int,bool> memo;
int n;
cin>>n;
int c=0;
for(int i=0;i<n;i++){
int p[3];
cin>>p[1]>>p[2]>>[3];
sort(p,p+3);
int k=((p[0]-1)*1000+(p[1]-1))*1000+(p[2]-1);
if(memo.find(k)!=memo.end()){
c++;
}else{
memo[k]=true;
}
}
cout<<c<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:15:35: error: expected identifier before numeric constant
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc: In lambda function:
a.cc:15:37: error: expected '{' before ';' token
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc: In function 'int main()':
a.cc:15:32: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'main()::<lambda()>')
15 | cin>>p[1]>>p[2]>>[3];
| ~~~~~~~~~~~~~~~^~~~~
| | |
| | main()::<lambda()>
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'void (*)()'
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: after user-defined conversion: 'constexpr main()::<lambda()>::operator void (*)()() const'
15 | cin>>p[1]>>p[2]>>[3];
| ^
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'short int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'short int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'short int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'short int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'short unsigned int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'short unsigned int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'short unsigned int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'short unsigned int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'unsigned int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'unsigned int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'unsigned int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'unsigned int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'long int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'long int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'long int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'long int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'long unsigned int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| ^
a.cc:15:34: note: no known conversion from 'void (*)()' to 'long unsigned int'
a.cc:15:34: error: invalid conversion from 'void (*)()' to 'long unsigned int' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
| |
| void (*)()
a.cc:15:34: error: conversion to non-const reference type 'long unsigned int&' from rvalue of type 'void (*)()' [-fpermissive]
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:15:34: error: invalid user-defined conversion from 'main()::<lambda()>' to 'long long int&' [-fpermissive]
15 | cin>>p[1]>>p[2]>>[3];
| ^~~
a.cc:15:34: note: candidate is: 'constexpr main()::<lambda()>::operator void (*)()() const' (near match)
15 | cin>>p[1]>>p[2]>>[3];
| |
s485407803 | p00334 | C++ | abc001 abc002 abc003 abc004 abc065 a
#include <iostream>
#include <set>
#include <algorithm>
using namespace std;
int main() {
set<set<int> > surfaces;
int n;
cin >> n;
for (int i = 0; i < n; i++) {
set<int> surface;
int a, b, c;
cin >> a >> b >> c;
surface.insert(a);
surface.insert(b);
surface.insert(c);
surfaces.insert(surface);
}
cout << (n - surfaces.size()) << endl;
} | a.cc:1:1: error: 'abc001' does not name a type
1 | abc001 abc002 abc003 abc004 abc065 a
| ^~~~~~
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:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/wchar.h:35,
from /usr/include/c++/14/cwchar:44,
from /usr/include/c++/14/bits/postypes.h:40:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/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/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/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/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/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/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/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/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/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/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/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/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/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/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size |
s488525729 | p00334 | C++ | #include<cstdio>
#include<iostream>
#include<slgorithm>
using namespace std;
int main(void){
int n,p[1000][3],flg[1000],i,j,k,f,temp,cnt;
cin>>n;
for(i=0;i<n;i++) flg[i]=0;
for(i=0;i<n;i++){
for(j=0;j<3;j++) cin>>p[i][j];
}
for(i=0;i<n;i++){
sort(p[i],p[i]+3);
}
cnt=0;
for(i=0;i<n-1;i++){
if(flg[i]!=1){
for(j=i+1;j<n;j++){
f=1;
for(k=0;k<3;k++){
if(p[i][k]!=p[j][k]){
f=0;
break;
}
}
if(f==1){
cnt++;
flg[j]=1;
}
}
}
}
cout<<cnt<<endl;
return 0;
} | a.cc:3:9: fatal error: slgorithm: No such file or directory
3 | #include<slgorithm>
| ^~~~~~~~~~~
compilation terminated.
|
s318006874 | p00334 | C++ | include<stdio.h>
#include<algorithm>
using namespace std ;
int ans ;
bool ok[ 1000 ][ 1000 ][ 1000 ] ;
int aa[ 3 ] ;
#define a aa[ 0 ]
#define b aa[ 1 ]
#define c aa[ 2 ]
int main()
{
int n ;
scanf( "%d" ,&n ) ;
while( n-- )
{
scanf( "%d %d %d" ,&a ,&b ,&c ) ;
--a ;
--b ;
--c ;
sort( aa ,aa + 3 ) ;
if( ok[ a ][ b ][ c ] )
{
++ans ;
}
else
{
ok[ a ][ b ][ c ] = true ;
}
}
printf( "%d\n" ,ans ) ;
return 0 ;
} | a.cc:1:1: error: 'include' does not name a type
1 | include<stdio.h>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/algorithm:60,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| |
s857607137 | p00334 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n,sum;
cin>>n;
int a[1000][3];
for(int i=0;i<n;i++){
cin>>a[i][0]>>a[i][1]>>a[i][2];
sort(a[i],a[i}+3);
}
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
if(a[i][0]==a[j][0]&&a[i][1]==a[j][1]&&a[i][2]==a[j][2]){
a[j][0]=0;
a[j][1]=0;
a[j][2]=0;
}}}
for(int i=0;i<n;i++){
if(a[i][0]==0||a[i][1]==0||a[i][2]==0)sum++;break;
}
cout<<sum<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:14: error: expected ']' before '}' token
10 | sort(a[i],a[i}+3);
| ^
| ]
a.cc:10:14: error: expected ')' before '}' token
10 | sort(a[i],a[i}+3);
| ~ ^
| )
a.cc:10:17: error: expected ';' before ')' token
10 | sort(a[i],a[i}+3);
| ^
| ;
a.cc: At global scope:
a.cc:12:1: error: expected unqualified-id before 'for'
12 | for(int i=0;i<n;i++){
| ^~~
a.cc:12:13: error: 'i' does not name a type
12 | for(int i=0;i<n;i++){
| ^
a.cc:12:17: error: 'i' does not name a type
12 | for(int i=0;i<n;i++){
| ^
a.cc:19:1: error: expected unqualified-id before 'for'
19 | for(int i=0;i<n;i++){
| ^~~
a.cc:19:13: error: 'i' does not name a type
19 | for(int i=0;i<n;i++){
| ^
a.cc:19:17: error: 'i' does not name a type
19 | for(int i=0;i<n;i++){
| ^
a.cc:22:1: error: 'cout' does not name a type
22 | cout<<sum<<endl;
| ^~~~
a.cc:23:1: error: expected unqualified-id before 'return'
23 | return 0;
| ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
24 | }
| ^
|
s233683408 | p00334 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
bool flag[1001][1001][1001]={};
int n;
cin >> n;
int sum = 0;
int a[3];
rep(i,n){
cin >> a[0] >> a[1] >> a[2];
sort(a,a+3);
if(flag[a[0]][a[1]][a[2]]) sum++;
flag[a[0]][a[1]][a[2]] = true;
}
cout << sum << endl;
return 0;
}
| a.cc:6:3: error: 'cin' does not name a type
6 | cin >> n;
| ^~~
a.cc:2:18: error: expected unqualified-id before 'for'
2 | #define rep(i,n) for(int i=0; i<n; i++)
| ^~~
a.cc:9:3: note: in expansion of macro 'rep'
9 | rep(i,n){
| ^~~
a.cc:9:7: error: 'i' does not name a type
9 | rep(i,n){
| ^
a.cc:2:31: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
a.cc:9:7: error: 'i' does not name a type
9 | rep(i,n){
| ^
a.cc:2:36: note: in definition of macro 'rep'
2 | #define rep(i,n) for(int i=0; i<n; i++)
| ^
a.cc:15:3: error: 'cout' does not name a type
15 | cout << sum << endl;
| ^~~~
a.cc:16:3: error: expected unqualified-id before 'return'
16 | return 0;
| ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s078084164 | p00334 | C++ | #include<iosteam>
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> p1,p2,p3;
for(int i=1;i<=n;i++){
p1.push_back(i);
p2.push_back(i);
p3.push_back(i);
cin>>p1[i]>>p2[i]>>p3[i];
for(int j=0;j<2;j++){
if(p1[i]>=p2[i])swap(p1[i],p2[i]);
if(p2[i]>=p3[i])swap(p2[i],p3[i]);
}
}
int count;
for(int i=1;i<=n;i++){
for(int j=2;j<=n;j++){
if(p1[i]==p1[j]&&p2[i]==p2[j]&&p3[i]==p3[j])count++;
}
}
cout<<count<<endl;
return 0;
}
| a.cc:1:9: fatal error: iosteam: No such file or directory
1 | #include<iosteam>
| ^~~~~~~~~
compilation terminated.
|
s181268489 | p00334 | C++ | #include<iostream>
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> p1,p2,p3;
for(int i=1;i<=n;i++){
p1.push_back(i);
p2.push_back(i);
p3.push_back(i);
cin>>p1[i]>>p2[i]>>p3[i];
for(int j=0;j<2;j++){
if(p1[i]>=p2[i])swap(p1[i],p2[i]);
if(p2[i]>=p3[i])swap(p2[i],p3[i]);
}
}
int count=0;
for(int i=1;i<=n-1;i++){
for(int j=i+1;j<=n;j++){
if(p1[i]==p1[j]&&p2[i]==p2[j]&&p3[i]==p3[j])count++;
}
}
cout<<count<<endl;
return 0;
}v
| a.cc:32:2: error: '\U0000ff56' does not name a type
32 | }v
| ^~
|
s054922641 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >> n;
int p[5000];
for(int i=0; i<n; i++){
cin >> p[i];
}
int min_sum = 200000;
for(int I=0; I<=p[0]; I++){
int q[5000];
for(int i=0; i<n; i++){
q[i]=p[i];
}
int sum = I;
q[0] -= I;
for(int i=0; i<=n-2; i++){
if(q[i]<=0){
continue;
}
sum += q[i]*2;
q[i+1] -= q[i];
}
if(q[n-i]>0){
sum += q[n-1];
}
min_sum = min(min_sum, sum);
}
cout << min_sum << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:34:12: error: 'i' was not declared in this scope
34 | if(q[n-i]>0){
| ^
|
s137288286 | p00335 | C++ | #include<iostream>
using namespace std;
int main(){
int n,p[5000],x=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>p[i];
}
for(int i=1;i<n;i++){
while(p[i]>0){
x+=p[i];
p[i+1]-=p[i];
}
if(p[n]>0){
x+=p[n];
}
cout<<x<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s573426209 | p00335 | C++ | #include<iostream>
using namespace std;
int main(){
int n,p[5000],x=0;
cin>>n;
for(int i=1;i<=n;i++){
cin>>p[i];
}
for(int i=1;i<n;i++){
while(p[i]>0){
x+=p[i];
p[i]=0;
p[i+1]-=p[i];
}
if(p[n]>0){
x+=p[n];
}
cout<<x<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s923172411 | p00335 | C++ | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s963529824 | p00335 | C++ | #include <stdio.h>
int main(){
int n,p[1000],i,count;
scanf("%d",&n);
for(i=1;i<=n;i++){
scanf("%d"&p[i]);
}
count=0;
for(i=1;i<=n;i++){
if(p[i]!=0 && p[i+1]!=0 && p[i+1]>p[i]){
count=count+p[i+1];
}
if(p[i]!=0 && p[i+1]!=0 && p[i]>p[i+1]){
count=count+p[i];
}
if(p[i]!=0 && p[i+1]==0){
count=count+p[i];
}
if(p[i]==0 && p[i+1]!=0){
count=count+p[i];
}
}
printf("%d",count);
return 0;
} | a.cc: In function 'int main()':
a.cc:6:19: error: invalid operands of types 'const char [3]' and 'int' to binary 'operator&'
6 | scanf("%d"&p[i]);
| ~~~~^~~~~
| | |
| | int
| const char [3]
|
s809614702 | p00335 | C++ | // ?????????.cpp : ??????????????? ??¢????????±????????§????????¨????????? ?????????????????????????????????
// AOJ accept
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int N;
int counti = 0;//inside
int counto = 0;//outside
int p[5000];
int q[5000];
cin >> N;
for (int i = 0; i < N; i++) {
cin>>p[i];
q[i] = p[i];
}
int i = N/2;
int j = N/2;
while(1) {
if (i == N-1) {
counti += p[i];
i = -1;
}
else if(i>0){
counti += p[i] * 2;
p[i + 1] -= p[i];
if (p[i + 1] < 0)
p[i + 1] = 0;
p[i] = 0;
i++;
}
if (j == 0) {
counti += p[j];
j = -1;
}
else if(j>0){
counti += p[j] * 2;
p[j - 1] -= p[j];
if (p[j - 1] < 0)
p[j - 1] = 0;
p[j] = 0;
j--;
}
if ((i==-1)&&(j==-1))
break;
}
i = 0;
j = N - 1;
while (1) {
counto += q[i] * 2;
q[i + 1] -= q[i];
q[i] = 0;
if (q[i + 1] < 0)
q[i + 1] = 0;
i++;
if (i == N / 2 + 1)
break;
counto += q[j] * 2;
q[j - 1] -= q[j];
q[j] = 0;
if (q[j-1] < 0)
q[j- 1] = 0;
j--;
}
if (counti > counto)
counti = counto;
cout << counti << endl;
return 0;
} | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s268700131 | p00335 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(void){
int n;
cin >> n;
int pans[n + 1];
for(int i = 0; i < n; i++){
cin >> pans[i];
}
int result = 20000;
for(int i = 0; i <= pans[0]; i++){
int tempPans[n];
for(int j = 0; j < n; j++){
tempPans[j] = pans[j];
}
int tempResult = 0;
tempResult += i;
tempPans[0] -= i;
for(int j = 0; j < n; j++){
if(tempPans[j] > 0){
tempResult += tempPans[j] * 2;
tempPans[j + 1] -= tempPans[j];
temppans[j] = 0;
}
}
result = min(result, tempResult);
}
cout << result << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:24:17: error: 'temppans' was not declared in this scope; did you mean 'tempPans'?
24 | temppans[j] = 0;
| ^~~~~~~~
| tempPans
|
s700397335 | p00335 | C++ | xfdh | a.cc:1:1: error: 'xfdh' does not name a type
1 | xfdh
| ^~~~
|
s542089547 | p00335 | C++ | #include <iostream>
using namespace std;
#define REP(i,n) for(int i=0;i<n;++i)
int n,a[5000],b[5000];
int main() {
cin>>n;
REP(i,n)cin>>b[i];
int ans = 1e6;
REP(i,b[0]+1){
memcpy(a,b,sizeof(b));
a[0]-=i;
int t=i;
REP(j,n-1){
if(a[j]<1)continue;
t+=a[j]*2;
a[j+1]-=a[j];
}
t += max(0, a[n-1]);
ans = min(ans, t);
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'memcpy' was not declared in this scope
10 | memcpy(a,b,sizeof(b));
| ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 | using namespace std;
|
s943424958 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int N;
cin>>N;
int p[5000];
for(int i=0;i<N;i++){
cin>>p[i];
}
int min_sum=20000;
for(int i=0;i<p[0];i++){
int q[5000];
for(int j=0;j<N;j++){
q[i]=p[i];
}
int sum=j;
q[0]-=j;
for(int j=0;j<N-2;j++){
if(q[i]<=0)
continue;
sum +=q[i]*2;
q[i+1] -=q[i];
}
if(q[N-1]>0){
sum +=q[N-1];
}
min_sum=min(min_sum,sum);
}
cout<<min_sum<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:22:25: error: 'j' was not declared in this scope
22 | int sum=j;
| ^
|
s766385938 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int N;
cin>>N;
int p[5000];
for(int i=0;i<N;i++){
cin>>p[i];
}
int turn1=0;
int q[5000];
for(int i=0;i<N;i++){
q[i]=p[i];
}
for(int i=0;i<N;i++){
while(p[i]>0){
if(i==0){
if(p[0]>0){
p[0]--;
p[1]--;
turn1+=2;
}
else{
p[0]--;
turn1++;
}
}
else if(i==N-1){
if(p[N-2]>0){
p[N-1]--;
p[N-2]--;
turn1+=2;
}
}
else{
p[i]--;
p[i+1]--;
turn1+=2;
}
}
}
int turn2=0;
for(int i=0;i<N;i++){
while(p[i]>0){
if(i==0){
if(p[0]>0){
p[0]--;
turn2++;
}
}
else if(i==N-1){
if(p[i]>0){
p[i]--;
turn2++;
}
}
}
else{
p[i]--;
p[i+1]--;
turn2+=2;
}
}
}
cout<<min(turn1,turn2)<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:66:25: error: 'else' without a previous 'if'
66 | else{
| ^~~~
a.cc: At global scope:
a.cc:74:9: error: 'cout' does not name a type
74 | cout<<min(turn1,turn2)<<endl;
| ^~~~
a.cc:76:9: error: expected unqualified-id before 'return'
76 | return 0;
| ^~~~~~
a.cc:77:1: error: expected declaration before '}' token
77 | }
| ^
|
s712681274 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int N;
cin>>N;
int p[5000];
for(int i=0;i<N;i++){
cin>>p[i];
}
int min_sum=20000;
for(int I=0;i<=p[0];I++){
int q[5000];
for(int i=0;i<N;i++){
q[i]=p[i];
}
int sum=I;
q[0]-=I;
for(int i=0;i<N-2;i++){
if(q[i]<=0){
continue;
}
sum+=q[i]*2;
q[i+1]-=q[i];
}
if(q[N-1]>0){
sum+=q[N-1];
}
min_sum=min(min(min_sum,sum);
}
cout<<min_sum<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:13:21: error: 'i' was not declared in this scope
13 | for(int I=0;i<=p[0];I++){
| ^
a.cc:30:45: error: expected ')' before ';' token
30 | min_sum=min(min(min_sum,sum);
| ~ ^
| )
|
s357506563 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int N;
cin>>N;
int p[5000];
for(int i=0;i<N;i++){
cin>>p[i];
}
int min_sum=20000;
for(int i=0;i<=p[0];i++){
int q[5000];
for(int i=0;i<N;i++){
q[i]=p[i];
}
int sum=I;
q[0]-=I;
for(int i=0;i<N-2;i++){
if(q[i]<=0){
continue;
}
sum+=q[i]*2;
q[i+1]-=q[i];
}
if(q[N-1]>0){
sum+=q[N-1];
}
min_sum=min(min_sum,sum);
}
cout <<min_sum<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:23:13: error: 'I' was not declared in this scope
23 | int sum=I;
| ^
|
s424091565 | p00335 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
??
int main(){
????????int N;
????????cin>>N;
??????????
????????int p[5000];
????????for(int i=0;i<N;i++){
????????????????cin>>p[i];
????????}
??????????
????????int min_sum=20000;
??
????????for(int I=0;I<=p[0];I++){
????????????????int q[5000];
????????????????for(int i=0;i<N;i++){
????????????????????????q[i]=p[i];
????????????????}
??????????????????
????????????????int sum=I;
????????????????q[0]-=I;
??????????????????????????
????????????????for(int i=0;i<=N-2;i++){
????????????????????????if(q[i]<=0)
????????????????????????????????continue;
??????????????????
????????????????????????sum+=q[i]*2;
????????????????????????q[i+1]-=q[i];
????????????????}
??
????????????????if(q[N-1]>0){
????????????????????????sum+=q[N-1];
????????????????}
??????????????????
????????????????min_sum=min(min_sum,sum);
????????}
??
????????cout<<min_sum<<endl;
??????????????????????????????????
????????return 0;
}
???????? | a.cc:4:1: error: expected unqualified-id before '?' token
4 | ??
| ^
a.cc:44:1: error: expected unqualified-id before '?' token
44 | ????????
| ^
|
s052994552 | p00335 | C++ | for(int j = 0; j < 2; j++){
V = S;
for(int i = j; i < n-1; i++){
while( !(V[i] <= 0) ){
V[i]--; V[i+1]--;
res+=2;
}
}
while( !(V[n-1] <= 0) ){
V[n-1]--; res++;
}
while( !(V[0] <= 0) ){
V[0]--; res++;
}
ans = min(ans,res);
cout << res << " ";
res = 0;
}
| a.cc:1:1: error: expected unqualified-id before 'for'
1 | for(int j = 0; j < 2; j++){
| ^~~
a.cc:1:16: error: 'j' does not name a type
1 | for(int j = 0; j < 2; j++){
| ^
a.cc:1:23: error: 'j' does not name a type
1 | for(int j = 0; j < 2; j++){
| ^
|
s697280308 | p00335 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <iterator>
#include <map>
#include <algorithm>
typedef std::vector<int> Max;
typedef std::vector<int> Input;
typedef std::vector<int> Section;
typedef std::map<int, int> ScoreResult;
std::map<std::string, Section> get_great_sections (Input input) {
std::size_t input_size = input.size();
/**
* Find max
*/
int max_value = 1;
Max max;
for (int index = 0; index < input_size; index++) {
int value = input[index];
if (value < max_value) {
continue;
}
if (value > max_value) {
max.erase(max.begin(), max.end());
max_value = value;
}
max.push_back(index);
}
if (max.size() == 0) {
std::map<std::string, Section> empty_section;
return empty_section;
}
// Find sections
std::map<std::string, Section> sections;
for (int index : max) {
// [index, index+1]
std::string key_upper = "";
Section section_upper(0);
key_upper += std::to_string(index);
section_upper.push_back(index);
if (index != input_size-1) {
key_upper += std::to_string(index+1);
section_upper.push_back(index+1);
}
sections[key_upper] = section_upper;
// [index-1, index]
std::string key_lower = "";
Section section_lower(0);
if (index != 0) {
key_lower += std::to_string(index-1);
section_lower.push_back(index-1);
}
key_lower += std::to_string(index);
section_lower.push_back(index);
sections[key_lower] = section_lower;
}
/**
* scores sections and get
*/
// score with counting zero
int score_zero = -2;
std::map<std::string, Section> sections_zero_scored;
for (auto iterator = sections.begin(); iterator != sections.end(); iterator++) {
Section section = iterator->second;
int score = 0;
int size = section.size();
if (input[section[0]] == 0) {
score -= 1;
}
if (size > 1 && input[section[1]] == 0) {
score -= 1;
}
if (score_zero > score) {
continue;
}
if (score > score_zero) {
score_zero = score;
sections_zero_scored.erase(sections_zero_scored.begin(), sections_zero_scored.end());
}
sections_zero_scored[iterator->first] = section;
}
// score with components
int score_component = 1;
std::map<std::string, Section> sections_scored_component;
for (auto iterator = sections_zero_scored.begin(); iterator != sections_zero_scored.end(); iterator++) {
Section section = iterator->second;
std::size_t score = section.size();
if (score_component > score) {
continue;
}
if (score > score_component) {
score_component = score;
sections_scored_component.erase(sections_scored_component.begin(), sections_scored_component.end());
}
sections_scored_component[iterator->first] = section;
}
// score with difficulty to delete
bool score_difficulty = false;
std::map<std::string, Section> sections_scored_difficulty;
for (auto iterator = sections_scored_component.begin(); iterator != sections_scored_component.end(); iterator++) {
Section section = iterator->second;
int max = input_size - 1;
bool score = true;
// index pairs that has case [0, x] or [1, x]
if (section[0] < 2) {
if (section[0] == 0 || (section[0] == 1 && input[0] != 0)) {
score = false;
}
}
// index pairs that has case [x, max] or [x, max-1]
if (max - 2 < section[1]) {
if (section[1] == max) {
score = false;
}
}
if (!score && score_difficulty) break;
if (score && !score_difficulty) {
score_difficulty = score;
sections_scored_difficulty.erase(sections_scored_difficulty.begin(), sections_scored_difficulty.end());
}
sections_scored_difficulty[iterator->first] = section;
}
if (score_difficulty) return sections_scored_difficulty;
// score with distance from first or last
bool score_distance = 0;
std::map<std::string, Section> sections_scored_distance;
for (auto iterator = sections_scored_difficulty.begin(); iterator != sections_scored_difficulty.end(); iterator++) {
Section section = iterator->second;
int max = input_size - 1;
int score_first = 2;
int score_last = 2;
// score pairs that has case [0, x] or [1, x]
if (section[0] < 2) score_first = section[0];
// score pairs that has case [x, max] or [x, max-1]
if (max - 2 < section[1]) score_last = max - section[1];
int score = std::min(score_first, score_last);
if (score_distance > score) continue;
if (score > score_distance) {
score_distance = score;
sections_scored_distance.erase(sections_scored_distance.begin(), sections_scored_distance.end());
}
sections_scored_distance[iterator->first] = section;
}
return sections_scored_distance;
}
int main () {
int input_size;
std::cin >> input_size;
Input input(0);
for (int i = 0; i < input_size; i++) {
int tmp;
std::cin >> tmp;
input.push_back(tmp);
}
if (input.size() != input_size) {
std::cerr << "expected size " << input.size() << " but expect " << input_size << std::endl;
exit(1);
}
int cnt = 0;
while (true) {
auto section_map = get_great_sections(input);
if (section_map.size() == 0) break;
auto section = (*section_map.begin()).second;
if (section.size() == 1) {
cnt += input[section[0]];
input[section[0]] = 0;
continue;
}
int remnum = std::min(input[section[0]], input[section[1]]);
cnt += remnum * 2;
input[section[0]] -= remnum;
input[section[1]] -= remnum;
}
std::cout << cnt << std::endl;
}
| a.cc:78:19: error: extended character is not valid in an identifier
78 | if (size > 1 && input[section[1]] == 0) {
| ^
a.cc: In function 'std::map<std::__cxx11::basic_string<char>, std::vector<int> > get_great_sections(Input)':
a.cc:78:19: error: '\U000000a01' was not declared in this scope
78 | if (size > 1 && input[section[1]] == 0) {
| ^~
|
s702963441 | p00335 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <iterator>
#include <map>
#include <algorithm>
typedef std::vector<int> Max;
typedef std::vector<int> Input;
typedef std::vector<int> Section;
typedef std::map<int, int> ScoreResult;
std::map<std::string, Section> get_great_sections (Input input) {
std::size_t input_size = input.size();
/**
* Find max
*/
int max_value = 1;
Max max;
for (int index = 0; index < input_size; index++) {
if (input[index] == 0) continue;
int value = 1;
if ((index != 0) && (index != input_size-1)) {
value = input[index];
}
if (value < max_value) {
continue;
}
if (value > max_value) {
max.erase(max.begin(), max.end());
max_value = value;
}
max.push_back(index);
}
if (max.size() == 0) {
std::map<std::string, Section> empty_section;
return empty_section;
}
// Find sections
std::map<std::string, Section> sections;
for (int index : max) {
// [index, index+1]
std::string key_upper = "";
Section section_upper(0);
key_upper += std::to_string(index);
section_upper.push_back(index);
if (index != input_size-1) {
key_upper += std::to_string(index+1);
section_upper.push_back(index+1);
}
sections[key_upper] = section_upper;
// [index-1, index]
std::string key_lower = "";
Section section_lower(0);
if (index != 0) {
key_lower += std::to_string(index-1);
section_lower.push_back(index-1);
}
key_lower += std::to_string(index);
section_lower.push_back(index);
sections[key_lower] = section_lower;
}
/**
* scores sections and get
*/
// score with counting zero
int score_zero = -2;
std::map<std::string, Section> sections_zero_scored;
for (auto iterator = sections.begin(); iterator != sections.end(); iterator++) {
Section section = iterator->second;
int score = 0;
int size = section.size();
if (input[section[0]] == 0) {
score -= 1;
}
if (size > 1 && input[section[1]] == 0) {
score -= 1;
}
if (score_zero > score) {
continue;
}
if (score > score_zero) {
score_zero = score;
sections_zero_scored.erase(sections_zero_scored.begin(), sections_zero_scored.end());
}
sections_zero_scored[iterator->first] = section;
}
// score with components
int score_component = 1;
std::map<std::string, Section> sections_scored_component;
for (auto iterator = sections_zero_scored.begin(); iterator != sections_zero_scored.end(); iterator++) {
Section section = iterator->second;
std::size_t score = section.size();
if (score_component > score) {
continue;
}
if (score > score_component) {
score_component = score;
sections_scored_component.erase(sections_scored_component.begin(), sections_scored_component.end());
}
sections_scored_component[iterator->first] = section;
}
// score with difficulty to delete
bool score_difficulty = false;
std::map<std::string, Section> sections_scored_difficulty;
for (auto iterator = sections_scored_component.begin(); iterator != sections_scored_component.end(); iterator++) {
Section section = iterator->second;
int max = input_size - 1;
bool score = true;
// index pairs that has case [0, x] or [1, x]
if (section[0] < 2) {
if (section[0] == 0 || (section[0] == 1 && input[0] != 0)) {
score = false;
}
}
// index pairs that has case [x, max] or [x, max-1]
if (max - 2 < section[1]) {
if (section[1] == max) {
score = false;
}
}
if (!score && score_difficulty) break;
if (score && !score_difficulty) {
score_difficulty = score;
sections_scored_difficulty.erase(sections_scored_difficulty.begin(), sections_scored_difficulty.end());
}
sections_scored_difficulty[iterator->first] = section;
}
if (score_difficulty) return sections_scored_difficulty;
// score with distance from first or last
bool score_distance = 0;
std::map<std::string, Section> sections_scored_distance;
for (auto iterator = sections_scored_difficulty.begin(); iterator != sections_scored_difficulty.end(); iterator++) {
Section section = iterator->second;
int max = input_size - 1;
int score_first = 2;
int score_last = 2;
// score pairs that has case [0, x] or [1, x]
if (section[0] < 2) score_first = section[0];
// score pairs that has case [x, max] or [x, max-1]
if (max - 2 < section[1]) score_last = max - section[1];
int score = std::min(score_first, score_last);
if (score_distance > score) continue;
if (score > score_distance) {
score_distance = score;
sections_scored_distance.erase(sections_scored_distance.begin(), sections_scored_distance.end());
}
sections_scored_distance[iterator->first] = section;
}
return sections_scored_distance;
}
int main () {
int input_size;
std::cin >> input_size;
Input input(0);
for (int i = 0; i < input_size; i++) {
int tmp;
std::cin >> tmp;
input.push_back(tmp);
}
if (input.size() != input_size) {
exit(1);
}
int cnt = 0;
while (true) {
std::cout <<
auto section_map = get_great_sections(input);
if (section_map.size() == 0) break;
// select selection with weight about distance from start or end
int side_zeros = 0;
Section section;
for (auto i = section_map.begin(); i != section_map.end(); i++) {
Section current_section = i->second;
int current = 0;
if (current_section.size() == 1) {
if (current_section[0] == 0 && input[current_section[0]+1] == 0) {
current += 1;
} else if (input[current_section[0]-1] == 0) {
current += 1;
}
} else {
if (current_section[0] != 0 && input[current_section[0]-1] == 0) {
current += 1;
}
if (current_section[1] != input_size - 1 && input[current_section[1]+1] == 0) {
current += 1;
}
}
if (current == side_zeros) {
section = current_section;
}
if (current > side_zeros) {
side_zeros = current;
section = current_section;
}
if (current == 2) break;
}
if (section.size() == 1) {
cnt += input[section[0]];
input[section[0]] = 0;
continue;
}
int min = std::min(input[section[0]], input[section[1]]);
if (min != 0) {
cnt += min * 2;
input[section[0]] -= min;
input[section[1]] -= min;
continue;
}
int max = std::max(input[section[0]], input[section[1]]);
cnt += max*2;
input[section[0]] = input[section[1]] = 0;
}
std::cout << cnt << std::endl;
}
| a.cc: In function 'int main()':
a.cc:194:9: error: expected primary-expression before 'auto'
194 | auto section_map = get_great_sections(input);
| ^~~~
a.cc:195:13: error: 'section_map' was not declared in this scope
195 | if (section_map.size() == 0) break;
| ^~~~~~~~~~~
a.cc:200:23: error: 'section_map' was not declared in this scope; did you mean 'section'?
200 | for (auto i = section_map.begin(); i != section_map.end(); i++) {
| ^~~~~~~~~~~
| section
|
s410018583 | p00336 | C | #include<stdio.h>
#include<string.h>
long speller( char *fake ,char *now ,int end )
{
int ret = 0 ;
int fake_p = 0 ,now_p = 0 ;
if( now[ now_p ] < end )
{
return 1 ;
}
while( fake[ fake_p ] != '\0' )
{
if( fake[ fake_p ] == now[ now_p ] )
{
ret += speller( fake + fake_p + 1 ,now + 1 ,end - 1 ) ;
now_p ;
if( now[ now_p ] == '\0' )
{
return ret ;
}
}
++fake_p ;
}
return ret ;
}
int main()
{
char fake_spell[ 1000 + 1 ] ;
scanf( "%s" ,fake_spell ) ;
char spell[ 1000 + 1 ] ;
scanf( "%s" ,spell ) ;
int end = strlen( fake_spell ) - strlen( spell ) + 1 ;
printf( "%ld\n" ,speller( fake_spell ,spell ,end ) ) ;
return 0 ;
}
/*
#include<stdio.h>
#include<string.h>
long speller( char *fake ,char *now )
{
int ret = 0 ;
int fake_p = 0 ,now_p = 0 ;
if( now[ now_p ] == '\0' )
{
return 1 ;
}
while( fake[ fake_p ] != '\0' )
{
if( fake[ fake_p ] == now[ now_p ] )
{
ret += speller( fake + fake_p + 1 ,now + 1 ) ;
now_p ;
if( now[ now_p ] == '\0' )
{
return ret ;
}
}
++fake_p ;
}
return ret ;
}
int main()
{
char fake_spell[ 1000 + 1 ] ;
scanf( "%s" ,fake_spell ) ;
char spell[ 1000 + 1 ] ;
scanf( "%s" ,spell ) ;
printf( "%ld\n" ,speller( fake_spell ,spell ) ) ;
return 0 ;
} | main.c:66:1: error: unterminated comment
66 | /*
| ^
|
s479207701 | p00336 | C | /*
????????? ??????????????????????????? ???????????????
?????£?????¶?????????????????????????????????????????????????????¶???????????????????????????????????????
??¨??????????\???????????????????????????????????????????????????????????????????????????????????????????
??????????????±??¨??????????????????????\???????????????????????????????????????????????????¨????????????
???????????????????????????????????¨????????????????????????????¨???????????????????????????????????????????
??????????????????????????????????????????????????¬???????????°?????????????????§????????????????????????
?????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????¨?????¨?????§?????????????????????????????????????????¨??????????????????
??°???????????????abab?????§???????????????ab?????§????????°?????£?¶???§???????????????????????????ab???
??????abab???????????????????????????????????????abab, abab, abab ??????????????????
??????
????????¨??????????????????????????¨?????????????????????????????????????????????????????????????????????
??°????????????????????????
??\???
??\????????\????????¢?????§??????????????????
t
b
???????????????????????????????????????????????¨????????????t?????????????????????????????????????????????
???????????????????????¨????????????b???????????????????????????????????????????????±?°???????????????????
??????????????????1??\???1000??\?????????????????§?????????
??????
?????????????????????????????????????????????????????????????????????????????????????????????????????????
????????§???????????????????????§?????£????????? 1,000,000,007 ??§?????£???????????????????????????
?????? http://judge.u-aizu.ac.jp/onlinejudge/review.jsp?rid=2468455#1
*/
#include <stdio.h>
#include <string.h> // ??????????????¢????????¢??°?????????
#define M 1000000007
#define NUM 100
int main( void )
{
int i, j, k; //
char t[ NUM + 1 ]; // ????????????????????????????????¨???????????? t
char b[ NUM + 1 ]; // ????????????????????????????????¨???????????? b
int lent; // t ???????????????
int lenb; // b ???????????????
int sum; // ??????????????????????????????????????????
int d[ NUM ][ NUM ];
scanf( "%s", t ); // ???????????????????????????
lent = strlen( t );
scanf( "%s", b ); // ???????????????????????????
lenb = strlen( b );
for ( i = 0 ; i < lenb ; i++ ) {
for ( j = 0 ; j < lent ; j++ ) {
d[ i ][ j ] = 0;
}
}
for ( j = 0 ; j < lent ; j++ ) {
// ??????????????????????????¢???
if ( b[ 0 ] == t[ i ] ) {
d[ 0 ][ j ] = 1;
}
}
// ???????????????????????????????????????1??????????????§?????§??????????????????...
for ( i = 0 ; i < lenb - 1 ; i++ ) {
for ( j = 0 ; j < lent ; j++ ) {
if ( dp[ i ][ j ] != 0 ) { // ???????????????????????????
for ( k = j + 1 ; k < lent ; k++ ) {
if ( b[ i + 1] == t[ k ] ) {
dp[ i + 1 ][ k ] += dp[ i ][ j ];
dp[ i + 1 ][ k ] %= M;
}
}
}
}
}
for ( i = 0 ; i < lenb ; i++ ) {
for ( j = 0 ; j < lent ; j++ ) {
printf( "%4d", d[ i ][ j ] );
}
printf( "\n" );
}
sum = 0;
for ( i = 0 ; i < lent ; i++ ) {
sum += dp[ lenb - 1 ][ i ];
sum %= M;
}
printf( "%d\n", sum );
return 0;
} | main.c: In function 'main':
main.c:75:30: error: 'dp' undeclared (first use in this function); did you mean 'd'?
75 | if ( dp[ i ][ j ] != 0 ) { // ???????????????????????????
| ^~
| d
main.c:75:30: note: each undeclared identifier is reported only once for each function it appears in
|
s407411343 | p00336 | C++ | // PCK2016予選7 イワシロ・イッツァ
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0341&lang=ja
#include <bits/stdc++.h>
using namespace std;
int main(void){
string T,B;
int dp[1001][1001];
cin >> T >> B;
if(T[0]==B[0]){
dp[0][0]=1;
}
else{
dp[0][0]=0;
}
for(int j=1;j<T.size();j++){
dp[0][j]=dp[0][j-1];
if(T[j]==B[0]){
dp[0][j]++;
}
}
for(int i=1;i<B.size();i++){
dp[i][0]=0;
for(int j=1;j<T.size();j++){
dp[i][j]=dp[i][j-1];
if(B[i]==T[j]){
dp[i][j]=(dp[i][j]+dp[i-1][j-1])%1000000007;
}
}
}
cout << dp[B.size()-1][T.size()-1] << endl;
}
Close
Sphere Research Labs. Ideone is powered by Sphere Engine™
home api widget faq credits desktop mobile
terms of service privacy policy gdpr info
Feedback & Bugs
Not using Hotjar yet?
Select an element on the page.
| a.cc:35:1: error: 'Close' does not name a type
35 | Close
| ^~~~~
|
s119617340 | p00336 | C++ | include <bits/stdc++.h>
using namespace std;
typedef long long int64;
int64 memo[1111][1111];
int64 dfs(int i,int cnt);
string t,b;
int main(){
for(int i = 0;i < 1111;i++){
for(int j = 0;j < 1111;j++){
memo[i][j] = -1;
}
}
t += '0';
string a;
cin >> a >> b;
t += a;
cout << dfs(0,0) << endl;
return 0;
}
int64 dfs(int i,int cnt){
int rec = 0;
if(cnt == b.size())return 1;
if(memo[i][cnt] != -1)return memo[i][cnt];
for(int j = i + 1;j < t.size();j++){
if(t[j] == b[cnt])rec = (rec + dfs(j,cnt + 1)) % 1000000007;
}
return memo[i][cnt] = rec % 1000000007;
} | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc:13:1: error: 'string' does not name a type
13 | string t,b;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:29:3: error: 't' was not declared in this scope
29 | t += '0';
| ^
a.cc:31:3: error: 'string' was not declared in this scope
31 | string a;
| ^~~~~~
a.cc:33:3: error: 'cin' was not declared in this scope
33 | cin >> a >> b;
| ^~~
a.cc:33:10: error: 'a' was not declared in this scope
33 | cin >> a >> b;
| ^
a.cc:33:15: error: 'b' was not declared in this scope
33 | cin >> a >> b;
| ^
a.cc:37:3: error: 'cout' was not declared in this scope
37 | cout << dfs(0,0) << endl;
| ^~~~
a.cc:37:23: error: 'endl' was not declared in this scope
37 | cout << dfs(0,0) << endl;
| ^~~~
a.cc: In function 'int64 dfs(int, int)':
a.cc:49:13: error: 'b' was not declared in this scope
49 | if(cnt == b.size())return 1;
| ^
a.cc:53:25: error: 't' was not declared in this scope
53 | for(int j = i + 1;j < t.size();j++){
| ^
a.cc:55:16: error: 'b' was not declared in this scope
55 | if(t[j] == b[cnt])rec = (rec + dfs(j,cnt + 1)) % 1000000007;
| ^
|
s067813255 | p00336 | C++ | #include<bits/stdc++.h>
//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
//??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
void rep(){
int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
}
using namespace std;
#define MAX_MOD 1000000007
long long dp[2000][2000] = {};//1???????????????->?????????t??????????????§???????????????2???????????????->?????????s??¨???????????§?????´?????????
int main() {
string t, b;
cin >> t >> b;
dp[0][0] = 1;//t???????????????????????¶?????§???????????¶b??¨?????´?????????????????????????????????
for (int i = 0;i < t.length();++i) {
//t[i]?????????????????????
//???????????§?????????????????£???????????????????????????????????\???????????????
dp[i + 1][b.length()] += dp[i][b.length()];
dp[i + 1][b.length()] %= MAX_MOD;
for (int q = 0;q < b.length();++q) {
//b[q]??¨t[i]????????´??????????????????
if (b[q] == t[i]) {
//t[i]??????????????¨?????????????????¨??§???s[q]??¨?????´???????????§?¬???????????????¢????????????
dp[i + 1][q + 1] += dp[i][q];
dp[i + 1][q + 1] %= MAX_MOD;//???????????¨???
}
//t[i]?????????????????????????????£?????¨????????????????¶????s[q]??¨?????´?????????????????¢???
dp[i + 1][q] += dp[i][q];
}
}
//t?????¨????????????????????§????????????b??¨??????????????????????????´????????????????????°?????????
cout << dp[t.length()][b.length()] << endl;
return 0;
} | a.cc: In function 'void rep()':
a.cc:10:49: error: redeclaration of 'int b'
10 | int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
| ^
a.cc:10:9: note: 'int b' previously declared here
10 | int a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,b,w,x,y,z;
| ^
|
s586103769 | p00337 | C++ | #include <stdio.h>
#include <utility>
#include <math.h>
#include <algorithm>
#include <stack>
using namespace std;
typedef pair< pair<int, int>, int> piii;
bool comp(const piii *a, const piii *b) {
if((*a).first.first * (*b).first.second > (*a).first.second * (*b).first.first) return true;
else return false;
}
int main(void) {
int i, j, k, v, r;
double ans = 0.0;
scanf("%d%d", &v, &r);
bool flag[v];
piii p[v];
int tx = 0, ty = 0;
for(i = 0; i < v; ++i) {
flag[i] = true;
scanf("%d%d", &p[i].first.fisrt, &p[i].first.second);
p[i].second = i;
if(i < 3)tx += p[i].first.first, ty += p[i].first.second;
}
tx /= 3, ty /= 3;
for(i = 0; i < v; ++i) p[i].first.first -= tx, p[i].first.second -= ty;
sort(p, p + v, comp);
stack<piii> sta;
sta.push(p[0]), sta.push(p[1]);
for(i = 2; i < v; ++i) {
while( 1 ) {
piii s1 = sta.top();
sta.pop();
piii s2 = sta.top();
if((s1.first.first -
}
}
| a.cc: In function 'int main()':
a.cc:23:31: error: 'struct std::pair<int, int>' has no member named 'fisrt'; did you mean 'first'?
23 | scanf("%d%d", &p[i].first.fisrt, &p[i].first.second);
| ^~~~~
| first
a.cc:38:5: error: expected primary-expression before '}' token
38 | }
| ^
a.cc:37:27: error: expected ')' before '}' token
37 | if((s1.first.first -
| ~ ^
| )
38 | }
| ~
a.cc:37:27: error: expected ')' before '}' token
37 | if((s1.first.first -
| ~ ^
| )
38 | }
| ~
a.cc:38:5: error: expected primary-expression before '}' token
38 | }
| ^
a.cc:39:4: error: expected '}' at end of input
39 | }
| ^
a.cc:14:16: note: to match this '{'
14 | int main(void) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = std::pair<std::pair<int, int>, int>*; _Iterator2 = std::pair<std::pair<int, int>, int>*; _Compare = bool (*)(const std::pair<std::pair<int, int>, int>*, const std::pair<std::pair<int, int>, int>*)]':
/usr/include/c++/14/bits/stl_algo.h:1777:14: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1777 | if (__comp(__i, __first))
| ~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = pair<pair<int, int>, int>*; _Compare = bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:29:7: required from here
29 | sort(p, p + v, comp);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: cannot convert 'std::pair<std::pair<int, int>, int>' to 'const std::pair<std::pair<int, int>, int>*' in argument passing
158 | { return bool(_M_comp(*__it1, *__it2)); }
| ~~~~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Val_comp_iter<_Compare>::operator()(_Value&, _Iterator) [with _Value = std::pair<std::pair<int, int>, int>; _Iterator = std::pair<std::pair<int, int>, int>*; _Compare = bool (*)(const std::pair<std::pair<int, int>, int>*, const std::pair<std::pair<int, int>, int>*)]':
/usr/include/c++/14/bits/stl_algo.h:1757:20: required from 'void std::__unguarded_linear_insert(_RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Val_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1757 | while (__comp(__val, __next))
| ~~~~~~^~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1785:36: required from 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1785 | std::__unguarded_linear_insert(__i,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
1786 | __gnu_cxx::__ops::__val_comp_iter(__comp));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1817:25: required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1817 | std::__insertion_sort(__first, __first + int(_S_threshold), __comp);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1908:31: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1908 | std::__final_insertion_sort(__first, __last, __comp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4805:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = pair<pair<int, int>, int>*; _Compare = bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)]'
4805 | std::__sort(__first, __last, __gnu_cxx::__ops::__iter_comp_iter(__comp));
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:29:7: required from here
29 | sort(p, p + v, comp);
| ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:240:30: error: cannot convert 'std::pair<std::pair<int, int>, int>' to 'const std::pair<std::pair<int, int>, int>*' in argument passing
240 | { return bool(_M_comp(__val, *__it)); }
| ~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value&) [with _Iterator = std::pair<std::pair<int, int>, int>*; _Value = std::pair<std::pair<int, int>, int>; _Compare = bool (*)(const std::pair<std::pair<int, int>, int>*, const std::pair<std::pair<int, int>, int>*)]':
/usr/include/c++/14/bits/stl_heap.h:140:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare&) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Distance = long int; _Tp = pair<pair<int, int>, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_val<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
140 | while (__holeIndex > __topIndex && __comp(__first + __parent, __value))
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:247:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Distance = long int; _Tp = pair<pair<int, int>, int>; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
247 | std::__push_heap(__first, __holeIndex, __topIndex,
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
248 | _GLIBCXX_MOVE(__value), __cmp);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_heap.h:356:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare&) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
356 | std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
357 | __comp);
| ~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1593:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1593 | std::__make_heap(__first, __middle, __comp);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1868:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = pair<pair<int, int>, int>*; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(const pair<pair<int, int>, int>*, const pair<pair<int, int>, int>*)>]'
1868 | std::__heap_select(__first, __middle, __last, __comp);
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1884:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAc |
s061696107 | p00337 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
typedef complex<int> Point;
bool Comp(const Point &p, const Point &q)
{
if (p.real() != q.real()) return p.real() < q.real();
return p.imag() < q.imag();
}
int Cross(const Point &p, const Point &q)
{
return p.real()*q.imag() - p.imag()*q.real();
}
bool IsNG(const Point &p1, const Point &p2, const Point &p3)
{
return Cross(p2 - p3, p1 - p2) <= 0;
}
double GetDistance(const Point &p, const Point &q)
{
int dx = p.real() - q.real();
int dy = p.imag() - q.imag();
return sqrt(dx*dx + dy*dy);
}
vector<Point> SortReew(vector<Point> ps)
{
sort(ps.begin(), ps.end(), Comp);
vector<Point> u;
for (int i = 0; i < ps.size(); i++)
{
while (u.size() > 1 && IsNG(ps[i], u[u.size() - 1], u[u.size() - 2]))
u.pop_back();
u.push_back(ps[i]);
}
vector<Point> d;
for (int i = ps.size() - 1; i >= 0; i--)
{
while (d.size() > 1 && IsNG(ps[i], d[d.size() - 1], d[d.size() - 2]))
d.pop_back();
d.push_back(ps[i]);
}
for (int i = 1; i < d.size() - 1; i++)
{
u.push_back(d[i]);
}
return u;
}
struct UF
{
vector<int> par;
UF(int n)
{
par.resize(n);
for (int i = 0; i < n; i++) par[i] = i;
}
int Find(int x)
{
if (x == par[x]) return x;
return par[x] = Find(par[x]);
}
bool Unite(int a, int b)
{
if (Find(a) == Find(b)) return false;
par[Find(b)] = Find(a);
return true;
}
};
int V, R;
map< pair<int, int>, int> m;
struct Edge
{
int a, b;
double cost;
Edge() {}
Edge(int a, int b, double cost) : a(a), b(b), cost(cost) {}
bool operator < (const Edge &e) const
{
return cost < e.cost;
}
};
signed main()
{
cin >> V >> R;
vector<Point> v(V);
for (int i = 0; i < V; i++)
{
cin >> v[i].real() >> v[i].imag();
m[make_pair(v[i].real(), v[i].imag())] = i;
}
double ans = 0;
vector<Point> ret = SortReew(v);
UF uf(V);
for (int i = 0; i < ret.size(); i++)
{
Point p = ret[i];
Point q = ret[(i+1)%ret.size()];
int a = m[make_pair(p.real(), p.imag())];
int b = m[make_pair(q.real(), q.imag())];
uf.Unite(a,b);
ans += GetDistance(v[a], v[b]);
//cout<<"\t"<<a<<" "<<b<<endl;
}
//printf("%.20f\n",ans);
/*for (int i = 0; i < ret.size(); i++)
{
printf("%lld %lld\n", ret[i].real(), ret[i].imag());
}*/
vector<Edge> es;
for (int i = 0; i < R; i++)
{
int a, b;
cin >> a >> b; a--; b--;
es.push_back( Edge(a, b, GetDistance(v[a], v[b]) ));
}
sort(es.begin(), es.end());
for (int i = 0; i < es.size(); i++)
{
if (uf.Unite(es[i].a, es[i].b)) ans += es[i].cost;
}
printf("%.20f\n", ans);
return 0;
} | a.cc: In function 'int main()':
a.cc:97:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long int')
97 | cin >> v[i].real() >> v[i].imag();
| ~~~ ^~ ~~~~~~~~~~~
| | |
| | long long int
| std::istream {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'short int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'short unsigned int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'unsigned int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'long int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'long unsigned int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'long long int&' to an rvalue of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'long long unsigned int&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'float&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'double&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: cannot bind non-const lvalue reference of type 'long double&' to a value of type 'long long int'
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: invalid conversion from 'long long int' to 'void*' [-fpermissive]
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
| |
| long long int
a.cc:97:25: error: cannot bind rvalue '(void*)(& v.std::vector<std::complex<long long int> >::operator[](((std::vector<std::complex<long long int> >::size_type)i)))->std::complex<long long int>::real()' to 'void*&'
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:7: note: conversion of argument 1 would be ill-formed:
a.cc:97:25: error: invalid conversion from 'long long int' to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
97 | cin >> v[i].real() >> v[i].imag();
| ~~~~~~~~~^~
| |
| long long int
/usr/include/c++/14/istream:126:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>; __ios_type = std::basic_ios<char |
s568485378 | p00337 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,a) for(int i=0;i<(a);++i)
#define MP make_pair
#define INF int(1e9)
using namespace std;
typedef pair<double, int> P;
int V, R;
double ans, flag[1000], flag2[1000];
vector <complex<double> > pt;
vector <double> edge[1000];
priority_queue<P> pq;
bool border(int I, int J)
{
complex<double> f = pt[I], t = pt[J];
complex<double> v = t - f;
bool l = false, r = false;
REP(i, V)
{
if(i == I || i == J) continue;
complex<double> com = pt[i] - f;
com = com * conj(v);
if(com.imag() < 0) left = 1;
if(com.imag() > 0) right = 1;
}
if(l == 0 || r == 0)
{
ans += abs(v);
return true;
}
return false;
}
double dis(int f, int t)
{
return abs(pt[t] - pt[f]);
}
int main()
{
cin >> V >> R;
pt.resize(V);
REP(i, V)
{
double in1, in2;
cin >> in1 >> in2;
pt[i] = complex<double>(in1,in2);
}
REP(i, V)
{
edge[i].resize(V);
}
REP(i, V)
{
REP(j, i)
{
if(!border(i, j))
{
edge[i][j] = INF;
edge[j][i] = INF;
}
}
}
REP(i, R)
{
int in1, in2;
cin >> in1 >> in2;
--in1; --in2;
if(!edge[in1][in2]) continue;
edge[in1][in2] = edge[in2][in1] = dis(in1, in2);
}
pq.push(MP(0, 0));
fill(flag, flag + V, INF);
flag[0] = 0;
while(!pq.empty())
{
int now = pq.top().second, cost = pq.top().first * -1;
pq.pop();
REP(i, V)
{
if(flag[i] > flag[now] + edge[now][i])
{
flag[i] = flag[now] + edge[now][i];
flag2[i] = edge[now][i];
pq.push(MP(flag[i] * -1, i));
}
}
}
REP(i, V)
{
ans += flag2[i];
}
cout << ans << endl;
} | a.cc: In function 'bool border(int, int)':
a.cc:24:41: error: assignment of function 'std::ios_base& std::left(ios_base&)'
24 | if(com.imag() < 0) left = 1;
| ~~~~~^~~
a.cc:25:42: error: assignment of function 'std::ios_base& std::right(ios_base&)'
25 | if(com.imag() > 0) right = 1;
| ~~~~~~^~~
|
s263442061 | p00337 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int V,R;
double EPS=1e-10;
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(){x=0;y=0;}
P(double x,double y):x(x),y(y){}
P operator +(P p){
return P(add(x,p.x),add(y,p.y));
}
bool operator ==(P p){
return p.x==x&&p.y==y;
}
P operator -(P p){
return P(add(x,-p.x),add(y,-p.y));
}
double det(P p){
return add(x*p.y,-y*p.x);
}
};
P table[1000];
double edge[101][101];
bool cmp_x(const P& p,const P& q){
if(p.x!=q.x)return p.x<q.x;
return p.y<q.y;
}
double dist(P p,P q){
return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
}
vector<P> convex_hull(P* pps,int n){
//sort(ps,ps+n,cmp_x);
P ps[1000];
for(int i=0;i<n;i++)ps[i]=pps[i];
int k=0;
vector<P>qs(n*2);
sort(ps,ps+n,cmp_x);
for(int i=0;i<n;i++){
while(true){
if(k<=1)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
for(int i=n-2,t=k;i>=0;i--){
while(true){
if(k<=t)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
qs.resize(k-1);
return qs;
}
bool used[1000];
int main(){
cin>>V>>R;
for(int i=0;i<V;i++){
cin>>table[i].x>>table[i].y;
}
for(int i=0;i<R;i++){
int a,b;
cin>>a>>b;
edge[a-1][b-1]=dist(P(table[a-1]),P(table[b-1]));
edge[b-1][a-1]=dist(P(table[a-1]),P(table[b-1]));
}
vector<P>a;
a=convex_hull(table,V);
//sort(table,table+V,cmp_x);
for(int i=0;i<V;i++){
for(int j=0;j<a.size();j++){
if(table[i].x==a[j].x&&table[i].y==a[j].y){
//cout<<a[j].x<<" "<<a[j].y<<" "<<i<<endl;
used[i]=1;
}
}
}
for(int i=0;i<V;i++){
for(int j=0;j<V;j++){
if(used[i]&&used[j]){
edge[i][j]=dist(table[i],table[j]);
edge[j][i]=dist(table[i],table[j]);
}
}
}
//for(int i=0;i<V;i++)cout<<used[i]<<" "<<table[i].x<<" "<<table[i].y<<endl;
//for(int i=0;i<a.size();i++)cout<<a[i].x<<" "<<a[i].y<<" "<<"A"<<endl;
double ans=0;
for(int i=1;i<a.size();i++)ans+=dist(a[i],a[i-1]);
ans+=dist(a[0],a[a.size()-1]);
//cout<<ans<<endl;
// for(int i=0;i<V;i++){
// for(int j=0;j<V;j++)cout<<edge[i][j]<<" ";
// cout<<endl;
// }
const int INF=100000;
for(int i=0;i<V;i++){
double min=INF;
int num=0;
if(used[i])continue;
for(int j=0;j<V;j++){
if(edge[i][j]<=EPS)continue;
//?????????????????????????????¨???
if(min>edge[i][j]&&used[j]){
min=edge[i][j];
num=j;
}
}
//cout<<i<<" "<<table[i].x<<" "<<table[i].y<<" "<<table[num].x<<" "<<table[num].y<<" "<<min<<endl;
if(min==INF)continue;
ans+=min;
used[num]=true;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'double dist(P, P)':
a.cc:45:16: error: 'sqrt' was not declared in this scope
45 | return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
| ^~~~
|
s392287616 | p00337 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
int V,R;
double EPS=1e-10;
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(){x=0;y=0;}
P(double x,double y):x(x),y(y){}
P operator +(P p){
return P(add(x,p.x),add(y,p.y));
}
bool operator ==(P p){
return p.x==x&&p.y==y;
}
P operator -(P p){
return P(add(x,-p.x),add(y,-p.y));
}
double det(P p){
return add(x*p.y,-y*p.x);
}
};
P table[1000];
double edge[101][101];
bool cmp_x(const P& p,const P& q){
if(p.x!=q.x)return p.x<q.x;
return p.y<q.y;
}
double dist(P p,P q){
return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
}
vector<P> convex_hull(P* pps,int n){
//sort(ps,ps+n,cmp_x);
P ps[1000];
for(int i=0;i<n;i++)ps[i]=pps[i];
int k=0;
vector<P>qs(n*2);
sort(ps,ps+n,cmp_x);
for(int i=0;i<n;i++){
while(true){
if(k<=1)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
for(int i=n-2,t=k;i>=0;i--){
while(true){
if(k<=t)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
qs.resize(k-1);
return qs;
}
bool used[1000];
int main(){
cin>>V>>R;
for(int i=0;i<V;i++){
cin>>table[i].x>>table[i].y;
}
for(int i=0;i<R;i++){
int a,b;
cin>>a>>b;
edge[a-1][b-1]=dist(P(table[a-1]),P(table[b-1]));
edge[b-1][a-1]=dist(P(table[a-1]),P(table[b-1]));
}
vector<P>a;
a=convex_hull(table,V);
//sort(table,table+V,cmp_x);
for(int i=0;i<V;i++){
for(int j=0;j<a.size();j++){
if(table[i].x==a[j].x&&table[i].y==a[j].y){
//cout<<a[j].x<<" "<<a[j].y<<" "<<i<<endl;
used[i]=1;
}
}
}
for(int i=0;i<V;i++){
for(int j=0;j<V;j++){
if(used[i]&&used[j]){
edge[i][j]=dist(table[i],table[j]);
edge[j][i]=dist(table[i],table[j]);
}
}
}
//for(int i=0;i<V;i++)cout<<used[i]<<" "<<table[i].x<<" "<<table[i].y<<endl;
//for(int i=0;i<a.size();i++)cout<<a[i].x<<" "<<a[i].y<<" "<<"A"<<endl;
double ans=0;
for(int i=1;i<a.size();i++)ans+=dist(a[i],a[i-1]);
ans+=dist(a[0],a[a.size()-1]);
//cout<<ans<<endl;
// for(int i=0;i<V;i++){
// for(int j=0;j<V;j++)cout<<edge[i][j]<<" ";
// cout<<endl;
// }
const int INF=100000;
for(int i=0;i<V;i++){
double min=INF;
int num=0;
if(used[i])continue;
for(int j=0;j<V;j++){
if(edge[i][j]<=EPS)continue;
//?????????????????????????????¨???
if(min>edge[i][j]&&used[j]){
min=edge[i][j];
num=j;
}
}
//cout<<i<<" "<<table[i].x<<" "<<table[i].y<<" "<<table[num].x<<" "<<table[num].y<<" "<<min<<endl;
if(min==INF)continue;
ans+=min;
used[num]=true;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'double dist(P, P)':
a.cc:45:16: error: 'sqrt' was not declared in this scope
45 | return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
| ^~~~
|
s161414333 | p00337 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
int V,R;
double EPS=1e-10;
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(){x=0;y=0;}
P(double x,double y):x(x),y(y){}
P operator +(P p){
return P(add(x,p.x),add(y,p.y));
}
bool operator ==(P p){
return p.x==x&&p.y==y;
}
P operator -(P p){
return P(add(x,-p.x),add(y,-p.y));
}
double det(P p){
return add(x*p.y,-y*p.x);
}
};
P table[1000];
double edge[101][101];
bool cmp_x(const P& p,const P& q){
if(p.x!=q.x)return p.x<q.x;
return p.y<q.y;
}
double dist(P p,P q){
return sqrt((p.x-q.x)*(p.x-q.x)+(p.y-q.y)*(p.y-q.y));
}
vector<P> convex_hull(P* pps,int n){
//sort(ps,ps+n,cmp_x);
P ps[1000];
for(int i=0;i<n;i++)ps[i]=pps[i];
int k=0;
vector<P>qs(n*2);
sort(ps,ps+n,cmp_x);
for(int i=0;i<n;i++){
while(true){
if(k<=1)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
for(int i=n-2,t=k;i>=0;i--){
while(true){
if(k<=t)break;
if((qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])>0)break;
k--;
}
qs[k++]=ps[i];
}
qs.resize(k-1);
return qs;
}
bool used[1000];
int main(){
cin>>V>>R;
for(int i=0;i<V;i++){
cin>>table[i].x>>table[i].y;
}
for(int i=0;i<V;i++)for(int j=0;j<V;j++)edge[i][j]=edge[j][i]=INF;
for(int i=0;i<R;i++){
int a,b;
cin>>a>>b;
edge[a-1][b-1]=dist(P(table[a-1]),P(table[b-1]));
edge[b-1][a-1]=dist(P(table[a-1]),P(table[b-1]));
}
vector<P>a;
a=convex_hull(table,V);
//sort(table,table+V,cmp_x);
for(int i=0;i<V;i++){
for(int j=0;j<a.size();j++){
if(table[i].x==a[j].x&&table[i].y==a[j].y){
//cout<<a[j].x<<" "<<a[j].y<<" "<<i<<endl;
used[i]=1;
}
}
}
for(int i=0;i<V;i++){
for(int j=0;j<V;j++){
if(used[i]&&used[j]){
edge[i][j]=dist(table[i],table[j]);
edge[j][i]=dist(table[i],table[j]);
}
}
}
//for(int i=0;i<V;i++)cout<<used[i]<<" "<<table[i].x<<" "<<table[i].y<<endl;
//for(int i=0;i<a.size();i++)cout<<a[i].x<<" "<<a[i].y<<" "<<"A"<<endl;
double ans=0;
for(int i=1;i<a.size();i++)ans+=dist(a[i],a[i-1]);
ans+=dist(a[0],a[a.size()-1]);
const int INF=100000;
for(int i=0;i<V;i++){
double min=INF;
int num=0;
if(used[i])continue;
for(int j=0;j<V;j++){
//?????????????????????????????¨???
if(min>edge[i][j]&&used[j]){
min=edge[i][j];
num=j;
}
}
if(min==INF)continue;
ans+=min;
used[num]=true;
}
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:94:71: error: 'INF' was not declared in this scope
94 | for(int i=0;i<V;i++)for(int j=0;j<V;j++)edge[i][j]=edge[j][i]=INF;
| ^~~
|
s426792736 | p00337 | C++ | #include <bits/stdc++.h>
using namespace std;
double EPS=1e-10;
double add(double a,double b) {
if(abs(a+b)<EPS*(abs(a)+abs(b))) return 0;
return a+b;
}
typedef pair<int,int> PI;
typedef pair<double,PI> E;
struct P {
double x,y;
P() {}
P(double x,double y):x(x),y(y) {}
P operator+(P p) const{
return P(add(x,p.x),add(y,p.y));
}
P operator-(const P p) const {
return P(add(x,-p.x),add(y,-p.y));
}
P operator*(double d) const{
return P(x*d,y*d);
}
double dot(const P p) const{
return add(x*p.x,y*p.y);
}
double det(const P p) const{
return add(x*p.y,-y*p.x);
}
};
bool cmp_x(const P& p,const P& q) {
if(p.x!=q.x) return p.x<q.x;
return p.y<q.y;
}
vector<P> convex_hull(P* ps,int n) {
sort(ps,ps+n,cmp_x);
int k=0;
vector<P> qs(n*2);
for(int i=0;i<n;i++) {
while(k>1 && (qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0) k--;
qs[k++]=ps[i];
}
for(int i=n-2,t=k;i>=0;i--) {
while(k>t && (qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0) k--;
qs[k++]=ps[i];
}
qs.resize(k-1);
return qs;
}
double dist(P p,P q) {
return sqrt((p-q).dot(p-q));
}
int par[100];
int rank[100];
void init(int n) {
for(int i=0;i<n;i++) {
par[i]=i;
rank[i]=0;
}
}
int find(int x) {
if(par[x]==x) {
return x;
}else {
return par[x]=find(par[x]);
}
}
void unite(int x,int y) {
x=find(x);
y=find(y);
if(x==y) return;
if(rank[x]<rank[y]) {
par[x]=y;
}else {
par[y]=x;
if(rank[x]==rank[y]) rank[x]++;
}
}
bool same(int x,int y) {
return find(x)==find(y);
}
map<PI,int> idx;
int main() {
int V,R;
scanf("%d %d",&V,&R);
P ps[100],tmp_ps[100];
for(int i=0;i<V;i++) {
int x,y;
scanf("%d %d",&x,&y);
tmp_ps[i]=ps[i]=P(x,y);
idx[PI(x,y)]=i;
}
vector<P> conv=convex_hull(tmp_ps,V);
conv.push_back(conv[0]);
init(V);
double ans=0;
for(int i=1;i<conv.size();i++) {
ans+=dist(conv[i-1],conv[i]);
unite(idx[PI(conv[i-1].x,conv[i-1].y)],idx[PI(conv[i].x,conv[i].y)]);
}
E road[1000];
for(int i=0;i<R;i++) {
int s,t;
scanf("%d %d",&s,&t);s--;t--;
road[i]=E(dist(ps[s],ps[t]),PI(s,t));
}
sort(road,road+R);
for(int i=0;i<R;i++) {
double d=road[i].first;
int s=road[i].second.first;
int t=road[i].second.second;
if(same(s,t)) continue;
unite(s,t);
ans+=d;
}
printf("%.15lf\n",ans);
}
| a.cc: In function 'void init(int)':
a.cc:57:17: error: reference to 'rank' is ambiguous
57 | rank[i]=0;
| ^~~~
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/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
a.cc: In function 'void unite(int, int)':
a.cc:71:12: error: reference to 'rank' is ambiguous
71 | if(rank[x]<rank[y]) {
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
a.cc:71:20: error: reference to 'rank' is ambiguous
71 | if(rank[x]<rank[y]) {
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
a.cc:75:20: error: reference to 'rank' is ambiguous
75 | if(rank[x]==rank[y]) rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
a.cc:75:29: error: reference to 'rank' is ambiguous
75 | if(rank[x]==rank[y]) rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
a.cc:75:38: error: reference to 'rank' is ambiguous
75 | if(rank[x]==rank[y]) rank[x]++;
| ^~~~
/usr/include/c++/14/type_traits:1437:12: note: candidates are: 'template<class> struct std::rank'
1437 | struct rank
| ^~~~
a.cc:53:5: note: 'int rank [100]'
53 | int rank[100];
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.