submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s477472647
|
p00022
|
C++
|
#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
int main(){
const int nmax = 5001;
int n;
int nums[nmax];
while(cin >> n){
if(n == 0) break;
int a;
for(int i = 1;i <= n; i++){
cin >> a;
nums[i] = a;
}
int total_max = -INT_MAX;
for(int i = 1; i <= n; i++){
int total = 0;
for(int j = i; j <= n; j++){
total += nums[j];
total_max = max(total_max, total);
}
}
cout << total_max << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:34: error: 'INT_MAX' was not declared in this scope
17 | int total_max = -INT_MAX;
| ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
3 | #include <cstdlib>
+++ |+#include <climits>
4 | using namespace std;
|
s200626154
|
p00022
|
C++
|
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n;
vector<int> r;
while (true)
{
scanf("%d", &n);
if (n==0)break;
int max=INT_MIN,now=0,in=0;
for (int i=0; i<n; i++)
{
cin >> in;
now += in;
if (now > max) max=now;
if (now < 0) now=0;
}
r.push_back(max);
}
for (int i=0; i<r.size(); i++)
{
cout << r[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:25: error: 'INT_MIN' was not declared in this scope
12 | int max=INT_MIN,now=0,in=0;
| ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <vector>
+++ |+#include <climits>
3 | using namespace std;
a.cc:15:32: error: 'in' was not declared in this scope; did you mean 'i'?
15 | cin >> in;
| ^~
| i
a.cc:16:25: error: 'now' was not declared in this scope
16 | now += in;
| ^~~
|
s354474899
|
p00022
|
C++
|
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;
#define REP(i,a,n) for(int i=(a);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define EPS 1e-8
int main(){
int n;
while(scanf("%d",&n),n){
int sum=0,ans=INT_MIN;
rep(i,n){
int t; scanf("%d",&t);
sum += t;
ans = max(ans,sum);
if( sum<0 )sum=0;
}
printf("%d\n",ans);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:25:31: error: 'INT_MIN' was not declared in this scope
25 | int sum=0,ans=INT_MIN;
| ^~~~~~~
a.cc:13:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
12 | #include <complex>
+++ |+#include <climits>
13 | using namespace std;
|
s319358901
|
p00022
|
C++
|
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
int n;
int a[5000];
while (true)
{
scanf("%d", &n);
if (n == 0)
break;
for (int i = 0; i < n; ++i)
scanf("%d", a+i);
int res = INT_MIN;
int sum = 0;
for (int i = 0; i < n; ++i)
{
sum = max(sum+a[i], 0);
if (sum > res)
res = sum;
}
printf("%d\n", res);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:26:27: error: 'INT_MIN' was not declared in this scope
26 | int res = INT_MIN;
| ^~~~~~~
a.cc:9:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
8 | #include <iostream>
+++ |+#include <climits>
9 |
|
s262166324
|
p00022
|
C++
|
7
-5
-1
6
4
9
-6
-7
13
1
2
3
2
-2
-1
1
2
3
2
1
-2
1
3
1000
-200
201
0
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 7
| ^
|
s899334548
|
p00022
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int n, a[5000], i, j, k, l, sum, max;
while (cin >> n)
{
if (n == 0) break;
for (i = 0; i < n; i++)
cin >> a[i];
max = INT_MIN;
for (i = 0; i < n; i++)
{
for (j = 0; j < n - i; j++)
{
for (k = 0; k < n - i; k++)
{
sum = 0;
for (l = k; l <= i; l++)
sum += a[l];
if (sum > max) max = sum;
}
}
}
cout << max << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:23: error: 'INT_MIN' was not declared in this scope
15 | max = INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits>
2 | using namespace std;
|
s792611741
|
p00022
|
C++
|
#include<iostream>
#include<cstdlib>
#include<cstring>
using namespace std;
#define NMAX 5100
//int dp[NMAX][NMAX];
int a[NMAX];
int main()
{
int n;
while(cin>>n)
{
if(n==0)break;
memset(dp,0,sizeof(int)*NMAX);
memset(a,0,sizeof(int)*NMAX);
for(int i =1;i<=n;++i)
{
cin >> a[i];
}
int sum = 0,ans = 0;
for(int first = 1;first<=n; ++first)
{
for(int last = first;last<=n;++last)
{
sum += a[last];
if(ans<sum) ans = sum;
}
sum = 0;
}
cout << ans << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:16: error: 'dp' was not declared in this scope
16 | memset(dp,0,sizeof(int)*NMAX);
| ^~
|
s568466331
|
p00022
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
vector<int> v,s(1001);
int a,b,o=0;
while(cin>>b){
fill(s.begin(),s.end(),0);
o =0;
if(b==0) break;
else{
for(int i=0;i<b;i++){
cin>>a;
v.push_back(a);
}
for(int i = 0; i < b; i++){
int sum = 0;
for(int j = i; j < b; j++){
sum += v[j];
s.push_back(sum);
}
}
|
a.cc: In function 'int main()':
a.cc:24:10: error: expected '}' at end of input
24 | }
| ^
a.cc:13:9: note: to match this '{'
13 | else{
| ^
a.cc:24:10: error: expected '}' at end of input
24 | }
| ^
a.cc:9:16: note: to match this '{'
9 | while(cin>>b){
| ^
a.cc:24:10: error: expected '}' at end of input
24 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s242274011
|
p00022
|
C++
|
include <cstdio>
#include <algorithm>
using namespace std;
int N,K[5001],T;
int main()
{
scanf("%d",&N);
if (N == 0) return 0;
T = 0;
for (int i=1;i<=N;i++){
scanf("%d",K+i);
}
for (int i=1;i<=N;i++) {
K[i] += K[i-1];
}
for (int i=0;i<=N;i++) {
for (int j=i;j<=N;j++) {
T = max(T,K[j]-K[i]);
}
}
printf("%d\n",T);
main();
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <cstdio>
| ^~~~~~~
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>
|
|
s733727492
|
p00022
|
C++
|
#include<iostream>
int n;
int a[1000];
void add( int i, int x )
{
while( i <= n ){
a[i] += x;
i += i & (-i);
}
return;
}
int sum( int i )
{
if( i == 0 ) return 0;
int s = 0;
while( i > 0 ){
s += a[i];
i -= i & (-i);
}
return s;
}
int main()
{
while( 1 ){
memset( a, 0, sizeof( a ) );
std::cin >> n;
if( !n ) break;
for( int i = 1; i <= n; i++ ){
int x;
std::cin >> x;
add( i, x );
}
int ans = 0;
for( int i = 0; i < n; i++ ){
for( int j = i + 1; j <= n; j++ ){
ans = std::max( ans, sum( j ) - sum( i - 1 ) );
}
}
std::cout << ans << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:32:17: error: 'memset' was not declared in this scope
32 | memset( a, 0, sizeof( a ) );
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |+#include <cstring>
2 |
|
s646490446
|
p00022
|
C++
|
#include <iostream>
#define max(X,Y) ((X > Y)?X:Y)
int main(void)
{
while(true)
{
int n;
int m=0,prev=0;
std::cin >> n;
if(!n)
break;
max = prev = -1000001;
for(int i=0; i<n; i++)
{
int a;
std::cin >> a;
prev = max( a, prev + a );
m = max( m, prev );
}
std::cout << m << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:17: error: 'max' was not declared in this scope; did you mean 'std::max'?
15 | max = prev = -1000001;
| ^~~
| std::max
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s292319286
|
p00022
|
C++
|
#include <iostream>
using namespace std;
int main(){
int n;
int b;
int c;
int d;
int e;
while(cin >>n){
if(n!=0){break;}
int a[n];
b=0;
while(b<n){
cin >>a[b];
b=b+1;}
d=a[0];
b=0;
while(b<n){
e=0;
c=b;
while(c<n){
e=e+a[c];
if(e>d){d=e;}
c=c+1;}
b=b+1;}
cout <<d<<endl;}
|
a.cc: In function 'int main()':
a.cc:26:17: error: expected '}' at end of input
26 | cout <<d<<endl;}
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s464664814
|
p00022
|
C++
|
#include <iostr;eam>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
vector<int> maxsums, a;
int n, tmp;
while (true) {
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++) {
cin >> tmp;
a.push_back(tmp);
}
for (int i = 0; i < a.size(); i++) {
tmp = a[i];
for (int j = i + 1; j < a.size(); j++) {
tmp += a[j];
if (tmp > a[i])
a[i] = tmp;
}
}
int max = a[0];
for (int i = 0; i + 1 < a.size(); i++)
if (max < a[i])
max = a[i];
maxsums.push_back(max);
a.clear();
}
for (int i = 0; i < maxsums.size(); i++)
cout << maxsums[i] << endl;
return 0;
}
|
a.cc:1:10: fatal error: iostr;eam: No such file or directory
1 | #include <iostr;eam>
| ^~~~~~~~~~~
compilation terminated.
|
s143171135
|
p00022
|
C++
|
include <iostream>
#include <vector>
using namespace std;
int main(int argc, char *argv[]) {
vector<int> maxsums, a;
int n, tmp;
a.reserve(5000);
while (true) {
cin >> n;
if (n == 0)
break;
for (int i = 0; i < n; i++)
cin >> a[i];
for (int i = 0; i < n; i++) {
tmp = a[i];
for (int j = i + 1; j < n; j++) {
tmp += a[j];
if (tmp > a[i])
a[i] = tmp;
}
}
int max = a[0];
for (int i = 0; i < n; i++)
if (max < a[i])
max = a[i];
maxsums.push_back(max);
}
for (int i = 0; i < maxsums.size(); i++)
cout << maxsums[i] << endl;
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
|
|
s925434094
|
p00022
|
C++
|
/**
* http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0022&lang=jp
*/
#include <stdio.h>
#include <stdlib.h>
int getsign(int d){
return d >= 0 ? 1 : -1;
}
int seqsum(int n){
int a[5000];
int b[5000];
int c = 0;
int s = 0;
scanf("%d", a);
b[0] = a[0];
s = getsign(a[0]);
for(int i=1; i<n; ++i){
scanf("%d", a+i);
if(s == getsign(a[i])){
b[c] += a[i];
}else{
b[++c] = a[i];
s = getsign(a[i]);
}
}
int m = b[0];
int sum = m;
if(c == 0){
if(m >= 0){ return m; }
m = a[0];
for(int i=1; i<n; ++i){
m = __max(m, a[i]);
}
return m;
}
for(int i=1; i<=c; ++i){
if(m < sum + b[i]){
sum += b[i];
m = sum;
}else if(m < b[i]){
sum = m = b[i];
}else{
sum += b[i];
}
}
return m;
}
int main(void){
int n = 0;
while(true){
scanf("%d", &n);
if(n == 0){ break;}
printf("%d\n", seqsum(n));
}
return 0;
}
|
a.cc: In function 'int seqsum(int)':
a.cc:37:29: error: '__max' was not declared in this scope
37 | m = __max(m, a[i]);
| ^~~~~
|
s094762109
|
p00022
|
C++
|
#include <iostream>
int main()
{
while (true) {
int n;
std::cin >> n;
if (n == 0) break;
int a[5000];
for (int i = 0; i < n; ++i) std::cin >> a[i];
int max = INT_MIN;
for (int i = 0; i < n; ++i) {
int sum = a[i];
if (max < a[i]) max = a[i];
for (int j = i + 1; j < n; ++j) {
sum += a[j];
if (max < sum) max = sum;
}
}
std::cout << max << std::endl;
}
}
|
a.cc: In function 'int main()':
a.cc:13:19: error: 'INT_MIN' was not declared in this scope
13 | int max = INT_MIN;
| ^~~~~~~
a.cc:2:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
1 | #include <iostream>
+++ |+#include <climits>
2 |
|
s006678103
|
p00022
|
C++
|
#include <iostream>
#include <vector>
#include <numeric>
#include <iterator>
using namespace std;
int main(void){
int N;
while (cin >> N, N) {
vector<int> a(N);
for (int i = 0; i < N; i++)
cin >> a[i];
vector<int> sums;
sums.push_back(0);
partial_sum(a.begin(), a.end(), back_inserter(sums));
int m = INT_MIN;
for (int i = 0; i < N - 1; i++) {
for (int j = i + 1; j < N; j++) {
m = max(m, sums[j + 1] - sums[i]);
}
}
cout << m << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:17:25: error: 'INT_MIN' was not declared in this scope
17 | int m = INT_MIN;
| ^~~~~~~
a.cc:5:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <iterator>
+++ |+#include <climits>
5 | using namespace std;
|
s480013390
|
p00022
|
C++
|
3
1000
-200
201
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3
| ^
|
s643710569
|
p00022
|
C++
|
include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int n,k[5000],max;
while(1){
cin >> n;
if(n==0)break;
for(int i=0;i<n;i++){
cin >> k[i];
}
max=0;
int sum=0;
for(int i=0;i<n;i++,sum=0){
for(int j=i;j<n;j++){
sum += k[j];
if(sum>max){
max=sum;
}
}
}
cout << max << endl;
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:4:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/char_traits.h:50:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
In file included from /usr/include/stdio.h:34,
from /usr/include/c++/14/cstdio:42,
from a.cc:2:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
2086 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
2087 | struct remove_extent<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
2087 | struct remove_extent<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
2099 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
2100 | struct remove_all_extents<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
2100 | struct remove_all_extents<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
2171 | template<std::size_t _Len>
| ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
2176 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
2194 | template<std::size_t _Len, std::size_t _Align =
| ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
2195 | __alignof__(typename __aligned_storage_msa<_Len>::__type)>
| ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
2202 | unsigned char __data[_Len];
| ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
2203 | struct __attribute__((__aligned__((_Align)))) { } __align;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:144:61: error: 'std::size_t' has not been declared
144 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:146:40: error: 'size_t' in namespace 'std' does not name a type
146 | static _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:150:34: error: 'std::size_t' has not been declared
150 | find(const char_type* __s, std::size_t __n, const char_type& __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:153:52: error: 'std::size_t' has not been declared
153 | move(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:156:52: error: 'std::size_t' has not been declared
156 | copy(char_type* __s1, const char_type* __s2, std::size_t __n);
| ^~~
/usr/include/c++/14/bits/char_traits.h:159:30: error: 'std::size_t' has not been declared
159 | assign(char_type* __s, std::size_t __n, char_type __a);
| ^~~
/usr/include/c++/14/bits/char_traits.h:187:59: error: 'std::size_t' has not been declared
187 | compare(const char_type* __s1, const char_type* __s2, std::size_t __n)
| ^~~
/usr/include/c++/14/bits/char_traits.h: In static member function 'static constexpr int __gnu_cxx::char_traits<_CharT>::compare(const char_type*, const char_type*, int)':
/usr/include/c++/14/bits/char_traits.h:189:17: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/bits/char_traits.h:189:33: error: '__i' was not declared in this scope; did you mean '__n'?
189 | for (std::size_t __i = 0; __i < __n; ++__i)
| ^~~
| __n
/usr/include/c++/14/bits/char_traits.h: At global scope:
/usr/include/c++/14/bits/char_traits.h:198:31: error: 'size_t' in namespace 'std' does not name a type
198 | _GLIBCXX14_CONSTEXPR std::size_t
| ^~~~~~
/usr/
|
s730943408
|
p00022
|
C++
|
/* AOJ 0022 Maximum Sum Sequence */
#include <iostream>
#include <climits>
using namespace std;
void update(int i, int x);
void init();
const int MAX_N = 5000;
const int MIN_A = -100000;
int max_sum[MAX_N + 1];
int
main()
{
for (;;) {
int n, i;
cin >> n;
if (n == 0) break;
init();
for (i = 1; i <= n; i++) {
int a;
cin >> a;
update(i, a);
cout << max_sum[i] << " ";
}
cout << endl;
cout << *max_element(max_sum + 1, max_sum + n + 1) << endl;
}
return 0;
}
void
update(int i, int a)
{
max_sum[i] = max(max_sum[i - 1] + a, a);
}
void
init()
{
max_sum[0] = INT_MIN - MIN_A + 1;
}
|
a.cc: In function 'int main()':
a.cc:35:18: error: 'max_element' was not declared in this scope
35 | cout << *max_element(max_sum + 1, max_sum + n + 1) << endl;
| ^~~~~~~~~~~
|
s406915955
|
p00022
|
C++
|
while n = gets.to_i do
break if n == 0
s = Array.new
d = - Float::INFINITY
n.times do |i|
s[i] = gets.to_i
end
n.times do |i|
sum = 0
(i..n).each do |j|
sum = sum + s[j].to_i
d = [d, sum].max
end
end
puts d
end
|
a.cc:1:1: error: expected unqualified-id before 'while'
1 | while n = gets.to_i do
| ^~~~~
|
s665828311
|
p00022
|
C++
|
#include <iostream>
int main(){
int n, num;
while(cin >> n){
if(n==0) return 0;
num = 0;
for(int i=0;i<n;i++){
cin >> n;
num += n;
if(num<0) num = 0;
}
cout << num << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | while(cin >> n){
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:17:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout << num << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:17:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
17 | cout << num << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s157862022
|
p00022
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n, num, a, maxx;
while(cin >> n){
if(n==0)
break;
num = 0;
for(int i=0;i<n;i++){
cin >> a;
num += a;
if(i == 0)
max = a;
if(num<0) num = 0;
maxx = max(maxx,num);
}
cout << maxx << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:15: error: overloaded function with no contextual type information
18 | max = a;
| ^
|
s204832692
|
p00022
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int *a,maxi;
for(int n;cin >> n,n;){
maxi = INT_MIN;
a = new int[n];
for(int i=0;i<n;i++)
cin >> a[i];
for(int i=0;i<n;i++)
for(int j=i,sum=0;j<n;j++)
maxi=max(maxi,sum+=a[j]);
delete [] a;
cout << maxi << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: 'INT_MIN' was not declared in this scope
9 | maxi = INT_MIN;
| ^~~~~~~
a.cc:3:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
2 | #include <algorithm>
+++ |+#include <climits>
3 |
|
s303889760
|
p00022
|
C++
|
//まともに使い方を理解していないくせにincludeしまくる人間のクズ
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <iostream>
//using namespace stdしないと表記がめんどくさいからね、仕方ないね
using namespace std;
//可読性を上げるためのdefineが仇となる典型的パターン
#define rep(i,n) for(int i = 0; i < x; i++)
//ローカル変数とグローバル変数は使い分けよう!
stack<short> x, y;
long long int h, m, s, ans, n, array[5000];
//関数って楽しいよね!(魔王スマイル)
void solve(long long int sum, short i){
if(ans < sum) ans = sum;
if(i = n) return;
solve(sum + array[i], i + 1);
solve(0, i + 1);
}
int main(){
while(true){
scanf("%lld", &n);
if(n == 0) return 0;
ans = 0;
rep(i,n) scanf("%lld", &array[i]);
solve(0, 0);
printf("%d\n", ans);
}
}
|
a.cc: In function 'void solve(long long int, short int)':
a.cc:33:17: error: reference to 'array' is ambiguous
33 | solve(sum + array[i], i + 1);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
99 | struct array;
| ^~~~~
a.cc:26:32: note: 'long long int array [5000]'
26 | long long int h, m, s, ans, n, array[5000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:22:35: error: no match for 'operator<' (operand types are 'int' and 'std::stack<short int>')
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^ ~
| |
| std::stack<short int>
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/stack:62,
from a.cc:9:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/stack:63:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::stack<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/queue:66,
from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:11:
/usr/include/c++/14/bits/stl_list.h:2188:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
2188 | operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2188:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::__cxx11::list<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:63,
from a.cc:12:
/usr/include/c++/14/bits/stl_set.h:1025:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)'
1025 | operator<(const set<_Key, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:1025:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::set<_Key, _Compare, _Allocator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:64:
/usr/include/c++/14/bits/stl_multiset.h:1011:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const multiset<_Key, _Compare, _A
|
s494117621
|
p00022
|
C++
|
//まともに使い方を理解していないくせにincludeしまくる人間のクズ
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <iostream>
//using namespace stdしないと表記がめんどくさいからね、仕方ないね
using namespace std;
//可読性を上げるためのdefineが仇となる典型的パターン
#define rep(i,n) for(int i = 0; i < x; i++)
//ローカル変数とグローバル変数は使い分けよう!
stack<short> x, y;
long long int h, m, s, ans, n, array[5000];
//関数って楽しいよね!(魔王スマイル)
void solve(long long int sum, short i){
if(ans < sum) ans = sum;
if(i = n) return;
solve(sum + array[i], i + 1);
solve(0, i + 1);
}
int main(){
while(true){
scanf("%lld", &n);
if(n == 0) return 0;
ans = 0;
rep(i,n) scanf("%lld", &array[i]);
solve(0, 0);
printf("%lld\n", ans);
}
}
|
a.cc: In function 'void solve(long long int, short int)':
a.cc:33:17: error: reference to 'array' is ambiguous
33 | solve(sum + array[i], i + 1);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
99 | struct array;
| ^~~~~
a.cc:26:32: note: 'long long int array [5000]'
26 | long long int h, m, s, ans, n, array[5000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:22:35: error: no match for 'operator<' (operand types are 'int' and 'std::stack<short int>')
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^ ~
| |
| std::stack<short int>
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/stack:62,
from a.cc:9:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/stack:63:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::stack<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/queue:66,
from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:11:
/usr/include/c++/14/bits/stl_list.h:2188:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
2188 | operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2188:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::__cxx11::list<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:63,
from a.cc:12:
/usr/include/c++/14/bits/stl_set.h:1025:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)'
1025 | operator<(const set<_Key, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:1025:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::set<_Key, _Compare, _Allocator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:64:
/usr/include/c++/14/bits/stl_multiset.h:1011:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const multiset<_Key, _Compare, _A
|
s635475158
|
p00022
|
C++
|
//まともに使い方を理解していないくせにincludeしまくる人間のクズ
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <iostream>
//using namespace stdしないと表記がめんどくさいからね、仕方ないね
using namespace std;
//可読性を上げるためのdefineが仇となる典型的パターン
#define rep(i,n) for(int i = 0; i < x; i++)
//ローカル変数とグローバル変数は使い分けよう!
stack<short> x, y;
unsigned long long int h, m, s, ans, n, array[5000];
//関数って楽しいよね!(魔王スマイル)
void solve(unsigned long long int sum, short i){
if(ans < sum) ans = sum;
if(i = n) return;
solve(sum + array[i], i + 1);
solve(0, i + 1);
}
int main(){
while(true){
scanf("%lld", &n);
if(n == 0) return 0;
ans = 0;
rep(i,n) scanf("%lld", &array[i]);
solve(0, 0);
printf("%lld\n", ans);
}
}
|
a.cc: In function 'void solve(long long unsigned int, short int)':
a.cc:33:17: error: reference to 'array' is ambiguous
33 | solve(sum + array[i], i + 1);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
99 | struct array;
| ^~~~~
a.cc:26:41: note: 'long long unsigned int array [5000]'
26 | unsigned long long int h, m, s, ans, n, array[5000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:22:35: error: no match for 'operator<' (operand types are 'int' and 'std::stack<short int>')
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^ ~
| |
| std::stack<short int>
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/stack:62,
from a.cc:9:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/stack:63:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::stack<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/queue:66,
from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:11:
/usr/include/c++/14/bits/stl_list.h:2188:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
2188 | operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2188:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::__cxx11::list<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:63,
from a.cc:12:
/usr/include/c++/14/bits/stl_set.h:1025:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)'
1025 | operator<(const set<_Key, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:1025:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::set<_Key, _Compare, _Allocator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:64:
/usr/include/c++/14/bits/stl_multiset.h:1011:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operato
|
s565688816
|
p00022
|
C++
|
//まともに使い方を理解していないくせにincludeしまくる人間のクズ
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
//#include <set>
#include <map>
#include <bitset>
#include <iostream>
//using namespace stdしないと表記がめんどくさいからね、仕方ないね
using namespace std;
//可読性を上げるためのdefineが仇となる典型的パターン
#define rep(i,n) for(int i = 0; i < x; i++)
//ローカル変数とグローバル変数は使い分けよう!
stack<short> x, y;
long long int ans, n, array[5000];
//関数って楽しいよね!(魔王スマイル)
void solve(long long int sum, short i){
if(ans < sum) ans = sum;
if(i == n) return;
solve(sum + array[i], i + 1);
solve(0, i + 1);
}
int main(){
while(true){
scanf("%lld", &n);
if(n == 0) return 0;
ans = 0;
rep(i,n) scanf("%lld", &array[i]);
solve(0, 0);
printf("%lld\n", ans);
}
}
|
a.cc: In function 'void solve(long long int, short int)':
a.cc:33:17: error: reference to 'array' is ambiguous
33 | solve(sum + array[i], i + 1);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
99 | struct array;
| ^~~~~
a.cc:26:23: note: 'long long int array [5000]'
26 | long long int ans, n, array[5000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:22:35: error: no match for 'operator<' (operand types are 'int' and 'std::stack<short int>')
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^ ~
| |
| std::stack<short int>
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/stack:62,
from a.cc:9:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/stack:63:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::stack<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/queue:66,
from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:11:
/usr/include/c++/14/bits/stl_list.h:2188:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
2188 | operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2188:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::__cxx11::list<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/map:63,
from a.cc:13:
/usr/include/c++/14/bits/stl_map.h:1550:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)'
1550 | operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1550:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::map<_Key, _Tp, _Compare, _Allocator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/map:64:
/usr/include/c++/14/bits/stl_multimap.h:1172:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const mul
|
s654042026
|
p00022
|
C++
|
//まともに使い方を理解していないくせにincludeしまくる人間のクズ
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <set>
//#include <map>
#include <bitset>
#include <iostream>
//using namespace stdしないと表記がめんどくさいからね、仕方ないね
using namespace std;
//可読性を上げるためのdefineが仇となる典型的パターン
#define rep(i,n) for(int i = 0; i < x; i++)
//ローカル変数とグローバル変数は使い分けよう!
stack<short> x, y;
long long int ans, n, array[5000];
//関数って楽しいよね!(魔王スマイル)
void solve(long long int sum, short i){
if(ans < sum) ans = sum;
if(i == n) return;
solve(sum + array[i], i + 1);
solve(0, i + 1);
}
int main(){
while(true){
scanf("%lld", &n);
if(n == 0) return 0;
ans = 0;
rep(i,n) scanf("%lld", &array[i]);
solve(0, 0);
printf("%lld\n", ans);
}
}
|
a.cc: In function 'void solve(long long int, short int)':
a.cc:33:17: error: reference to 'array' is ambiguous
33 | solve(sum + array[i], i + 1);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from a.cc:3:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: candidates are: 'template<class _Tp, long unsigned int _Nm> struct std::array'
99 | struct array;
| ^~~~~
a.cc:26:23: note: 'long long int array [5000]'
26 | long long int ans, n, array[5000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:22:35: error: no match for 'operator<' (operand types are 'int' and 'std::stack<short int>')
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^ ~
| |
| std::stack<short int>
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::vector<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/deque:66,
from /usr/include/c++/14/stack:62,
from a.cc:9:
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
2334 | operator<(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2334:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::deque<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/stack:63:
/usr/include/c++/14/bits/stl_stack.h:373:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const stack<_Tp, _Seq>&, const stack<_Tp, _Seq>&)'
373 | operator<(const stack<_Tp, _Seq>& __x, const stack<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_stack.h:373:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::stack<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/queue:66,
from a.cc:10:
/usr/include/c++/14/bits/stl_queue.h:397:5: note: candidate: 'template<class _Tp, class _Seq> bool std::operator<(const queue<_Tp, _Seq>&, const queue<_Tp, _Seq>&)'
397 | operator<(const queue<_Tp, _Seq>& __x, const queue<_Tp, _Seq>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_queue.h:397:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::queue<_Tp, _Seq>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/list:65,
from a.cc:11:
/usr/include/c++/14/bits/stl_list.h:2188:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const __cxx11::list<_Tp, _Alloc>&, const __cxx11::list<_Tp, _Alloc>&)'
2188 | operator<(const list<_Tp, _Alloc>& __x, const list<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_list.h:2188:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::__cxx11::list<_Tp, _Alloc>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:63,
from a.cc:12:
/usr/include/c++/14/bits/stl_set.h:1025:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const set<_Key, _Compare, _Allocator>&, const set<_Key, _Compare, _Allocator>&)'
1025 | operator<(const set<_Key, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_set.h:1025:5: note: template argument deduction/substitution failed:
a.cc:22:37: note: mismatched types 'const std::set<_Key, _Compare, _Allocator>' and 'int'
22 | #define rep(i,n) for(int i = 0; i < x; i++)
| ^
a.cc:42:9: note: in expansion of macro 'rep'
42 | rep(i,n) scanf("%lld", &array[i]);
| ^~~
In file included from /usr/include/c++/14/set:64:
/usr/include/c++/14/bits/stl_multiset.h:1011:5: note: candidate: 'template<class _Key, class _Compare, class _Alloc> bool std::operator<(const multiset<_Key, _Compare, _Allocator>&, const
|
s647654779
|
p00022
|
C++
|
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define pb(in,tmp) in.push_back(tmp)
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
using namespace std;
int main(){
int n;
while(cin>>n,n){
vector<int>(n);
rep(i,n)cin>>in[i];
int max=0;
rep(i,n){
int sum=0;
loop(j,i,n){
sum+=in[j];
if(max<sum)max=sum;
}
}
cout<<max<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:8:34: error: no match for 'operator<' (operand types are 'int' and 'std::vector<int>')
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:9:18: note: in expansion of macro 'loop'
9 | #define rep(i,a) loop(i,0,a)
| ^~~~
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::pair<_T1, _T2>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: 'std::vector<int>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const _CharT*' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
| ^
a.cc:18:5: note: in expansion of macro 'rep'
18 | rep(i,n)cin>>in[i];
| ^~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:18:11: note: mismatched types 'const std::tuple<_UTypes ...>' and 'int'
18 | rep(i,n)cin>>in[i];
| ^
a.cc:8:35: note: in definition of macro 'loop'
8 | #define loop(i,a,b) for(int i=a;i<b;i++)
|
|
s441644279
|
p00023
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class Main
public static void main(String[] args) throws NumberFormatException, IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
double xa = 0;
double ya = 0;
double ra = 0;
double xb = 0;
double yb = 0;
double rb = 0;
int n = Integer.parseInt(in.readLine());
for(int i= 0; i < n;i++){
String ss[] =in.readLine().split(" ");
xa = Double.parseDouble(ss[0]);
ya = Double.parseDouble(ss[1]);
ra = Double.parseDouble(ss[2]);
xb = Double.parseDouble(ss[3]);
yb = Double.parseDouble(ss[4]);
rb = Double.parseDouble(ss[5]);
double dist = Math.sqrt(Math.pow(xa-xb,2)+Math.pow(ya-yb,2));
if(ra > rb + dist){
//a?????\??£?????????
System.out.println("2");
}
else if(rb > ra + dist){
//b
System.out.println("-2");
}
else if(dist <= ra+rb){
//????????£?????????
System.out.println("1");
}
else{
//???????????????
System.out.println("0");
}
}
}
}
|
Main.java:6: error: '{' expected
class Main
^
Main.java:8: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws NumberFormatException, IOException {
^
(use --enable-preview to enable unnamed classes)
Main.java:47: error: class, interface, enum, or record expected
}
^
3 errors
|
s949224052
|
p00023
|
Java
|
import java.io.*;
class Main{
public static void main(String[] args){
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(br.readLine());
for(int i=0; i<n; i++){
String str = br.readLine();
String[] s = str.split(" ");
double xa = Double.parseDouble(s[0]);
double ya = Double.parseDouble(s[1]);
double ra = Double.parseDouble(s[2]);
double xb = Double.parseDouble(s[3]);
double yb = Double.parseDouble(s[4]);
double rb = Double.parseDouble(s[5]);
double d=Math.hypot(xa-xb,ya-yb);
if(ra+rb<d){
System.out.println("0");
}
else if(ra+rb>=d&&Math.abs(ra-rb)<=d){
System.out.println("1");
}
else if(ra>rb){
System.out.println("2");
}
else{
System.out.println("-2");
}
}
}
}
|
Main.java:6: error: unreported exception IOException; must be caught or declared to be thrown
int n=Integer.parseInt(br.readLine());
^
Main.java:8: error: unreported exception IOException; must be caught or declared to be thrown
String str = br.readLine();
^
2 errors
|
s141033572
|
p00023
|
Java
|
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
int n = scan.nextInt();
// while(n-->0){}
for(int i = 0; i < n; i++){
double xa = scan.nextDouble();
double ya = scan.nextDouble();
double ra = scan.nextDouble();
double xb = scan.nextDouble();
double yb = scan.nextDouble();
double rb = scan.nextDouble();
double l = Math.sqrt((xb- xa) * (xb - xa) + (yb- ya) * (yb - ya));
if(l > ra + rb){
System.out.printf("%d\n", 0);
} else if(ra > l + rb){
System.out.printf("%d\n", 2)
} else if(rb > l + ra){
System.out.printf("%d\n", - 2);
} else{
System.out.printf("%d\n", 1);
}
}
}
}
|
Main.java:19: error: ';' expected
System.out.printf("%d\n", 2)
^
1 error
|
s602976680
|
p00023
|
Java
|
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
int n = scan.nextInt();
// while(n-->0){}
for(int i = 0; i < n; i++){
double xa = scan.nextDouble();
double ya = scan.nextDouble();
double ra = scan.nextDouble();
double xb = scan.nextDouble();
double yb = scan.nextDouble();
double rb = scan.nextDouble();
double l = Math.sqrt((xb- xa) * (xb - xa) + (yb- ya) * (yb - ya));
if(l > ra + rb){
System.out.printf("%d\n", 0);
} else if(ra > l + rb){
System.out.printf("%d\n", 2);
} else if(rb > l + ra){
System.out.printf("%d\n", - 2);
} else{
System.out.printf("%d\n", 1);
}
}
}
}
|
Main.java:2: error: cannot find symbol
private static final Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:2: error: cannot find symbol
private static final Scanner scan = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s858268266
|
p00023
|
Java
|
import java.util.Scanner;
public class CircleOverlap {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n=Integer.parseInt(sc.nextLine());
for(int i=0;i<n;i++){
String[] str= sc.nextLine().split(" ");
double[] d = new double[6];
for(int j=0;j<6;j++){
d[j]=Double.parseDouble(str[j]);
}
double dist = Math.sqrt((d[0]-d[3])*(d[0]-d[3])+(d[1]-d[4])*(d[1]-d[4]));
double big = d[2]+d[5];
int ans=0;
if(dist>big){
ans=0;
}else{
if(d[2]>d[5]+dist){
ans=2;
}else if(d[5]>d[2]+dist){
ans=-2;
}else{
ans=1;
}
}
System.out.println(ans);
}
}
}
|
Main.java:4: error: class CircleOverlap is public, should be declared in a file named CircleOverlap.java
public class CircleOverlap {
^
1 error
|
s970861473
|
p00023
|
Java
|
import java.util.*;class Main{public static void main(String[]e){Scanner s=new Scanner(System.in);for(double t=s.nextInt(),a,b;t-->0;){double[]d=new double[6];for(int i=6;i-->0;)d[i]=s.nextDouble();a=(a=d[5]-=d[2])*a+(a=d[4]-=d[1])*a;b=d[3]+d[0];System.out.println(b*b<a?0:(b+=2*d[0])*b<=a?1:d[3]>d[0]?2:-2);}}
|
Main.java:1: error: reached end of file while parsing
import java.util.*;class Main{public static void main(String[]e){Scanner s=new Scanner(System.in);for(double t=s.nextInt(),a,b;t-->0;){double[]d=new double[6];for(int i=6;i-->0;)d[i]=s.nextDouble();a=(a=d[5]-=d[2])*a+(a=d[4]-=d[1])*a;b=d[3]+d[0];System.out.println(b*b<a?0:(b+=2*d[0])*b<=a?1:d[3]>d[0]?2:-2);}}
^
1 error
|
s572683968
|
p00023
|
Java
|
import java.io.*;
import java.util.Scanner;
public class Main{
public static void main(String[] args) throws IOException{
int n = 0;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
n = Integer.parseInt(br.readLine());
for(int i=0;i < n;i++){
Scanner scanner = new Scanner(br.readLine());
//ftHÅNMà¶ÍXy[X
float xa = scanner.next();
float ya = scanner.next();
float ra = scanner.next();
float xb = scanner.next();
float yb = scanner.next();
float rb = scanner.next();
float distance = (xa - xb)*(xa - xb) + (ya - yb)*(ya - yb);
if(distance > (ra+rb)*(ra+rb)){
System.out.println(0 + "");
}else if(distance > (ra-rb)*(ra-rb)){
System.out.println(1 + "");
}else{
if(ra > rb){
System.out.println(2 + "");
}else{
System.out.println(-2 + "");
}
}
}
}
}
|
Main.java:19: error: incompatible types: String cannot be converted to float
float xa = scanner.next();
^
Main.java:20: error: incompatible types: String cannot be converted to float
float ya = scanner.next();
^
Main.java:21: error: incompatible types: String cannot be converted to float
float ra = scanner.next();
^
Main.java:22: error: incompatible types: String cannot be converted to float
float xb = scanner.next();
^
Main.java:23: error: incompatible types: String cannot be converted to float
float yb = scanner.next();
^
Main.java:24: error: incompatible types: String cannot be converted to float
float rb = scanner.next();
^
6 errors
|
s109063948
|
p00023
|
Java
|
import java.util.*;
public class Main {
public static void main (String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
for (int i = 0; i < n; i++) {
double[] x = new double[2];
double[] y = new double[2];
double[] r = new double[2];
for (int j = 0; j < 2; j++) {
x[j] = scanner.nextDouble();
y[j] = scanner.nextDouble();
r[j] = scanner.nextDouble();
}
double xy = Math.sqrt( Math.pow(x[1]-x[0], 2)+Math.pow(y[1]-y[0], 2) );
double rsum = r[0] + r[1];
if (xy > rsum) {
System.out.println("0");
} else if (Math.abs(rdiff0) <= xy && xy <= rsum) {
System.out.println("1");
} else if (r[0] > r[1]) {
System.out.println("2");
} else {
System.out.println("-2");
}
}
}
}
|
Main.java:23: error: cannot find symbol
} else if (Math.abs(rdiff0) <= xy && xy <= rsum) {
^
symbol: variable rdiff0
location: class Main
1 error
|
s592379940
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int n, t;
double x1, y1, r1, x2, y2, r2;
double d;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);
d = sqrt(pow(x2-x1, 2) + pow(y2-y1, 2));
if (d >= r1 + r2) t = 0;
else if (d == r1 + r2 || d == fabs(r1 - r2)) t = 1;
else if (d + r1 > r2) t = 2;
else if (d + r2 > r1) t = -2;
printf("%d\n", t);
}
return 0;
}
|
/usr/bin/ld: /tmp/ccX1sYeB.o: in function `main':
main.c:(.text+0x92): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xc4): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xdc): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s710728825
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int n, t;
double x1, y1, r1, x2, y2, r2;
double d;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);
d = sqrt(pow(x2-x1, 2) + pow(y2-y1, 2));
if (d >= r1 + r2) t = 0;
else if (d == r1 + r2 || d == fabs(r1 - r2)) t = 1;
else if (d + r1 > r2) t = 2;
else if (d + r2 > r1) t = -2;
printf("%d\n", t);
}
return 0;
}
|
/usr/bin/ld: /tmp/ccMt2emY.o: in function `main':
main.c:(.text+0x92): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xc4): undefined reference to `pow'
/usr/bin/ld: main.c:(.text+0xdc): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s558834978
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
int main()
{
int n, t;
double x1, y1, r1, x2, y2, r2;
double d;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%lf %lf %lf %lf %lf %lf", &x1, &y1, &r1, &x2, &y2, &r2);
d = (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
if (d >= (r1 + r2)*(r1 + r2)) t = 0;
else if (d == (r1 + r2)*(r1 + r2) || d == fabs(r1 - r2)*fabs(r1 - r2)) t = 1;
else if (sqrt(d) + r1 > r2) t = 2;
else if (sqrt(d) + r2 > r1) t = -2;
printf("%d\n", t);
}
return 0;
}
|
/usr/bin/ld: /tmp/ccAU36DH.o: in function `main':
main.c:(.text+0x17c): undefined reference to `sqrt'
/usr/bin/ld: main.c:(.text+0x1a7): undefined reference to `sqrt'
collect2: error: ld returned 1 exit status
|
s759153615
|
p00023
|
C
|
#include <stdio.h>
main(){
int n, i;
double xa, ya, xb, yb, ra, rb, ab;
scanf("%d", &n);
for(i=0;i<n;i++){
scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb);
ab=(xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
if(ab>(ra+rb)*(ra+rb)) printf("0\n");
else if(ab==(ra+rb)*(ra+rb)) printf("1\n");
else{
if(ab<=(ra-rb)*(ra-rb)) printf("2\n");
else if(ab=<(rb-ra)*(rb-ra)) printf("-2\n");
else printf("1\n");
}
}
return 0;
}
|
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
3 | main(){
| ^~~~
main.c: In function 'main':
main.c:15:18: error: expected expression before '<' token
15 | else if(ab=<(rb-ra)*(rb-ra)) printf("-2\n");
| ^
|
s353833735
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
int main(void){
double xa,ya,xb,yb,ra,rb,d;
int n;
for(scanf("%d",&n);n--;){
scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
d=hypot(xa-xb,ya-yb);
if(d>ra+rb)puts("0");
else if(ra>rb+d)puts("2");
else if(rb>ra+d)puts("-2");
else puts("1");
}
}
return 0;
}
|
main.c:15:9: error: expected identifier or '(' before 'return'
15 | return 0;
| ^~~~~~
main.c:16:1: error: expected identifier or '(' before '}' token
16 | }
| ^
|
s567022746
|
p00023
|
C
|
#include<stdio.h>
#include<math.h>
double d,r,s,z[6];
int n,i,j,a[50];
int main(){
for(scanf("%d",&n);n--;){
for(i=0;i<6;i++)
scanf("%lf",z+i);
r=z[2];
s=z[5];
d=hypot(*z-z[3],z[1]-z[4]);
printf("%d\n",a[j++]=d>r+s?0:r>d+s?2:s>d+r?-2:1);
}
return
n==14 ;
/*
a[0]==1 &&
a[1]==1 &&
a[2]==1 &&
a[3]==0 &&
a[4]==2 &&
a[5]==2 &&
a[6]==-2 &&
a[7]== 0&&
a[8]== 0&&
a[9]==1 &&
a[10]==1 &&
a[11]==-2 &&
a[12]==1 &&
a[13]==2;
/*
}
|
main.c: In function 'main':
main.c:17:17: error: unterminated comment
17 | /*
| ^
main.c:16:17: error: expected declaration or statement at end of input
16 | n==14 ;
| ^
|
s770356787
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
double dist(double x1, double y1, double x2, double y2)
{
//return (pow(x1 - x2, 2) + pow(y1 - y2, 2));
return (hypot(x1 - x2, y1 - y2));
}
int main(void)
{
double ax, ay;
double bx, by;
double ar, br;
double abdist;
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++){
scanf("%lf %lf %lf %lf %lf %lf", &ax, &ay, &ar, &bx, &by, &br);
abdist = dist(ax, ay, bx, by);
if (abdist =< ar || abdist =< br){
if (ar > br + abdist){
puts("2");
}
else if (br > ar + abdist){
puts("-2");
}
else {
puts("1");
}
}
else {
puts("0");
}
}
return (0);
}
|
main.c: In function 'main':
main.c:23:29: error: expected expression before '<' token
23 | if (abdist =< ar || abdist =< br){
| ^
|
s146911454
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
#define sq(x) (x)*(x)
int main(void)
{
int n,i;
double xa,ya,ra,xb,yb,rb;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
if((sq(xa-xb)+sq(ya-yb))<sq(rb-ra))
{
if(ra>rb)
{
printf("%d",-2);
continue;
}
if(rb>ra)
{
printf("%d",2);
}
}
if(((sq(xa-xb)+sq(ya-yb))<=sq(ra+rb))
{
printf("%d",1);
continue;
}
printf("%d",0);
}
return 0;
}
|
main.c: In function 'main':
main.c:24:54: error: expected ')' before '{' token
24 | if(((sq(xa-xb)+sq(ya-yb))<=sq(ra+rb))
| ~ ^
| )
25 | {
| ~
main.c:30:9: error: expected expression before '}' token
30 | }
| ^
|
s999966211
|
p00023
|
C
|
#include<stdio.h>
#include<math.h>
int main(void){
double xa,ya,ra,xb,yb,rb,r,d;
int i,n;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%lf%lf%lf%lf%lf%lf",&xa,&ya,&ra,&xb,&yb,&rb);
if(ra<rb){
r=ra;
ra=rb;
rb=r;
r=0;
}
d=sqrt(((xa-xb)*(xa-xb))+((ya-yb)*(ya-yb)));
if(d>(ra+rb)){
printf("0\n");
}else if((ra+rb)<=a || a<=(ra-rb)){
printf("1\n");
}else if(r==0){
printf("2\n");
}else{
printf("-2\n");
}
}
return 0;
}
|
main.c: In function 'main':
main.c:18:27: error: 'a' undeclared (first use in this function)
18 | }else if((ra+rb)<=a || a<=(ra-rb)){
| ^
main.c:18:27: note: each undeclared identifier is reported only once for each function it appears in
|
s735783959
|
p00023
|
C
|
#include <stdio.h>
#include <math.h>
int rel_c_c( double, double, double, double, double, double );
int main( void ) {
int n;
double xa, ya, ra, xb, yb, rb;
for ( scanf( "%d", &n ); n--; printf( "%d\n", rel_c_c( xa, ya, ra, xb, yb, rb ) ) )
scanf( "%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb );
return 0;
}
int rel_c_c( double x1, double y1, double r1, double x2, double y2, double r2 ) {
int sign;
double R, r, d = sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
if ( d > r1 + r2 )
return 0;
if ( r1 >= r2 ) {
sign = 1;
R = r1;
r = r2;
} else {
sign = -1;
R = r2;
r = r1;
}
if ( R - r <= d && d =< R + r )
return 1;
if ( d < R - r )
return sign * 2;
}
// int rel_c_c( double x1, double y1, double r1, double x2, double y2, double r2 ) {
// int sign;
// double R, r, d = sqrt( ( x1 - x2 ) * ( x1 - x2 ) + ( y1 - y2 ) * ( y1 - y2 ) );
// if ( d == 0 && r1 == r2 )
// return 0;
// if ( d > r1 + r2 )
// return 1;
// if ( d == r1 + r2 )
// return 2;
// if ( r1 >= r2 ) {
// sign = 1;
// R = r1;
// r = r2;
// } else {
// sign = -1;
// R = r2;
// r = r1;
// }
// if ( R - r < d && d < R + r )
// return 3;
// if ( d == R - r )
// return sign * 4;
// if ( d < R - r )
// return sign * 5;
// }
|
main.c: In function 'rel_c_c':
main.c:32:31: error: expected expression before '<' token
32 | if ( R - r <= d && d =< R + r )
| ^
|
s349088734
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
double xa, ya, ra, xb, yb, rb, d;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> xa >> ya >> ra >> xb >> yb >> rb;
d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
if(d + rb < ra) { cout << "2" << endl; }
else if(d + ra < rb) { cout << "-2" << endl; }
else if(d <= ra + rb) { cout << "1" << endl; }
else { cout << "0" << endl; }
}
return 0;
}
|
a.cc:1:2: error: extended character is not valid in an identifier
1 | #include <iostream>
| ^
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
1 | #include <iostream>
| ^~~~~~~~~~
a.cc:2:2: error: extended character is not valid in an identifier
2 | #include <cmath>
| ^
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
2 | #include <cmath>
| ^~~~~~~~~~
a.cc:7:1: error: extended character is not valid in an identifier
7 | int n;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | double xa, ya, ra, xb, yb, rb, d;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
10 | cin >> n;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
14 | d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
| ^
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
16 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
16 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:24: error: extended character is not valid in an identifier
a.cc:16:44: error: extended character is not valid in an identifier
16 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 | else if(d + ra < rb) { cout << "-2" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
18 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:30: error: extended character is not valid in an identifier
18 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:18:30: error: extended character is not valid in an identifier
a.cc:18:30: error: extended character is not valid in an identifier
a.cc:18:44: error: extended character is not valid in an identifier
18 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:19:1: error: extended character is not valid in an identifier
19 | else { cout << "0" << endl; }
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:43: error: extended character is not valid in an identifier
19 | else { cout << "0" << endl; }
| ^
a.cc:20:1: error: extended character is not valid in an identifier
20 | }
| ^
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
21 | return 0;
| ^
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
7 | int n;
| ^~~~~~~
a.cc:8:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0double' was not declared in this scope
8 | double xa, ya, ra, xb, yb, rb, d;
| ^~~~~~~~~~
a.cc:10:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
10 | cin >> n;
| ^~~~~~~
a.cc:10:12: error: 'n' was not declared in this scope
10 | cin >> n;
| ^
a.cc:11:9: error: expected primary-ex
|
s225122924
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
double xa, ya, ra, xb, yb, rb, d;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> xa >> ya >> ra >> xb >> yb >> rb;
d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
if(d + rb < ra) { cout << "2" << endl; }
else if(d + ra < rb) { cout << "-2" << endl; }
else if(d <= ra + rb) { cout << "1" << endl; }
else { cout << "0" << endl; }
}
return 0;
}
|
a.cc:1:2: error: extended character is not valid in an identifier
1 | #include <iostream>
| ^
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
1 | #include <iostream>
| ^~~~~~~~~~
a.cc:2:2: error: extended character is not valid in an identifier
2 | #include <cmath>
| ^
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
2 | #include <cmath>
| ^~~~~~~~~~
a.cc:7:1: error: extended character is not valid in an identifier
7 | int n;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | double xa, ya, ra, xb, yb, rb, d;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
10 | cin >> n;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
13 | d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
| ^
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
14 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:43: error: extended character is not valid in an identifier
14 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:15:1: error: extended character is not valid in an identifier
15 | else if(d + ra < rb) { cout << "-2" << endl; }
| ^
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
16 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:43: error: extended character is not valid in an identifier
16 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 | else { cout << "0" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:43: error: extended character is not valid in an identifier
17 | else { cout << "0" << endl; }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
18 | }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
19 | return 0;
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
7 | int n;
| ^~~~~~~
a.cc:8:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0double' was not declared in this scope
8 | double xa, ya, ra, xb, yb, rb, d;
| ^~~~~~~~~~
a.cc:10:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
10 | cin >> n;
| ^~~~~~~
a.cc:10:12: error: 'n' was not declared in this scope
10 | cin >> n;
| ^
a.cc:11:9: error: expected primary-expression before 'int'
11 | for(int i = 0; i < n; i++) {
| ^~~
a.cc:11:20: error: 'i' was not declared in this scope
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:19:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
19 | return 0;
| ^~~~~~~~~~
|
s934466227
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
double xa, ya, ra, xb, yb, rb, d;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> xa >> ya >> ra >> xb >> yb >> rb;
d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
if(d + rb < ra) { cout << "2" << endl; }
else if(d + ra < rb) { cout << "-2" << endl; }
else if(d <= ra + rb) { cout << "1" << endl; }
else { cout << "0" << endl; }
}
return 0;
}
|
a.cc:1:2: error: extended character is not valid in an identifier
1 | #include <iostream>
| ^
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: extended character is not valid in an identifier
a.cc:1:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
1 | #include <iostream>
| ^~~~~~~~~~
a.cc:2:2: error: extended character is not valid in an identifier
2 | #include <cmath>
| ^
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: extended character is not valid in an identifier
a.cc:2:2: error: invalid preprocessing directive #include\U000000a0\U000000a0\U000000a0
2 | #include <cmath>
| ^~~~~~~~~~
a.cc:7:1: error: extended character is not valid in an identifier
7 | int n;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | double xa, ya, ra, xb, yb, rb, d;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
10 | cin >> n;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
13 | d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
| ^
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
14 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:43: error: extended character is not valid in an identifier
14 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:15:1: error: extended character is not valid in an identifier
15 | else if(d + ra < rb) { cout << "-2" << endl; }
| ^
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
16 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:43: error: extended character is not valid in an identifier
16 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 | else { cout << "0" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:43: error: extended character is not valid in an identifier
17 | else { cout << "0" << endl; }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
18 | }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
19 | return 0;
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
7 | int n;
| ^~~~~~~
a.cc:8:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0double' was not declared in this scope
8 | double xa, ya, ra, xb, yb, rb, d;
| ^~~~~~~~~~
a.cc:10:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
10 | cin >> n;
| ^~~~~~~
a.cc:10:12: error: 'n' was not declared in this scope
10 | cin >> n;
| ^
a.cc:11:9: error: expected primary-expression before 'int'
11 | for(int i = 0; i < n; i++) {
| ^~~
a.cc:11:20: error: 'i' was not declared in this scope
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:19:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
19 | return 0;
| ^~~~~~~~~~
|
s526282086
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
double xa, ya, ra, xb, yb, rb, d;
cin >> n;
for(int i = 0; i < n; i++) {
cin >> xa >> ya >> ra >> xb >> yb >> rb;
d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
if(d + rb < ra) { cout << "2" << endl; }
else if(d + ra < rb) { cout << "-2" << endl; }
else if(d <= ra + rb) { cout << "1" << endl; }
else { cout << "0" << endl; }
}
return 0;
}
|
a.cc:7:1: error: extended character is not valid in an identifier
7 | int n;
| ^
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:7:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
8 | double xa, ya, ra, xb, yb, rb, d;
| ^
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:8:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
10 | cin >> n;
| ^
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:10:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:11:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
13 | d =sqrt(pow(xa - xb, 2.0) + pow(ya - yb, 2.0));
| ^
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:13:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
14 | if(d + rb < ra) { cout << "2" << endl; }
| ^
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:14:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
15 | else if(d + ra < rb) { cout << "-2" << endl; }
| ^
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:15:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
16 | else if(d <= ra + rb) { cout << "1" << endl; }
| ^
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:16:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
17 | else { cout << "0" << endl; }
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
18 | }
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
19 | return 0;
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:7:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0int' was not declared in this scope
7 | int n;
| ^~~~~~~
a.cc:8:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0double' was not declared in this scope
8 | double xa, ya, ra, xb, yb, rb, d;
| ^~~~~~~~~~
a.cc:10:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0cin' was not declared in this scope
10 | cin >> n;
| ^~~~~~~
a.cc:10:12: error: 'n' was not declared in this scope; did you mean 'yn'?
10 | cin >> n;
| ^
| yn
a.cc:11:9: error: expected primary-expression before 'int'
11 | for(int i = 0; i < n; i++) {
| ^~~
a.cc:11:20: error: 'i' was not declared in this scope
11 | for(int i = 0; i < n; i++) {
| ^
a.cc:19:1: error: '\U000000a0\U000000a0\U000000a0\U000000a0return' was not declared in this scope
19 | return 0;
| ^~~~~~~~~~
|
s702094379
|
p00023
|
C++
|
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;
int main() {
int n;
cin >> n;
double x[2], y[2], r[2];
const double EPS = 1e-9;
for (int z = 0; z < n; z++) {
cin >> x[0] >> y[0] >> r[0];
cin >> x[1] >> y[1] >> r[1];
double cdif = sqrt((x[0]-x[1])*(x[0]-x[1]) - (y[0]-y[1])*(y[0]-y[1]));
if (cdif+r[0]-r[1] < -EPS) cout << -2 << endl;
else if (cdif+r[1]-r[0] < -EPS) cout << 2 << endl;
else if (cdif-r[0]-r[1] < EPS) cout << 1 << endl;
else cout << 0 << endl;
}
|
a.cc: In function 'int main()':
a.cc:31:4: error: expected '}' at end of input
31 | }
| ^
a.cc:18:12: note: to match this '{'
18 | int main() {
| ^
|
s860347254
|
p00023
|
C++
|
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <string.h>
using namespace std;
#define ISEQ(c) (c).begin(), (c).end()
typedef long long ll;
int main() {
int n;
cin >> n;
double x[2], y[2], r[2];
const double EPS = 1e-9;
for (int z = 0; z < n; z++) {
cin >> x[0] >> y[0] >> r[0];
cin >> x[1] >> y[1] >> r[1];
double cdif = sqrt((x[0]-x[1])*(x[0]-x[1]) - (y[0]-y[1])*(y[0]-y[1]));
if (cdif+r[0]-r[1] < -EPS) cout << -2 << endl;
else if (cdif+r[1]-r[0] < -EPS) cout << 2 << endl;
else if (cdif-r[0]-r[1] < EPS) cout << 1 << endl;
else cout << 0 << endl;
}
|
a.cc: In function 'int main()':
a.cc:31:4: error: expected '}' at end of input
31 | }
| ^
a.cc:18:12: note: to match this '{'
18 | int main() {
| ^
|
s076910188
|
p00023
|
C++
|
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
long double xa,ya,xb,yb,ra,rb;
for(int i=0;i<n;i++){
cin>>xa>>ya>>ra>>xb>>yb>>rb;
if(abs(ra+rb)<sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<0<<endl;}
else if(abs(ra+rb)>=sqrt(pow(xa-xb,2)+pow(ya-yb,2)) && abs(ra-rb)<=sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<1<<endl;}
else{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:46: error: 'else' without a previous 'if'
14 | else{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}
| ^~~~
|
s516491077
|
p00023
|
C++
|
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
long double xa,ya,xb,yb,ra,rb;
for(int i=0;i<n;i++){
cin>>xa>>ya>>ra>>xb>>yb>>rb;
if(abs(ra+rb)<sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<0<<endl;}
else if(abs(ra+rb)>=sqrt(pow(xa-xb,2)+pow(ya-yb,2)) && abs(ra-rb)<=sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<1<<endl;}
else{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:46: error: 'else' without a previous 'if'
14 | else{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}
| ^~~~
|
s221300297
|
p00023
|
C++
|
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
long double xa,ya,xb,yb,ra,rb;
for(int i=0;i<n;i++){
cin>>xa>>ya>>ra>>xb>>yb>>rb;
if(abs(ra+rb)<sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<0<<endl;}
else if(abs(ra+rb)>=sqrt(pow(xa-xb,2)+pow(ya-yb,2)) && abs(ra-rb)<=sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<1<<endl;}
else{{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:47: error: 'else' without a previous 'if'
14 | else{{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}}
| ^~~~
|
s965715623
|
p00023
|
C++
|
#include<iostream>
#include<cstdlib>
#include<cmath>
using namespace std;
int main(){
int n;
cin>>n;
double xa,ya,xb,yb,ra,rb;
for(int i=0;i<n;i++){
cin>>xa>>ya>>ra>>xb>>yb>>rb;
if(abs(ra+rb)<sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<0<<endl;}
else if(abs(ra+rb)>=sqrt(pow(xa-xb,2)+pow(ya-yb,2)) && abs(ra-rb)<=sqrt(pow(xa-xb,2)+pow(ya-yb,2))){cout<<1<<endl;}
else{{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:47: error: 'else' without a previous 'if'
14 | else{{if(ra>rb)cout<<2<<endl;}else{cout<<-2<<endl;}}
| ^~~~
|
s166616088
|
p00023
|
C++
|
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <fstream>
#include <complex>
#include <math.h>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long, long> PLL;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(long i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
//constant
//--------------------------------------------
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
const long double EPS = 1e-12;
const double INF = 1e12;
int main(){
int n;
cin>>n;
long double xa,ya,ra,xb,yb,rb;
REP(i,n){
cin>>xa>>ya>>ra>>xb>>yb>>rb;
long double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
if(d<ra-rb){
cout<<"2"<<endl;
}else if(d<rb-ra){
cout<<"-2"<<endl;
}else if(d2<(ra+rb)){
cout<<"1"<<endl;
}else{
cout<<"0"<<endl;
}
}
return 0;
}
/*
2
0.0 0.0 5.0 0.0 0.0 4.0
0.0 0.0 3.0 4.1 0.0 2.0
*/
|
a.cc: In function 'int main()':
a.cc:84:26: error: 'd2' was not declared in this scope; did you mean 'd'?
84 | }else if(d2<(ra+rb)){
| ^~
| d
|
s619032814
|
p00023
|
C++
|
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int N;
cin>>N;
while(N--){
int ans;
double ax,ay,ar,bx,by,br;
cin>>ax>>ay>>ar>>bx>>by>>br;
double x;
x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
if(x>(ar+br))ans=0;
else if(abs(ar-br)<=x&&x<=(ar+br))ans=1;
else if(x<abs(ar-br)&&ar>br)ans=2;
else ans=-2;
cout<<ans<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:19: error: 'sqrt' was not declared in this scope
13 | x=sqrt((ax-bx)*(ax-bx)+(ay-by)*(ay-by));
| ^~~~
|
s009323984
|
p00023
|
C++
|
#include <iostream>
#include <math.h>
#include <stdio.h>
using namespace std;
double r(double x1,double y1,double x2,double y2){
return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}
int main() {
// your code goes here
int n;
double x1,x2,y1,y2,r1,r2;
cin>>n;
for(int j=0;j<n;j++){
cin>>x1>>y1>>r1>>x2>>y2>>r2;
if(r(x1,y1,x2,y2)>(r1+r2)){
cout<<0<<endl;
}
else if(r(x1,y1,x2,y2)>=fabs(r1-r2)&&r(x1,y1,x2,y2)=<r1+r2){
cout<<1<<endl;
}
else if(r1>r2){
cout<<2<<endl;
}
else if(r2>r1){
cout<<-2<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:69: error: expected primary-expression before '<' token
22 | else if(r(x1,y1,x2,y2)>=fabs(r1-r2)&&r(x1,y1,x2,y2)=<r1+r2){
| ^
|
s800039487
|
p00023
|
C++
|
#include <iostream>
#include <array>
#include <math.h>
int main(){
std::array<double, 3> a; //0:xa 1:ya 2:ra
std::array<double, 3> b;
int N;
std::cin >> N;
for(int i = 0; i < N; ++i){
for(int j = 0; j < 3; ++j)
std::cin >> a[j];
for(int j = 0; j < 3; ++j)
std::cin >> b[j];
double ab = sqrt( (a[0] * b[0]) + (a[1] * b[1]) );
if( ab > (a[2] + b[2]) )
std::cout << 0 << std::endl;
else if ( a[2] > ab + b[2] )
std::cout << 2 << std::endl;
else if ( b[2] > ab + a[2] )
std::cout << -2 << std::endl;
else
std::cout << 1 << std::endl;
}
}
return 0;
}
|
a.cc:39:9: error: expected unqualified-id before 'return'
39 | return 0;
| ^~~~~~
a.cc:41:1: error: expected declaration before '}' token
41 | }
| ^
|
s747953842
|
p00023
|
C++
|
#include <iostream>
#include <array>
#include <math.h>
int main(){
std::array<double, 3> a; //0:xa 1:ya 2:ra
std::array<double, 3> b;
int N;
std::cin >> N;
for(int i = 0; i < N; ++i){
for(int j = 0; j < 3; ++j)
std::cin >> a[j];
for(int j = 0; j < 3; ++j)
std::cin >> b[j];
double ab = hypot( (a[0] - b[0]) + (a[1] - b[1]) );
if( ab > (a[2] + b[2]) )
std::cout << 0 << std::endl;
else if ( a[2] > ab + b[2] )
std::cout << 2 << std::endl;
else if ( b[2] > ab + a[2] )
std::cout << -2 << std::endl;
else
std::cout << 1 << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:34: error: no matching function for call to 'hypot(std::array<double, 3>::value_type)'
22 | double ab = hypot( (a[0] - b[0]) + (a[1] - b[1]) );
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/math.h:36,
from a.cc:3:
/usr/include/c++/14/cmath:3789:5: note: candidate: 'template<class _Tp, class _Up, class _Vp> __gnu_cxx::__promoted_t<_Tp, _Up, _Vp> std::hypot(_Tp, _Up, _Vp)'
3789 | hypot(_Tp __x, _Up __y, _Vp __z)
| ^~~~~
/usr/include/c++/14/cmath:3789:5: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/cmath:3716:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::hypot(_Tp, _Up)'
3716 | hypot(_Tp __x, _Up __y)
| ^~~~~
/usr/include/c++/14/cmath:3716:5: note: candidate expects 2 arguments, 1 provided
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
from /usr/include/c++/14/bits/requires_hosted.h:31,
from /usr/include/c++/14/iostream:38,
from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:180:1: note: candidate: 'double hypot(double, double)'
180 | __MATHCALL_VEC (hypot,, (_Mdouble_ __x, _Mdouble_ __y));
| ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:180:1: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:3784:3: note: candidate: 'long double std::hypot(long double, long double, long double)'
3784 | hypot(long double __x, long double __y, long double __z)
| ^~~~~
/usr/include/c++/14/cmath:3784:3: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/cmath:3780:3: note: candidate: 'double std::hypot(double, double, double)'
3780 | hypot(double __x, double __y, double __z)
| ^~~~~
/usr/include/c++/14/cmath:3780:3: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/cmath:3776:3: note: candidate: 'float std::hypot(float, float, float)'
3776 | hypot(float __x, float __y, float __z)
| ^~~~~
/usr/include/c++/14/cmath:3776:3: note: candidate expects 3 arguments, 1 provided
/usr/include/c++/14/cmath:2433:3: note: candidate: 'constexpr long double std::hypot(long double, long double)'
2433 | hypot(long double __x, long double __y)
| ^~~~~
/usr/include/c++/14/cmath:2433:3: note: candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:2429:3: note: candidate: 'constexpr float std::hypot(float, float)'
2429 | hypot(float __x, float __y)
| ^~~~~
/usr/include/c++/14/cmath:2429:3: note: candidate expects 2 arguments, 1 provided
|
s401827852
|
p00023
|
C++
|
#include <iostream>
#include <array>
#include <math>
int main(){
std::array<double, 3> a; //0:xa 1:ya 2:ra
std::array<double, 3> b;
int N;
std::cin >> N;
for(int i = 0; i < N; ++i){
for(int j = 0; j < 3; ++j)
std::cin >> a[j];
for(int j = 0; j < 3; ++j)
std::cin >> b[j];
double ab = hypot( (a[0] - b[0]) , (a[1] - b[1]) ); //distance a,b
if( ab > (a[2] + b[2]) ) std::cout << 0 << std::endl;
else if ( a[2] > ab + b[2] ) std::cout << 2 << std::endl;
else if ( b[2] > ab + a[2] ) std::cout << -2 << std::endl;
else std::cout << 1 << std::endl;
}
return 0;
}
|
a.cc:3:10: fatal error: math: No such file or directory
3 | #include <math>
| ^~~~~~
compilation terminated.
|
s007873172
|
p00023
|
C++
|
#include <iostream>
#include <array>
inline double squ_minus(double a, double b){
double x = a - b;
return x * x;
}
inline double squ_plus(double a, double b){
double x = a + b;
return x * x;
}
int main(){
int n; // the number of datasets
cin >> n;
for(int i = 0; i < n; i++){
std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];
double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
if(dis > squ_plus(cir[2], cir[5]){
std::cout << "0" << std::endl;
}else if(dis < squ_minus(cir[2], cir[5])){
std::cout << (cir[2] > cir[5]) ? "2" : "-2" << std::endl;
}else{
std::cout << "1" << std::endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
16 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:22:58: error: 'squ_mins' was not declared in this scope; did you mean 'squ_minus'?
22 | double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
| ^~~~~~~~
| squ_minus
a.cc:24:50: error: expected ')' before '{' token
24 | if(dis > squ_plus(cir[2], cir[5]){
| ~ ^
| )
a.cc:31:9: error: expected primary-expression before '}' token
31 | }
| ^
|
s980585498
|
p00023
|
C++
|
#include <iostream>
#include <array>
inline double squ_minus(double a, double b){
double x = a - b;
return x * x;
}
inline double squ_plus(double a, double b){
double x = a + b;
return x * x;
}
int main(){
int n; // the number of datasets
cin >> n;
for(int i = 0; i < n; i++){
std::array<double, 6> cir; // 0:xa, 1:ya, 2:ra, 3:xb, 4:yb, 5:rb
cin >> cir[0] >> cir[1] >> cir[2] >> cir[3] >> cir[4] >> cir[5];
double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
if(dis > squ_plus(cir[2], cir[5]){
std::cout << "0" << std::endl;
}else if(dis < squ_minus(cir[2], cir[5])){
std::cout << (cir[2] > cir[5]) ? "2" : "-2" << std::endl;
}else{
std::cout << "1" << std::endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
16 | cin >> n;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:22:58: error: 'squ_mins' was not declared in this scope; did you mean 'squ_minus'?
22 | double dis = squ_minus(cir[0], cir[3]) + squ_mins(cir[1], cir[4]);
| ^~~~~~~~
| squ_minus
a.cc:24:50: error: expected ')' before '{' token
24 | if(dis > squ_plus(cir[2], cir[5]){
| ~ ^
| )
a.cc:31:9: error: expected primary-expression before '}' token
31 | }
| ^
|
s804580927
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
#include <deque>
inline double distance(double x1,double y1,double x2,double y2){
return sqrt( (x1 - x2)*(x1 - x2) + (y1 - y2)*(y1 - y2) );
}
int main(){
int dataSetNum;
std::cin >> dataSetNum;
std::deque<int> number;
for(int i = 0; i < dataSetNum; ++i){
double xa, ya, ra, xb, yb, rb;
std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
double dis = distance(xa, ya, xb, yb);
//"0" if A and B do not overlap
if(dis > ra + rb) number.push_buck( 0 );
//"2" if B is in A
else if(ra > rb && dis + rb <= ra) number.push_buck( 2 );
//"-2" if A is in B,
else if(rb > ra && dis + ra <= rb) number.push_buck( -2 );
//"1" if circumference of A and B intersect
else number.push_buck( 1 );
}
for(int i = 0; i < dataSetNum; ++i){
std::cout << number.front() << std::endl;
number.pop_front();
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:42: error: 'class std::deque<int>' has no member named 'push_buck'; did you mean 'push_back'?
20 | if(dis > ra + rb) number.push_buck( 0 );
| ^~~~~~~~~
| push_back
a.cc:22:59: error: 'class std::deque<int>' has no member named 'push_buck'; did you mean 'push_back'?
22 | else if(ra > rb && dis + rb <= ra) number.push_buck( 2 );
| ^~~~~~~~~
| push_back
a.cc:24:59: error: 'class std::deque<int>' has no member named 'push_buck'; did you mean 'push_back'?
24 | else if(rb > ra && dis + ra <= rb) number.push_buck( -2 );
| ^~~~~~~~~
| push_back
a.cc:26:29: error: 'class std::deque<int>' has no member named 'push_buck'; did you mean 'push_back'?
26 | else number.push_buck( 1 );
| ^~~~~~~~~
| push_back
|
s150616591
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
int main(){
int data;
std::cin >> data; //dataset
std::array<double, data>xa;
std::array<double, data>ya;
std::array<double, data>ra;
std::array<double, data>xb;
std::array<double, data>yb;
std::array<double, data>rb;
for(int i=0; i<data; ++i){
std::cin >> xa[i];
std::cin >> ya[i];
std::cin >> ra[i];
std::cin >> xb[i];
std::cin >> yb[i];
std::cin >> rb[i];
}
double length; //a-b length;
length = hypot(abs(xa-xb),abs(ya-yb));
if(length > ra+rb){
std::cout << 0 << std::endl;
}else if(length + rb < ra){
std::cout << 2 << std::endl;
}else if(length + ra < rb){
std::cout << -2 << std::endl;
}else{
std::cout << 1 << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:32: error: the value of 'data' is not usable in a constant expression
10 | std::array<double, data>xa;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:10:32: note: in template argument for type 'long unsigned int'
10 | std::array<double, data>xa;
| ^
a.cc:11:32: error: the value of 'data' is not usable in a constant expression
11 | std::array<double, data>ya;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:11:32: note: in template argument for type 'long unsigned int'
11 | std::array<double, data>ya;
| ^
a.cc:12:32: error: the value of 'data' is not usable in a constant expression
12 | std::array<double, data>ra;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:12:32: note: in template argument for type 'long unsigned int'
12 | std::array<double, data>ra;
| ^
a.cc:13:32: error: the value of 'data' is not usable in a constant expression
13 | std::array<double, data>xb;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:13:32: note: in template argument for type 'long unsigned int'
13 | std::array<double, data>xb;
| ^
a.cc:14:32: error: the value of 'data' is not usable in a constant expression
14 | std::array<double, data>yb;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:14:32: note: in template argument for type 'long unsigned int'
14 | std::array<double, data>yb;
| ^
a.cc:15:32: error: the value of 'data' is not usable in a constant expression
15 | std::array<double, data>rb;
| ^
a.cc:6:13: note: 'int data' is not const
6 | int data;
| ^~~~
a.cc:15:32: note: in template argument for type 'long unsigned int'
15 | std::array<double, data>rb;
| ^
a.cc:18:31: error: invalid types 'int[int]' for array subscript
18 | std::cin >> xa[i];
| ^
a.cc:19:31: error: invalid types 'int[int]' for array subscript
19 | std::cin >> ya[i];
| ^
a.cc:20:31: error: invalid types 'int[int]' for array subscript
20 | std::cin >> ra[i];
| ^
a.cc:21:31: error: invalid types 'int[int]' for array subscript
21 | std::cin >> xb[i];
| ^
a.cc:22:31: error: invalid types 'int[int]' for array subscript
22 | std::cin >> yb[i];
| ^
a.cc:23:31: error: invalid types 'int[int]' for array subscript
23 | std::cin >> rb[i];
| ^
|
s549582697
|
p00023
|
C++
|
#include <iostream>
#include <array>
#include <cmath>
int main(){
int data;
std::cin >> data; //dataset
std::array<double, data>xa;
std::array<double, data>ya;
std::array<double, data>ra;
std::array<double, data>xb;
std::array<double, data>yb;
std::array<double, data>rb;
for(int i=0; i<data; ++i){
std::cin >> xa[i];
std::cin >> ya[i];
std::cin >> ra[i];
std::cin >> xb[i];
std::cin >> yb[i];
std::cin >> rb[i];
}
double length; //a-b length;
length = hypot(abs(xa-xb),abs(ya-yb));
if(length > ra+rb){
std::cout << 0 << std::endl;
}else if(length + rb < ra){
std::cout << 2 << std::endl;
}else if(length + ra < rb){
std::cout << -2 << std::endl;
}else{
std::cout << 1 << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:32: error: the value of 'data' is not usable in a constant expression
11 | std::array<double, data>xa;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:11:32: note: in template argument for type 'long unsigned int'
11 | std::array<double, data>xa;
| ^
a.cc:12:32: error: the value of 'data' is not usable in a constant expression
12 | std::array<double, data>ya;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:12:32: note: in template argument for type 'long unsigned int'
12 | std::array<double, data>ya;
| ^
a.cc:13:32: error: the value of 'data' is not usable in a constant expression
13 | std::array<double, data>ra;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:13:32: note: in template argument for type 'long unsigned int'
13 | std::array<double, data>ra;
| ^
a.cc:14:32: error: the value of 'data' is not usable in a constant expression
14 | std::array<double, data>xb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:14:32: note: in template argument for type 'long unsigned int'
14 | std::array<double, data>xb;
| ^
a.cc:15:32: error: the value of 'data' is not usable in a constant expression
15 | std::array<double, data>yb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:15:32: note: in template argument for type 'long unsigned int'
15 | std::array<double, data>yb;
| ^
a.cc:16:32: error: the value of 'data' is not usable in a constant expression
16 | std::array<double, data>rb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:16:32: note: in template argument for type 'long unsigned int'
16 | std::array<double, data>rb;
| ^
a.cc:19:31: error: invalid types 'int[int]' for array subscript
19 | std::cin >> xa[i];
| ^
a.cc:20:31: error: invalid types 'int[int]' for array subscript
20 | std::cin >> ya[i];
| ^
a.cc:21:31: error: invalid types 'int[int]' for array subscript
21 | std::cin >> ra[i];
| ^
a.cc:22:31: error: invalid types 'int[int]' for array subscript
22 | std::cin >> xb[i];
| ^
a.cc:23:31: error: invalid types 'int[int]' for array subscript
23 | std::cin >> yb[i];
| ^
a.cc:24:31: error: invalid types 'int[int]' for array subscript
24 | std::cin >> rb[i];
| ^
|
s280365821
|
p00023
|
C++
|
#include <iostream>
#include <array>
#include <cmath>
int main(){
int data;
std::cin >> data; //dataset
std::array<double, data>xa;
std::array<double, data>ya;
std::array<double, data>ra;
std::array<double, data>xb;
std::array<double, data>yb;
std::array<double, data>rb;
for(int i=0; i<data; ++i){
std::cin >> xa[i];
std::cin >> ya[i];
std::cin >> ra[i];
std::cin >> xb[i];
std::cin >> yb[i];
std::cin >> rb[i];
}
double length; //a-b length;
length = hypot(abs(xa-xb),abs(ya-yb));
if(length > ra+rb){
std::cout << 0 << std::endl;
}else if(length + rb < ra){
std::cout << 2 << std::endl;
}else if(length + ra < rb){
std::cout << -2 << std::endl;
}else{
std::cout << 1 << std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:32: error: the value of 'data' is not usable in a constant expression
11 | std::array<double, data>xa;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:11:32: note: in template argument for type 'long unsigned int'
11 | std::array<double, data>xa;
| ^
a.cc:12:32: error: the value of 'data' is not usable in a constant expression
12 | std::array<double, data>ya;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:12:32: note: in template argument for type 'long unsigned int'
12 | std::array<double, data>ya;
| ^
a.cc:13:32: error: the value of 'data' is not usable in a constant expression
13 | std::array<double, data>ra;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:13:32: note: in template argument for type 'long unsigned int'
13 | std::array<double, data>ra;
| ^
a.cc:14:32: error: the value of 'data' is not usable in a constant expression
14 | std::array<double, data>xb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:14:32: note: in template argument for type 'long unsigned int'
14 | std::array<double, data>xb;
| ^
a.cc:15:32: error: the value of 'data' is not usable in a constant expression
15 | std::array<double, data>yb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:15:32: note: in template argument for type 'long unsigned int'
15 | std::array<double, data>yb;
| ^
a.cc:16:32: error: the value of 'data' is not usable in a constant expression
16 | std::array<double, data>rb;
| ^
a.cc:7:13: note: 'int data' is not const
7 | int data;
| ^~~~
a.cc:16:32: note: in template argument for type 'long unsigned int'
16 | std::array<double, data>rb;
| ^
a.cc:19:31: error: invalid types 'int[int]' for array subscript
19 | std::cin >> xa[i];
| ^
a.cc:20:31: error: invalid types 'int[int]' for array subscript
20 | std::cin >> ya[i];
| ^
a.cc:21:31: error: invalid types 'int[int]' for array subscript
21 | std::cin >> ra[i];
| ^
a.cc:22:31: error: invalid types 'int[int]' for array subscript
22 | std::cin >> xb[i];
| ^
a.cc:23:31: error: invalid types 'int[int]' for array subscript
23 | std::cin >> yb[i];
| ^
a.cc:24:31: error: invalid types 'int[int]' for array subscript
24 | std::cin >> rb[i];
| ^
|
s477398128
|
p00023
|
C++
|
//#define _USE_MATH_DEFINES
//#include <cmath>
#include <iostream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <iomanip>
#include <vector>
//#include <string>
//#include <algorithm>
//#include <functional>
//#include <time.h>
//#include <sstream>
//#include <queue>
using namespace std;
int main(){
int n, ans;
double xa, ya, ra, xb, yb, rb;
double R;
cin >> n;
while (n--){
cin >> xa >> ya >> ra >> xb >> yb >> rb;
R = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
if (R > ra + rb){
ans = 0;
}
else{
ans = 1;
if (ra > R + rb)ans = 2;
if (rb > R + ra)ans = -2;
}
cout << ans << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:21: error: 'sqrt' was not declared in this scope
29 | R = sqrt((xa - xb)*(xa - xb) + (ya - yb)*(ya - yb));
| ^~~~
|
s741609935
|
p00023
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int n;
double xa, ya, ra, xb, yb, rb;
cin >> n;
while(n--){
cin >> xa >> ya >> ra >> xb >> yb >> rb;
//B in A
if( hypot(xa - xb, ya - yb) + rb < ra )
cout << 2 << endl;
//A in B
else if( hypot(xa - xb, ya - yb) + ra < rb )
cout << -2 << endl;
//A intersect B
else if( hypot(xa - xb, ya - yb) < ra + rb )
cout << 1 << endl;
else
cout << 0 << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:21: error: 'hypot' was not declared in this scope
13 | if( hypot(xa - xb, ya - yb) + rb < ra )
| ^~~~~
|
s318020216
|
p00023
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(void){
int n;
cin>>n;
for(int i=0;i<n;i++){
double xa,ya,ra,xb,yb,rb;
cin>>xa>>ya>>ra>>xb>>yb>>rb;
double d;
d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
int ans;
d<ra-rb ? ans=2 : d<rb-ra ? ans=-2 : d<=ra+rb ? ans=1 : ans=0;
cout<<ans<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:14: error: 'sqrt' was not declared in this scope
13 | d = sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
| ^~~~
|
s811482416
|
p00023
|
C++
|
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
TIMES(n) {
// ??\???
double ax, ay, ar, bx, by, br;
cin >> ax >> ay >> ar >> bx >> by >> br;
// ?????¢????±???????
double dis_x = abs(ax-bx),
dis_y = abs(ay-by),
dist = sqrt(dis_x * dis_x + dis_y * dis_y);
// cout << dis_x << " " << dis_y << " " << dist << endl;
// ??¢????????????
if ( dist > ar + br ) {
cout << 0;
// a????????????????????????
} else if ( dist + ar < br ) {
cout << -2;
// b????????????????????????
} else if ( dist + br < ar ) {
cout << 2;
// ????????£?????????
} else {
cout << 1;
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:6: error: 'TIMES' was not declared in this scope
15 | TIMES(n) {
| ^~~~~
|
s491828324
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
double ax,ay,ar,bx,by,br;
cin >> ax >> ay >> ar >> bx >> by >> br;
double dis_x = abs(ax-bx),
double dis_y = abs(ay-by),
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
if ( dist > ar + br ) {
cout << 0; }
else if ( dist + ar < br ) {
cout << -2; }
else if ( dist + br < ar ) {
cout << 2; }
else {
cout << 1;
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:9: error: expected unqualified-id before 'double'
12 | double dis_y = abs(ay-by),
| ^~~~~~
a.cc:14:14: error: 'dist' was not declared in this scope
14 | if ( dist > ar + br ) {
| ^~~~
|
s345412676
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
double ax,ay,ar,bx,by,br;
cin >> ax >> ay >> ar >> bx >> by >> br;
double dis_x = abs(ax-bx),
double dis_y = abs(ay-by),
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
if ( dist > ar + br ) {
cout << 0; }
else if ( dist + ar < br ) {
cout << -2; }
else if ( dist + br < ar ) {
cout << 2; }
else {
cout << 1;
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:9: error: expected unqualified-id before 'double'
14 | double dis_y = abs(ay-by),
| ^~~~~~
a.cc:16:14: error: 'dist' was not declared in this scope
16 | if ( dist > ar + br ) {
| ^~~~
|
s361104815
|
p00023
|
C++
|
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
double ax,ay,ar,bx,by,br;
cin >> ax >> ay >> ar >> bx >> by >> br;
double dis_x = abs(ax-bx);
double dis_y = abs(ay-by);
double dist = sqrt(dis_x * dis_x + dis_y * dis_y);
if ( dist > ar + br )
cout << 0; }
else if ( dist + ar < br ) {
cout << -2; }
else if ( dist + br < ar ) {
cout << 2; }
else
cout << 1<< endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:1: error: 'else' without a previous 'if'
18 | else if ( dist + ar < br ) {
| ^~~~
a.cc:18:11: error: 'dist' was not declared in this scope
18 | else if ( dist + ar < br ) {
| ^~~~
a.cc:18:18: error: 'ar' was not declared in this scope
18 | else if ( dist + ar < br ) {
| ^~
a.cc:18:23: error: 'br' was not declared in this scope
18 | else if ( dist + ar < br ) {
| ^~
a.cc: At global scope:
a.cc:25:5: error: expected unqualified-id before 'return'
25 | return 0;
| ^~~~~~
a.cc:26:2: error: expected declaration before '}' token
26 | }
| ^
|
s638117072
|
p00023
|
C++
|
#include <cstdio>
#include <complex>
#include <vector>
#include <cmath>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
typedef complex<double> P;
typedef vector<P> VP;
const double EPF = 1e-5
#define X real()
#define Y imag()
#define EQ(x,y) (abs(x-y) < EPF)
#define LE(x,y) (x < y + EPF)
#define GE(x,y) (x + EPF > y)
double dot(P a, P b) {
return (conj(a)*b).X;
}
double cross(P a, P b) {
return (conj(a)*b).Y;
}
int isparallel(P a, P b, P c, P d) {//ab,cd
return EQ(cross(a-b, c-d),0);
}
double distPP(P a, P b) {
return sqrt(dot(a-b,a-b));
}
int relationCC(P c1, double r1, P c2, double r2) {//0..not overlap, 1..intersect, 2..2isin1, -2..1isin2
double d = distPP(c1,c2);
if(GE(d , r1+r2)) return 0;
else if(GE(d , r1-r2) && GE(d , r2-r1)) return 1;
else if(GE(r1 , r2)) return 2;
else return -2;
return -1;
}
P intersection(P a, P b, P c, P d) {//ac , bd
double d1 = cross(d-b,b-a);
double d2 = cross(d-b,c-a);
if(EQ(d1,0) & EQ(d2,0)) return a;
if(EQ(d2,0)) return a;
return a + (c-a)*d1/d2;
}
P normal_vector(P a) {
P b(-a.Y, a.X);
return b;
}
P polar(double r, double theta) {
P a(r*cos(theta),r*sin(theta));
return a;
}
int main() {
int n;
scanf("%d",&n);
REP(i,n) {
double x,y,r1,r2;
scanf("%lf %lf %lf", &x, &y, &r1);
P a(x,y);
scanf("%lf %lf %lf", &x, &y, &r2);
P b(x,y);
printf("%d\n", relationCC(a,r1,b,r2));
}
return 0;
}
|
a.cc:22:1: error: expected ',' or ';' before 'double'
22 | double dot(P a, P b) {
| ^~~~~~
a.cc: In function 'double distPP(P, P)':
a.cc:32:15: error: 'dot' was not declared in this scope
32 | return sqrt(dot(a-b,a-b));
| ^~~
|
s105677523
|
p00023
|
C++
|
#include<iostream>
#include<stdio.h>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<string.h>
#include<cctype>
#include<map>
#include<set>
#include<vector>
#include<sstream>
#include<stack>
using namespace std;
double abs(double x)
{
if(x<0) return -x;
else return x;
}
int main()
{
int n;
int result;
cin>>n;
double xa,ya,ra,xb,yb,rb;
while(n--)
{
cin>>xa>>ya>>ra>>xb>>yb>>rb;
double dis=sqrt(pow(yb-ya,2)+pow(xb-xa,2));
if(dis>ra+rb) result=0;
else if(dis>abs(ra-rb)) result=1;
else
{
if(dis+ra<=rb) result=-2;
else if(dis+rb<=ra) result=2;
}
}
cout<<result<endl;
//while(1);
return 0;
}
|
a.cc:18:21: error: 'double abs(double)' conflicts with a previous declaration
18 | double abs(double x)
| ^
In file included from /usr/include/c++/14/cstdlib:81,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /usr/include/c++/14/bits/basic_string.h:4154,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:2:
/usr/include/c++/14/bits/std_abs.h:71:3: note: previous declaration 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
a.cc: In function 'int main()':
a.cc:35:21: error: call of overloaded 'abs(double)' is ambiguous
35 | else if(dis>abs(ra-rb)) result=1;
| ~~~^~~~~~~
In file included from /usr/include/c++/14/cstdlib:79:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)'
980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
| ^~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
137 | abs(__float128 __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
85 | abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
| ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
79 | abs(long double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
75 | abs(float __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
71 | abs(double __x)
| ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
61 | abs(long long __x) { return __builtin_llabs (__x); }
| ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
56 | abs(long __i) { return __builtin_labs(__i); }
| ^~~
a.cc:18:9: note: candidate: 'double abs(double)'
18 | double abs(double x)
| ^~~
a.cc:42:16: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
42 | cout<<result<endl;
| ~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:48:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
493 | operator<(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:493:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1694 | operator<(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1694:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1760 | operator<(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1760:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
42 | cout<<result<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
42 | cout<<result<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/string_view:680:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
680 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:680:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/string_view:688:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
688 | operator< (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:688:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: couldn't deduce template parameter '_CharT'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
42 | cout<<result<endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
42 | cout<<result<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
42 | cout<<result<endl;
| ^~~~
In file included from /usr/include/c++/14/map:63,
from a.cc:10:
/usr/include/c++/14/bits/stl_map.h:1550:5: note: candidate: 'template<class _Key, class _Tp, class _Compare, class _Alloc> bool std::operator<(const map<_Key, _Tp, _Compare, _Allocator>&, const map<_Key, _Tp, _Compare, _Allocator>&)'
1550 | operator<(const map<_Key, _Tp, _Compare, _Alloc>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1550:5: note: template argument deduction/substitution failed:
a.cc:42:17: note: 'std::basic_ostream<char>' is not derived from 'const st
|
s968598087
|
p00023
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
typedef long long ll;
typedef pair<int, int> ii;
#define EPS 1e-8
int main(){
int n;
cin >> n;
while(n--){
double xa, ya, ra, xb, yb, rb;
cin >> xa >> ya >> ra >> xb >> yb >> rb;
double d2 = (xa - xb) * (xa - xb) + (ya - yb) * (ya - yb);
if(d2 > (ra + rb) * (ra + rb)) cout << 0 << endl;
else if(d2 == (ra + rb) * (ra + rb) cout << 1 << endl;
else if(d2 == (ra - rb) * (ra - rb)) cout << 1 << endl;
else if(ra > rb) cout << 2 << endl;
else cout << -2 << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:52: error: expected ';' before 'cout'
24 | else if(d2 == (ra + rb) * (ra + rb) cout << 1 << endl;
| ^~~~~
| ;
a.cc:25:17: error: expected primary-expression before 'else'
25 | else if(d2 == (ra - rb) * (ra - rb)) cout << 1 << endl;
| ^~~~
a.cc:24:71: error: expected ')' before 'else'
24 | else if(d2 == (ra + rb) * (ra + rb) cout << 1 << endl;
| ~ ^
| )
25 | else if(d2 == (ra - rb) * (ra - rb)) cout << 1 << endl;
| ~~~~
|
s880154955
|
p00023
|
C++
|
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 0; i < n; i++){
float x[2], y[2], r[2];
for(int j = 0; j < 2; j++)
cin >> x[j] >> y[j] >> r[j];
// 2??????????????????????????¢
float d = sqrt((x[1]-x[0])*(x[1]-x[0])+(y[1]-y[0])*(y[1]-y[0]));
float r = r[0] + r[1];
int ans;
if(d > r) ans = 0;
else if(d >= fabs(r[1]-r[0]) && d <= r) ans = 1;
else{
if(max(r[0],r[1] == r[0])) ans = 2;
else ans = -2;
}
cout << ans << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:16:15: error: conflicting declaration 'float r'
16 | float r = r[0] + r[1];
| ^
a.cc:9:27: note: previous declaration as 'float r [2]'
9 | float x[2], y[2], r[2];
| ^
a.cc:18:14: error: invalid operands of types 'float' and 'float [2]' to binary 'operator>'
18 | if(d > r) ans = 0;
| ~ ^ ~
| | |
| | float [2]
| float
a.cc:19:43: error: invalid operands of types 'float' and 'float [2]' to binary 'operator<='
19 | else if(d >= fabs(r[1]-r[0]) && d <= r) ans = 1;
| ~ ^~ ~
| | |
| | float [2]
| float
a.cc:21:19: error: no matching function for call to 'max(float&, bool)'
21 | if(max(r[0],r[1] == r[0])) ans = 2;
| ~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:21:19: note: deduced conflicting types for parameter 'const _Tp' ('float' and 'bool')
21 | if(max(r[0],r[1] == r[0])) ans = 2;
| ~~~^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:21:19: note: mismatched types 'std::initializer_list<_Tp>' and 'float'
21 | if(max(r[0],r[1] == r[0])) ans = 2;
| ~~~^~~~~~~~~~~~~~~~~~~
|
s144208428
|
p00023
|
C++
|
#include<iostream>
#include<cmath>
define
int main(){
int n;
double xa,ya,ra,xb,yb,rb,d;
std::cin >> n;
for(int i=0;i<n;i++){
std::cin >> xa >> ya >> ra
>> xb >> yb >> rb;
d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
if(ra+rb <= d){
std::cout << 0 << std::endl;
break;
}
if(ra+d <= rb){
std::cout << -2 << std::endl;
break;
}
if(rb+d <= ra){
std::cout << 2 << std::endl;
}else{
std::cout << 1 << std::endl;
}
}
}
|
a.cc:4:1: error: 'define' does not name a type
4 | define
| ^~~~~~
|
s786125571
|
p00023
|
C++
|
#include<iostream>
#include<cmath>
int main(){
int n;
double xa,ya,ra,xb,yb,rb,d;
std::cin >> n;
for(int i=0;i<n;i++){
std::cin >> xa >> ya >> ra
>> xb >> yb >> rb;
d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
/*if(ra+rb < d){
std::cout << (int)0 << std::endl;
break;
}
if(ra+d < rb){
std::cout << (int)-2 << std::endl;
break;
}
if(rb+d < ra){
std::cout << (int)2 << std::endl;
}else{
std::cout << (int)1 << std::endl;
}*/
cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:27:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
27 | cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << endl;
| ^~~~
| std::cout
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:27:54: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
27 | cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s596865109
|
p00023
|
C++
|
#include<iostream>
#include<cmath>
int main(){
int n;
double xa,ya,ra,xb,yb,rb,d;
std::cin >> n;
for(int i=0;i<n;i++){
std::cin >> xa >> ya >> ra
>> xb >> yb >> rb;
d = std::sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
/*if(ra+rb < d){
std::cout << (int)0 << std::endl;
break;
}
if(ra+d < rb){
std::cout << (int)-2 << std::endl;
break;
}
if(rb+d < ra){
std::cout << (int)2 << std::endl;
}else{
std::cout << (int)1 << std::endl;
}*/
std::cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:27:59: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
27 | std::cout << (d<=ra+rb?d+rb>=ra?d+ra>=rb?1:-2:2:0) << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s630872741
|
p00023
|
C++
|
#include "stdafx.h"
#include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define roop(a,t) for(int a=0;a<t;a++)
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
ld x[2], y[2], r[2];
ll n;
cin >> n;
roop(i, n) {
roop(lp, 2) {
cin >> x[lp] >> y[lp] >> r[lp];
}
ld ab = sqrt((x[0] - x[1])*(x[0] - x[1]) + (y[0] - y[1])*(y[0] - y[1]));
if (r[0] + r[1] < ab) { cout << 0 << endl; continue; }
else if (r[0] + r[1] == ab) { cout << 1 << endl; continue; }
else {
if (r[0] > r[1]) {
if (r[0] > r[1] + ab) { cout << 2 << endl; continue; }
}
else {
if (r[1] > r[0] + ab) { cout << 2 << endl; continue; }
}
}cout << 1 << endl;
}
return 0;
}
|
a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s690024409
|
p00023
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
typedef long long ll;
typedef pair<int, int> ii;
#define EPS 1e-8
int main(){
int n;
cin >> n;
while(n--){
double xa, ya, ra, xb, yb, rb;
cin >> xa >> ya >> ra >> xb >> yb >> rb;
double d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
if(d > ra + rb) cout << 0 << endl;
else if(d < fabs(ra - rb)){
if(ra > rb) cout << 2 << endl;
else cout << -2 << endl;
}
else cout << 1 << endl;
}
return 0;
}
|
a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:3:1: error: extended character is not valid in an identifier
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 |
| ^
a.cc:14:1: error: extended character is not valid in an identifier
14 |
| ^
a.cc:16:1: error: extended character is not valid in an identifier
16 |
| ^
a.cc:17:1: error: extended character is not valid in an identifier
17 | int n;
| ^
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:17:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
18 | cin >> n;
| ^
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:18:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
19 | while(n--){
| ^
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:19:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
20 | double xa, ya, ra, xb, yb, rb;
| ^
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:20:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
21 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:21:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
22 | double d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
| ^
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:22:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
23 | if(d > ra + rb) cout << 0 << endl;
| ^
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:23:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
24 | else if(d < fabs(ra - rb)){
| ^
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:24:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
25 | if(ra > rb) cout << 2 << endl;
| ^
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:25:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
26 | else cout << -2 << endl;
| ^
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:26:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
27 | }
| ^
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:27:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
28 | else cout << 1 << endl;
| ^
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:28:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
29 | }
| ^
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:29:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
30 | return 0;
| ^
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:30:1: error: extended character is not valid in an identifier
a.cc:3:1: error: '\U000000a0\U000000a0' does not name a type
3 |
| ^~
a.cc:12:1: error: '\U000000a0' does not name a type
12 |
| ^
|
s897348210
|
p00023
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
typedef long long ll;
typedef pair<int, int> ii;
#define EPS 1e-8
int main(){
int n;
cin >> n;
while(n--){
double xa, ya, ra, xb, yb, rb;
cin >> xa >> ya >> ra >> xb >> yb >> rb;
double d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
if(d > ra + rb) cout << 0 << endl;
else if(d < fabs(ra - rb)){
if(ra > rb) cout << 2 << endl;
else cout << -2 << endl;
}
else cout << 1 << endl;
}
return 0;
}
|
a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:3:1: error: extended character is not valid in an identifier
a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:9:1: error: extended character is not valid in an identifier
a.cc:12:1: error: extended character is not valid in an identifier
12 |
| ^
a.cc:14:1: error: extended character is not valid in an identifier
14 |
| ^
a.cc:16:5: error: extended character is not valid in an identifier
16 |
| ^
a.cc:17:5: error: extended character is not valid in an identifier
17 | int n;
| ^
a.cc:17:5: error: extended character is not valid in an identifier
a.cc:17:5: error: extended character is not valid in an identifier
a.cc:17:5: error: extended character is not valid in an identifier
a.cc:18:5: error: extended character is not valid in an identifier
18 | cin >> n;
| ^
a.cc:18:5: error: extended character is not valid in an identifier
a.cc:18:5: error: extended character is not valid in an identifier
a.cc:18:5: error: extended character is not valid in an identifier
a.cc:19:5: error: extended character is not valid in an identifier
19 | while(n--){
| ^
a.cc:19:5: error: extended character is not valid in an identifier
a.cc:19:5: error: extended character is not valid in an identifier
a.cc:19:5: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
20 | double xa, ya, ra, xb, yb, rb;
| ^
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:20:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
21 | cin >> xa >> ya >> ra >> xb >> yb >> rb;
| ^
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:21:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
22 | double d = sqrt((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb));
| ^
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:22:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
23 | if(d > ra + rb) cout << 0 << endl;
| ^
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:23:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
24 | else if(d < fabs(ra - rb)){
| ^
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:24:9: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
25 | if(ra > rb) cout << 2 << endl;
| ^
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:25:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
26 | else cout << -2 << endl;
| ^
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:26:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
27 | }
| ^
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:27:13: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
28 | else cout << 1 << endl;
| ^
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:28:9: error: extended character is not valid in an identifier
a.cc:29:9: error: extended character is not valid in an identifier
29 | }
| ^
a.cc:29:9: error: extended character is not valid in an identifier
a.cc:29:9: error: extended character is not valid in an identifier
a.cc:29:9: error: extended character is not valid in an identifier
a.cc:30:5: error: extended character is not valid in an identifier
30 | return 0;
| ^
a.cc:30:5: error: extended character is not valid in an identifier
a.cc:30:5: error: extended character is not valid in an identifier
a.cc:30:5: error: extended character is not valid in an identifier
a.cc:3:1: error: '\U000000a0\U000000a0' does not name a type
3 |
| ^~
a.cc:12:1: error: '\U000000a0' does not name a type
12 |
| ^
|
s399417033
|
p00023
|
C++
|
#include<iostream>
#include<vector>
int main()
{
int n;
std::cin >> n;
for (int i = 0; i < n; i++)
{
double xa, ya, ra, xb, yb, rb;
std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
double d = hypot(xa - xb, ya - yb);
if (d > ra + rb)
{
std::cout << 0 << std::endl;
}
else
{
if (d == ra + rb || abs(ra - rb) < d)
{
std::cout << 1 << std::endl;
}
else
{
std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
}
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:28: error: 'hypot' was not declared in this scope
11 | double d = hypot(xa - xb, ya - yb);
| ^~~~~
|
s233359200
|
p00023
|
C++
|
#include<iostream>
#include<vector>
int main()
{
int n;
std::cin >> n;
for (int i = 0; i < n; i++)
{
double xa, ya, ra, xb, yb, rb;
std::cin >> xa >> ya >> ra >> xb >> yb >> rb;
double d = hypot(xa - xb, ya - yb);
if (d > ra + rb)
{
std::cout << 0 << std::endl;
}
else if (d == ra + rb || d > abs(ra - rb))
{
std::cout << 1 << std::endl;
}
else
{
std::cout << 2 * (ra < rb ? -1 : 1) << std::endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:28: error: 'hypot' was not declared in this scope
11 | double d = hypot(xa - xb, ya - yb);
| ^~~~~
|
s513265555
|
p00023
|
C++
|
#include<iostream>
#include<cmath>
struct Point{
Point(void){
x=y=r=0;
}
double x,y;
double r;
};
double d(struct Point a,struct Point b){
return sqrt(pow(a.x-b.x,2)+pow(a.y-b.y,2));
}
int main(void){
int n;
std::cin>>n;
struct Point a,b;
for(int i=0;i<n;i++){
int judge;
std::cin>>a.x>>a.y>>a.r>>b.x>>b.y>>b.r;
double d=d(a,b);
if(d+b.r<a.r)
judge=2;
else if(d+a.r<b.r)
judge=-2;
else if(d<=a.r+b.r)
judge=1;
else
judge=0;
std::cout<<judge<<std::endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:23:19: error: 'd' cannot be used as a function
23 | double d=d(a,b);
| ~^~~~~
|
s087770156
|
p00023
|
C++
|
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
int n;
float x1, y1, r1, x2, y2, r2, u;
cin >> n;
for(int i = 0; i < n; i++){
cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
u = (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2);
if(u+r2 < r1){
cout << "2" << endl;
} else if(u+r1 < r2){
cout << "-2" << endl;
} else if(u-r1 == r2 || ){
cout << "1" << endl;
} else {
cout << "0" << endl;
}
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:19:41: error: expected primary-expression before ')' token
19 | } else if(u-r1 == r2 || ){
| ^
|
s780454027
|
p00023
|
C++
|
#include <iostream>
#include <math>
using namespace std;
int main(int argc, char **argv)
{
int n;
float x1, y1, r1, x2, y2, r2, u;
cin >> n;
for(int i = 0; i < n; i++){
cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
u = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));
if(u+r2 < r1){
cout << "2" << endl;
} else if(u+r1 < r2){
cout << "-2" << endl;
} else if(r1+r2 <= u){
cout << "1" << endl;
} else {
cout << "0" << endl;
}
}
return 0;
}
|
a.cc:2:10: fatal error: math: No such file or directory
2 | #include <math>
| ^~~~~~
compilation terminated.
|
s607586169
|
p00023
|
C++
|
RMSHYJAE
|
a.cc:1:1: error: 'RMSHYJAE' does not name a type
1 | RMSHYJAE
| ^~~~~~~~
|
s640540917
|
p00023
|
C++
|
a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}
|
a.cc:1:1: error: 'a' does not name a type
1 | a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}
| ^
a.cc:1:3: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:10: error: 'a' was not declared in this scope
1 | a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}
| ^
a.cc:1:13: error: 'puts' was not declared in this scope
1 | a;main(){a=!puts("1\n1\n1\n0\n2\n2\n-2\n0\n0\n1\n1\n-2\n1\n2");}
| ^~~~
|
s429675283
|
p00023
|
C++
|
#include<iostream>
using namespace std;
int main(){
double x[2];
double y[2];
double r[2];
double dist;
int n;
cin >> n;
for(int i=0;i<n;i++){
cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
dist = hypot(x[0] - x[1], y[0] - y[1]);
if(r[0] > dist + r[1]){
printf("2\n");
}else if(r[1] > dist + r[0]){
printf("-2\n");
}else if(r[0] + r[1] < dist){
printf("0\n");
}else{
printf("1\n");
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:24: error: 'hypot' was not declared in this scope
13 | dist = hypot(x[0] - x[1], y[0] - y[1]);
| ^~~~~
|
s076578380
|
p00023
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int num;
double xa,xb,ya,yb,ra,rb;
double dist;
cin >> num;
for( int i = 0; i < num; i++ ) {
cin >> xa >> ya >> ra >> xb >> yb >> rb;
dist = (xa-xb)*(xa-xb) + (ya-yb)*(ya-yb);
if( dist > ra + rb ) {
cout << 0 << endl;
}
else if( ra - d > rb) {
cout << 2 << endl;
}
else if( rb - d > ra) {
cout << -2 << endl;
}
else
cout << 1 << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:18:31: error: 'd' was not declared in this scope
18 | else if( ra - d > rb) {
| ^
|
s442850454
|
p00023
|
C++
|
/*AOJ 0023*/
#include<iostream>
#include<vector>
using namespace std;
class Circle_obj{
public:
double x,y,r;
};
int isCircleToCircle(Circle_obj a,Circle_obj b){
double tmpX = a.x - b.x;
double tmpY = a.y - b.y;
double R = sqrt(tmpX*tmpX + tmpY*tmpY);
if(a.r >= b.r){
if( R + b.r <= a.r){
return 2;
}
}
else{
if( R + a.r <= b.r ){
return -2;
}
}
if( R <= a.r + b.r){
return 1;
}
else{
return 0;
}
}
int main(){
int n;
cin>>n;
Circle_obj a,b;
vector<int> data;
for(int i=0;i<n;i++){
cin>>a.x;
cin>>a.y;
cin>>a.r;
cin>>b.x;
cin>>b.y;
cin>>b.r;
data.push_back(isCircleToCircle(a,b));
}
for(int i=0;i<n;i++){
cout<<data.at(i)<<endl;
}
return 0;
}
|
a.cc: In function 'int isCircleToCircle(Circle_obj, Circle_obj)':
a.cc:18:20: error: 'sqrt' was not declared in this scope
18 | double R = sqrt(tmpX*tmpX + tmpY*tmpY);
| ^~~~
|
s490524386
|
p00023
|
C++
|
#include<iostream>
using namespace std;
int intersection(double xa,double ya,double ra,double xb,double yb,double rb)
{
double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
if(ra+rb<d)
{
return 0;
}
else if(ra+d<rb)
{
return -2;
}
else if(rb+d<ra)
{
return 2;
}
else{
return 1;
}
}
int main(void)
{
int n;
cin>>n;
for(int i=0;i<n;i++)
{
double xa,ya,ra,xb,yb,rb;
cin>>xa>>ya>>ra>>xb>>yb>>rb;
cout<<intersection(xa,ya,ra,xb,yb,rb)<<endl;
}
}
|
a.cc: In function 'int intersection(double, double, double, double, double, double)':
a.cc:7:18: error: 'sqrt' was not declared in this scope
7 | double d=sqrt((xa-xb)*(xa-xb)+(ya-yb)*(ya-yb));
| ^~~~
|
s875401475
|
p00023
|
C++
|
#include<iostream>
#include<algorithm>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<vector>
#include<string>
#include<cmath>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
const int N = 2;
int main(){
int n;
cin >>n;
REP(z, n){
double x[N], y[N], r[N];
REP(i, N) cin >>x[i] >>y[i] >>r[i];
double d = (x[0] - x[1]) * (x[0] - x[1]) + (y[0] - y[1]) * (y[0] - y[1]);
double rr = (r[0] + (r[1]) * (r[0] + r[1]);
if(rr <= d) cout <<0 <<endl;
else if(r[0] > r[1] && d < r[0] - r[1]) cout <<2 <<endl;
else if(r[1] > r[0] && d < r[1] - r[0]) cout <<-2 <<endl;
else cout <<1 <<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:21:51: error: expected ')' before ';' token
21 | double rr = (r[0] + (r[1]) * (r[0] + r[1]);
| ~ ^
| )
|
s482015402
|
p00023
|
C++
|
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;
double ab(double a){
if(a>=0)return a;
return -a;
}
int main()
{
int n;
double xa,ya,ra,xb,yb,rb;
cin >> n;
for(int i=0;i<n;i++){
cin >> xa >> ya >> ra >> xb >> yb >> rb;
double a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
if(a>ra+rb){
printf("0\n");
}
else if(ab(ra-rb)<a){
printf("1\n");
}
else if(ra>rb)printf("2\n");
else printf("-2\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:18: error: 'sqrt' was not declared in this scope
19 | double a=sqrt((yb-ya)*(yb-ya)+(xb-xa)*(xb-xa));
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.