submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s829160930
|
p00075
|
C++
|
#include<stdio.h>
int main(){
int l;
double m,n;
while(sscanf("%d,%lf,%lf",&l,&m,&n)){
if(25.0<=m/(n*n))printf("%d\n",l);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:35: error: cannot convert 'int*' to 'const char*'
6 | while(sscanf("%d,%lf,%lf",&l,&m,&n)){
| ^~
| |
| int*
In file included from a.cc:1:
/usr/include/stdio.h:431:43: note: initializing argument 2 of 'int sscanf(const char*, const char*, ...)'
431 | const char *__restrict __format, ...) __THROW;
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
|
s601555668
|
p00075
|
C++
|
#include<stdio.h>
int main(){
float a,b,c;
printf("????¢¨??????????????????????????\???????????????:");
while(1){
scanf("%f",&a);
if(a<85){
printf("????????????\n??????????????\?????????:");
}
else{
printf("?????????????????§?????????(^??^)9m??????????????¬??°\n");
break;
}
}
printf("???????????\???????????????(m):");
scanf("%f",&b);
c=a/(b*b);
if(c<22){
printf]("????????????BMI???%1.0f?????¨???????????§????????¨??£??¨??¨??????????????£?????????????????????\n",c);
}
else if(c>=25){
printf("????????????BMI???%1.0f???????????°??????????????§??????\n",c);
}
else{
printf("????????????BMI???%1.0f????¨??????§??????(??????\n",c);
}
return 0;
}
|
a.cc:11:58: warning: trigraph ??( ignored, use -trigraphs to enable [-Wtrigraphs]
11 | printf("?????????????????§?????????(^??^)9m??????????????¬??°\n");
a.cc:15:42: warning: trigraph ??( ignored, use -trigraphs to enable [-Wtrigraphs]
15 | printf("???????????\???????????????(m):");
a.cc:25:64: warning: trigraph ??( ignored, use -trigraphs to enable [-Wtrigraphs]
25 | printf("????????????BMI???%1.0f????¨??????§??????(??????\n",c);
a.cc: In function 'int main()':
a.cc:19:23: error: expected ';' before ']' token
19 | printf]("????????????BMI???%1.0f?????¨???????????§????????¨??£??¨??¨??????????????£?????????????????????\n",c);
| ^
| ;
|
s640264845
|
p00075
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int id;
double w;
double h;
while(cin>>id){
scanf("%f",&w);
scanf("%f",&h)
double bmi = w/(h*h);
if(bmi >= 25.0){
cout<<id<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:23: error: expected ';' before 'double'
12 | scanf("%f",&h)
| ^
| ;
13 | double bmi = w/(h*h);
| ~~~~~~
a.cc:14:12: error: 'bmi' was not declared in this scope
14 | if(bmi >= 25.0){
| ^~~
|
s302133099
|
p00075
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int id;
double w, h;
while (scanf_s("%d,%lf,%lf",&id,&w,&h)) {
double bmi = w / (h*h);
if (bmi >= 25.0) {
cout << id << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | while (scanf_s("%d,%lf,%lf",&id,&w,&h)) {
| ^~~~~~~
| scanf
|
s818489749
|
p00075
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int id;
double w, h;
while (scanf_s("%d,%lf,%lf",&id,&w,&h) != EOF) {
double bmi = w / (h*h);
if (bmi >= 25.0) {
cout << id << endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
9 | while (scanf_s("%d,%lf,%lf",&id,&w,&h) != EOF) {
| ^~~~~~~
| scanf
|
s552259702
|
p00075
|
C++
|
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int num;
double w, h, BMI;
char cnm;
double BMIk(double w, double h){
double ans = w / pow(h, 2);
return ans;
}
int main(){
while(cin >> num >> cnm >> w >> cnm >> h){
BMI = BMIk(w, h);
if(BMI >= 25){
cout << num < endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:37: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
19 | cout << num < endl;
| ~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
19 | cout << num < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:19:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout << num < 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:19:39: note: couldn't deduce template parameter '_CharT'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout << num < 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:19:39: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
19 | cout << num < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s119829988
|
p00075
|
C++
|
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
int num;
double w, h, BMI;
char cnm;
double BMIk(double w, double h){
double ans = w / pow(h, 2);
return ans;
}
int main(){
while(cin >> num >> cnm >> w >> cnm >> h){
BMI = BMIk(w, h);
if(BMI >= 25){
cout << num < endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:37: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
19 | cout << num < endl;
| ~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
19 | cout << num < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:19:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
19 | cout << num < 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:19:39: note: couldn't deduce template parameter '_CharT'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
19 | cout << num < 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:19:39: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
19 | cout << num < 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:19:39: note: 'std::basic_ostream<char>' is not derived from 'const std::tuple<_UTypes ...>'
19 | cout << num < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:324:3: note: candidate: 'bool std::operator<(const error_code&, const error_code&)'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ^~~~~~~~
/usr/include/c++/14/system_error:324:31: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_code&'
324 | operator<(const error_code& __lhs, const error_code& __rhs) noexcept
| ~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/system_error:507:3: note: candidate: 'bool std::operator<(const error_condition&, const error_condition&)'
507 | operator<(const error_condition& __lhs,
| ^~~~~~~~
/usr/include/c++/14/system_error:507:36: note: no known conversion for argument 1 from 'std::basic_ostream<char>' to 'const std::error_condition&'
507 | operator<(const error_condition& __lhs,
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
|
s300139887
|
p00075
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int s[50] = {};
double w[50] = {};
double h[50] = {};
int i = 0;
vector <int> sb = {};
while (scanf_s("%d,%f,%f", s[i], w[i], h[i])) {
if ((w[i] / (h[i] ^ 2)) >= 25) {
sb.push_back(s[i]);
}
i++;
}
int j = 0;
while (sb[j] == 0) {
cout << sb[j] << endl;
j++;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
11 | while (scanf_s("%d,%f,%f", s[i], w[i], h[i])) {
| ^~~~~~~
| scanf
a.cc:12:35: error: invalid operands of types 'double' and 'int' to binary 'operator^'
12 | if ((w[i] / (h[i] ^ 2)) >= 25) {
| ~~~~ ^ ~
| | |
| | int
| double
|
s676344417
|
p00075
|
C++
|
#include<iostream>
#include<vector>
using namespace std;
int main()
{
int s[50] = {};
double w[50] = {};
double h[50] = {};
int i = 0;
vector <int> sb(50, 0);
while (scanf_s("%d,%f,%f", &s[i], &w[i], &h[i]) != EOF) {
if ((w[i] / (h[i] * h[i])) >= 25) {
sb.push_back(s[i]);
}
i++;
}
int j = 0;
while (sb[j] == 0) {
cout << sb[j] << endl;
j++;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
11 | while (scanf_s("%d,%f,%f", &s[i], &w[i], &h[i]) != EOF) {
| ^~~~~~~
| scanf
|
s499300900
|
p00075
|
C++
|
#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
int main()
{
int s[50] = {};
double w[50] = {};
double h[50] = {};
int i = 0;
vector <int> sb(50, 0);
while (scanf_s("%d,%f,%f", &s[i], &w[i], &h[i]) != EOF) {
if ((w[i] / (h[i] * h[i])) >= 25) {
sb.push_back(s[i]);
}
i++;
}
int j = 0;
while (sb[j] == 0) {
cout << sb[j] << endl;
j++;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | while (scanf_s("%d,%f,%f", &s[i], &w[i], &h[i]) != EOF) {
| ^~~~~~~
| scanf
|
s623503849
|
p00075
|
C++
|
int main()
{
int s;
double w, h;
while (scanf("%d,%lf,%lf", &s, &w, &h) != EOF) {
double bmi = w / (h * h);
if (bmi > 25.0) {
printf("%d\n", s);
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:16: error: 'scanf' was not declared in this scope
6 | while (scanf("%d,%lf,%lf", &s, &w, &h) != EOF) {
| ^~~~~
a.cc:6:51: error: 'EOF' was not declared in this scope
6 | while (scanf("%d,%lf,%lf", &s, &w, &h) != EOF) {
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int main()
a.cc:9:25: error: 'printf' was not declared in this scope
9 | printf("%d\n", s);
| ^~~~~~
a.cc:9:25: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s792020059
|
p00075
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int n;
cin>>n;
for(int i=0;i<n;i++){
double a,b,c;
scanf("%f,%f,%f",&a,&b,&c);
if((b)/(c*c)>=25)
cout<<s<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:13: error: 's' was not declared in this scope
11 | cout<<s<<endl;
| ^
|
s270096432
|
p00075
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int s;
double w,h;
while(cin>>s>>w>>h){
if(w/h/h>=25)cout<<w<<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:39: error: expected primary-expression before '<' token
8 | if(w/h/h>=25)cout<<w<<<endl;
| ^
|
s972108367
|
p00075
|
C++
|
include <iostream>
using namespace std;
int main()
{
int s;
double w, h, BMI;
while(scanf("%lf %lf %lf", s, w, h) != EOF) {
BMI = w / h / h;
if (BMI >= 25)
cout << s << endl;
}
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:11: error: 'scanf' was not declared in this scope
7 | while(scanf("%lf %lf %lf", s, w, h) != EOF) {
| ^~~~~
a.cc:7:44: error: 'EOF' was not declared in this scope
7 | while(scanf("%lf %lf %lf", s, w, h) != EOF) {
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include <iostream>
a.cc:10:13: error: 'cout' was not declared in this scope
10 | cout << s << endl;
| ^~~~
a.cc:10:26: error: 'endl' was not declared in this scope
10 | cout << s << endl;
| ^~~~
|
s659527015
|
p00075
|
C++
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> split(string s, char delim = ',');
void dataInput(vector<vector<string>> &data);
double calcBMI(double w, double h);
void showFat(vector<vector<string>> data);
int main() {
vector<vector<string>> data;
dataInput(data);
return 0;
}
vector<string> split(string s, char delim) {
size_t pos = 0;
vector<string> ret;
while ((pos = s.find(delim)) != string::npos) {
ret.push_back(s.substr(0, pos));
s.erase(0, pos + 1);
};
ret.push_back(s);
return ret;
}
void dataInput(vector<vector<string>> &data) {
int i = 0;
string temp;
while(!cin.eof()) {
cin >> temp;
data[i].pushback(split(temp));
i++;
}
}
double calcBMI(double w, double h) {
double BMI = 0.0;
BMI = w / (h * h);
return BMI
}
void showFat(vector<vector<string>> data) {
int cnt = 0;
while(cnt < data.size()) {
if(25.0 <= calcBMI(data[cnt][1],data[cnt][2])) {
cout << data[cnt][0] << "\n";
}
}
}
|
a.cc: In function 'void dataInput(std::vector<std::vector<std::__cxx11::basic_string<char> > >&)':
a.cc:36:13: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'class std::vector<std::__cxx11::basic_string<char> >'} has no member named 'pushback'; did you mean 'push_back'?
36 | data[i].pushback(split(temp));
| ^~~~~~~~
| push_back
a.cc: In function 'double calcBMI(double, double)':
a.cc:48:13: error: expected ';' before '}' token
48 | return BMI
| ^
| ;
49 | }
| ~
a.cc: In function 'void showFat(std::vector<std::vector<std::__cxx11::basic_string<char> > >)':
a.cc:55:23: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'double'
55 | if(25.0 <= calcBMI(data[cnt][1],data[cnt][2])) {
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| __gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type {aka std::__cxx11::basic_string<char>}
a.cc:43:23: note: initializing argument 1 of 'double calcBMI(double, double)'
43 | double calcBMI(double w, double h) {
| ~~~~~~~^
|
s940423881
|
p00075
|
C++
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> split(string s, char delim = ',');
void dataInput(vector<vector<string> > &data);
double calcBMI(double w, double h);
void showFat(vector<vector<string> > data);
int main() {
vector<vector<string> > data;
dataInput(data);
return 0;
}
vector<string> split(string s, char delim) {
size_t pos = 0;
vector<string> ret;
while ((pos = s.find(delim)) != string::npos) {
ret.push_back(s.substr(0, pos));
s.erase(0, pos + 1);
};
ret.push_back(s);
return ret;
}
void dataInput(vector<vector<string> > &data) {
int i = 0;
string temp;
while(!cin.eof()) {
cin >> temp;
data[i].pushback(split(temp));
i++;
}
}
double calcBMI(double w, double h) {
double BMI = 0.0;
BMI = w / (h * h);
return BMI
}
void showFat(vector<vector<string> > data) {
int cnt = 0;
double w = 0.0;
double h = 0.0;
while(cnt < data.size()) {
w = stod(data[cnt][1]);
h = stod(data[cnt][2]);
if(25.0 <= calcBMI(w,h) {
cout << data[cnt][0] << "\n";
}
}
}
|
a.cc: In function 'void dataInput(std::vector<std::vector<std::__cxx11::basic_string<char> > >&)':
a.cc:36:13: error: '__gnu_cxx::__alloc_traits<std::allocator<std::vector<std::__cxx11::basic_string<char> > >, std::vector<std::__cxx11::basic_string<char> > >::value_type' {aka 'class std::vector<std::__cxx11::basic_string<char> >'} has no member named 'pushback'; did you mean 'push_back'?
36 | data[i].pushback(split(temp));
| ^~~~~~~~
| push_back
a.cc: In function 'double calcBMI(double, double)':
a.cc:48:13: error: expected ';' before '}' token
48 | return BMI
| ^
| ;
49 | }
| ~
a.cc: In function 'void showFat(std::vector<std::vector<std::__cxx11::basic_string<char> > >)':
a.cc:59:28: error: expected ')' before '{' token
59 | if(25.0 <= calcBMI(w,h) {
| ~ ^~
| )
a.cc:62:3: error: expected primary-expression before '}' token
62 | }
| ^
|
s700949875
|
p00075
|
C++
|
#include <iostream>
#include <string>
#include <vector>
using namespace std;
vector<string> split(string s, char delim = ',');
void dataInput(vector<vector<string> > &data);
double calcBMI(double w, double h);
void showFat(vector<vector<string> > data);
int main() {
vector<vector<string> > data;
dataInput(data);
return 0;
}
vector<string> split(string s, char delim) {
size_t pos = 0;
vector<string> ret;
while ((pos = s.find(delim)) != string::npos) {
ret.push_back(s.substr(0, pos));
s.erase(0, pos + 1);
};
ret.push_back(s);
return ret;
}
void dataInput(vector<vector<string> > &data) {
int i = 0;
string temp;
while(!cin.eof()) {
cin >> temp;
data[i].push_back(split(temp));
i++;
}
}
double calcBMI(double w, double h) {
double BMI = 0.0;
BMI = w / (h * h);
return BMI
}
void showFat(vector<vector<string> > data) {
int cnt = 0;
double w = 0.0;
double h = 0.0;
while(cnt < data.size()) {
w = stod(data[cnt][1]);
h = stod(data[cnt][2]);
if(25.0 <= calcBMI(w,h) {
cout << data[cnt][0] << "\n";
}
}
}
|
a.cc: In function 'void dataInput(std::vector<std::vector<std::__cxx11::basic_string<char> > >&)':
a.cc:36:22: error: no matching function for call to 'std::vector<std::__cxx11::basic_string<char> >::push_back(std::vector<std::__cxx11::basic_string<char> >)'
36 | data[i].push_back(split(temp));
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
1283 | push_back(const value_type& __x)
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'const std::vector<std::__cxx11::basic_string<char> >::value_type&' {aka 'const std::__cxx11::basic_string<char>&'}
1283 | push_back(const value_type& __x)
| ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; value_type = std::__cxx11::basic_string<char>]'
1300 | push_back(value_type&& __x)
| ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note: no known conversion for argument 1 from 'std::vector<std::__cxx11::basic_string<char> >' to 'std::vector<std::__cxx11::basic_string<char> >::value_type&&' {aka 'std::__cxx11::basic_string<char>&&'}
1300 | push_back(value_type&& __x)
| ~~~~~~~~~~~~~^~~
a.cc: In function 'double calcBMI(double, double)':
a.cc:48:13: error: expected ';' before '}' token
48 | return BMI
| ^
| ;
49 | }
| ~
a.cc: In function 'void showFat(std::vector<std::vector<std::__cxx11::basic_string<char> > >)':
a.cc:59:28: error: expected ')' before '{' token
59 | if(25.0 <= calcBMI(w,h) {
| ~ ^~
| )
a.cc:62:3: error: expected primary-expression before '}' token
62 | }
| ^
|
s698368277
|
p00075
|
C++
|
main(id){double w,h,bmi;for(;~scanf("%d,%lf,%lf",&id,&w,&h);)w/h/h>=25&&printf("%d\n",id);exit(0);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(id){double w,h,bmi;for(;~scanf("%d,%lf,%lf",&id,&w,&h);)w/h/h>=25&&printf("%d\n",id);exit(0);}
| ^
|
s881147665
|
p00075
|
C++
|
float w,h;main(n,a){for(;~scanf("%[^,],%f,%f ",a,&w,&h);)w<24*h*h||puts(a);}
|
a.cc:1:15: error: expected constructor, destructor, or type conversion before '(' token
1 | float w,h;main(n,a){for(;~scanf("%[^,],%f,%f ",a,&w,&h);)w<24*h*h||puts(a);}
| ^
|
s452878858
|
p00075
|
C++
|
#include <cstdio>
int main(){
int i;
double w,t;
while( ~scanf("%d,%lf,%lf", &i , &w , &t ) ){
if( w/t/t >= 25.0 )
printf("%d\n", No );
}
}
|
a.cc: In function 'int main()':
a.cc:8:40: error: 'No' was not declared in this scope
8 | printf("%d\n", No );
| ^~
|
s286455931
|
p00075
|
C++
|
main(n){double w,t;for(;~scanf("%d,%lf,%lf",&n,&w,&t);w/t/t>25.0?printf("%d\n", n ):0);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){double w,t;for(;~scanf("%d,%lf,%lf",&n,&w,&t);w/t/t>25.0?printf("%d\n", n ):0);}
| ^
|
s921166046
|
p00075
|
C++
|
main(n){double w,t;for(;~scanf("%d,%f,%f",&n,&w,&t);w/t/t>=25?printf("%d\n",n):0);}
|
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){double w,t;for(;~scanf("%d,%f,%f",&n,&w,&t);w/t/t>=25?printf("%d\n",n):0);}
| ^
|
s178708819
|
p00075
|
C++
|
#include <cstdio>
#include <vector>
using namespace std;
const double BMI_FAT = 25.0;
int main(int argc, char *argv[]) {
vector<int> fat_list;
int id;
float mass, height;
while (EOF != fscanf(stdin, "%d,%f,%f", &id, &mass, &height)) {
float bmi = mass / (height * height);
if (BMI_FAT =< bmi) {
fat_list.push_back(id);
}
}
// print
const int list_size = static_cast<int>(fat_list.size());
if (list_size > 0) {
for (int i = 0; i < list_size; i++) {
printf("%d\n", fat_list[i]);
}
}
else {
puts("ツ該ツ督鳴づ按つオ");
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:13:30: error: expected primary-expression before '<' token
13 | if (BMI_FAT =< bmi) {
| ^
|
s459181688
|
p00075
|
C++
|
float h,w,k;main(i){for(;~scanf("%d%c%f%c%f",&i,&k,&w,&k,&h);25*h*h>w?:printf("%d\n",i));}
|
a.cc:1:17: error: expected constructor, destructor, or type conversion before '(' token
1 | float h,w,k;main(i){for(;~scanf("%d%c%f%c%f",&i,&k,&w,&k,&h);25*h*h>w?:printf("%d\n",i));}
| ^
|
s451622527
|
p00075
|
C++
|
#include <iostream>
using namespace std;
int num,i=0;
double m,kg;
int main(void){
while(~scanf("%d,%lf,%lf",&num,&kg,&m)){
if(kg/(pow(m,2))>=25)printf("%d\n",num);
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:24: error: 'pow' was not declared in this scope
9 | if(kg/(pow(m,2))>=25)printf("%d\n",num);
| ^~~
|
s176873109
|
p00075
|
C++
|
main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
|
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:37: error: 'scanf' was not declared in this scope
1 | main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
| ^~~~~
a.cc:1:67: error: 'EOF' was not declared in this scope
1 | main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
a.cc:1:99: error: 'printf' was not declared in this scope
1 | main(){int x,sum=0;double a,b;while(scanf("%d,%lf,%lf",&x,&a,&b)!=EOF){double y=a/b;y/=b;if(y>=25)printf("%d\n",x);}return 0;}
| ^~~~~~
a.cc:1:99: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s191571793
|
p00075
|
C++
|
include<iostream>
#include<cstdio>
using namespace std;
int main(){
double x,y;
int n;
while(scanf("%d,%lf,%lf",&n,&x,&y) != EOF){
if(x/(y*y) >= 25) cout << n << endl;
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:12:23: error: 'cout' was not declared in this scope
12 | if(x/(y*y) >= 25) cout << n << endl;
| ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include<cstdio>
+++ |+#include <iostream>
3 | using namespace std;
a.cc:12:36: error: 'endl' was not declared in this scope
12 | if(x/(y*y) >= 25) cout << n << endl;
| ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
2 | #include<cstdio>
+++ |+#include <ostream>
3 | using namespace std;
|
s863316469
|
p00075
|
C++
|
#include <cstdio>
#include <iostream>
#include <vector>
using namespace std;
int main() {
vector<int> ans;
int a;
double b,c;
while(scanf("%d,%f,%f",a,b,c)){
if(c/(b*b) >= 25) ans.push_back(a)
}
for(int i=0; i<ans.size(); i++){
cout<<ans[i]<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:51: error: expected ';' before '}' token
12 | if(c/(b*b) >= 25) ans.push_back(a)
| ^
| ;
13 | }
| ~
|
s277899354
|
p00075
|
C++
|
#include<iostream>
using namespace std;
int man(){
int np;
double w,h;
while(cin>>np>>w>>h) if(w/(h*h)>=25) cout << np << endl;
return 0;
}
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s270612486
|
p00076
|
Java
|
import java.util.Scanner;
//Treasure Hunt II
public class AOJ0076 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
int n = sc.nextInt();
if(n==-1)break;
double x = 1;
double y = 0;
for(int i=2;i<=n;i++){
double d = Math.sqrt(x*x+y*y);
double dx = -y/d;
double dy = x/d;
x+=dx;
y+=dy;
}
System.out.printf("%.2f\n%.2f\n", x, y);
}
}
}
|
Main.java:4: error: class AOJ0076 is public, should be declared in a file named AOJ0076.java
public class AOJ0076 {
^
1 error
|
s162213607
|
p00076
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };
int main() {
int n;
while ( ~scanf( "%d", &n ) && n != -1 ) {
double x = 0, y = 0;
double r = PI / 2;
for ( int i = 0; i < n; i++ ) {
r -= PI / 2;
x += cos( r );
y += sin( r );
r = atan2( -y, -x );
}
printf( "%f\n%f\n", x, y );
}
return 0;
}#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };
int main() {
int n;
while ( ~scanf( "%d", &n ) && n != -1 ) {
double x = 0, y = 0;
double r = PI / 2;
for ( int i = 0; i < n; i++ ) {
r -= PI / 2;
x += cos( r );
y += sin( r );
r = atan2( -y, -x );
}
printf( "%f\n%f\n", x, y );
}
return 0;
}
|
a.cc:54:2: error: stray '#' in program
54 | }#include <bits/stdc++.h>
| ^
a.cc:54:3: error: 'include' does not name a type
54 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:85:21: error: redefinition of 'const double EPS'
85 | static const double EPS = 1e-10;
| ^~~
a.cc:32:21: note: 'const double EPS' previously defined here
32 | static const double EPS = 1e-10;
| ^~~
a.cc:86:21: error: redefinition of 'const double PI'
86 | static const double PI = acos( -1.0 );
| ^~
a.cc:33:21: note: 'const double PI' previously defined here
33 | static const double PI = acos( -1.0 );
| ^~
a.cc:87:18: error: redefinition of 'const int mod'
87 | static const int mod = 1000000007;
| ^~~
a.cc:34:18: note: 'const int mod' previously defined here
34 | static const int mod = 1000000007;
| ^~~
a.cc:88:18: error: redefinition of 'const int INF'
88 | static const int INF = 1 << 29;
| ^~~
a.cc:35:18: note: 'const int INF' previously defined here
35 | static const int INF = 1 << 29;
| ^~~
a.cc:89:17: error: redefinition of 'const LL LL_INF'
89 | static const LL LL_INF = 1152921504606846976;
| ^~~~~~
a.cc:36:17: note: 'const LL LL_INF' previously defined here
36 | static const LL LL_INF = 1152921504606846976;
| ^~~~~~
a.cc:90:18: error: redefinition of 'const int dx []'
90 | static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
| ^~
a.cc:37:18: note: 'const int dx [8]' previously defined here
37 | static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
| ^~
a.cc:91:18: error: redefinition of 'const int dy []'
91 | static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };
| ^~
a.cc:38:18: note: 'const int dy [8]' previously defined here
38 | static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };
| ^~
a.cc:93:5: error: redefinition of 'int main()'
93 | int main() {
| ^~~~
a.cc:40:5: note: 'int main()' previously defined here
40 | int main() {
| ^~~~
|
s518165634
|
p00076
|
C++
|
def f(x,y):
d=(x*x+y*y)**0.5
return -y/d,x/d
while True:
n=input()
if n==-1:
break
x,y=1.0,0
for i in xrange(n-1):
dx,dy=f(x,y)
x,y=x+dx,y+dy
print x,y
|
a.cc:1:1: error: 'def' does not name a type
1 | def f(x,y):
| ^~~
|
s196392121
|
p00076
|
C++
|
#include <iomanip>
#include <iostream>
#define VARIABLE(x) cerr << #x << "=" << x << endl
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for (int i=m;i<(int)(n);i++)
const int INF = 10000000;
using namespace std;
typedef long long ll;
/** Problem0076 : Treasure Hunt II **/
int main()
{
int n;
while (cin>>n, n>0) {
double x, y;
x=1.0; y=0.0;
REP(i, 1, n) {
double nx = -y;
double ny = x;
double dx = nx/sqrt(nx*nx+ny*ny);
double dy = ny/sqrt(nx*nx+ny*ny);
x = x+dx; y = y+dy;
}
cout << fixed << setprecision(2) << x << "\n" << y << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:22:40: error: 'sqrt' was not declared in this scope
22 | double dx = nx/sqrt(nx*nx+ny*ny);
| ^~~~
|
s484059533
|
p00077
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class V0077{
public static void main (String[] args) throws java.lang.Exception
{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
while(true){
String str = br.readLine();
for(int i = 0;i<str.length();i++){
if(str.charAt(i)!='@'){
System.out.print(str.charAt(i));
}
else{
int n= Character.getNumericValue(str.charAt(i+1));
for(int j = 0; j<n ; j ++){
System.out.print(str.charAt(i+2));
}
i+=2;
}
}
System.out.println("");
}
}
}
|
Main.java:5: error: class V0077 is public, should be declared in a file named V0077.java
public class V0077{
^
1 error
|
s290888690
|
p00077
|
Java
|
mport java.util.Scanner;
//Run Length
public class AOJ0077 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
char[] s = sc.next().toCharArray();
StringBuilder sb = new StringBuilder();
int i = 0;
while(i<s.length){
if(s[i]=='@'){
int x = s[++i]-'0';
i++;
while(x--!=0)sb.append(s[i]);
}
else sb.append(s[i]);
i++;
}
System.out.println(sb);
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s418017200
|
p00077
|
Java
|
mport java.util.Scanner;
//Run Length
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
char[] s = sc.next().toCharArray();
StringBuilder sb = new StringBuilder();
int i = 0;
while(i<s.length){
if(s[i]=='@'){
int x = s[++i]-'0';
i++;
while(x--!=0)sb.append(s[i]);
}
else sb.append(s[i]);
i++;
}
System.out.println(sb);
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Scanner;
^
1 error
|
s529527951
|
p00077
|
Java
|
package jp.ac.can;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class RLE{
public static void main(String[] args) throws IOException{
BufferedReader read = new BufferedReader(new InputStreamReader(System.in));
String line = read.readLine();
String ans = "";
int i = 0;
while(i < line.length()){
int count = 1;
// ????????????????????? ?????? count?????°?????????????????¨??????
while(i + count < line.length() && line.charAt(i) == line.charAt(i + count)){
++count; // ??£?¶???°???????????????
}
if(count >= 4){
// 4 ?????\?????£?¶?????????????
ans += line.charAt(i) + count;
} else {
// 3 ?????\???
for(int j = 0; j < count; ++j){
ans += line.charAt(i);
}
}
// ?¬???????????????????
i += count;
}
System.out.println(ans);
}
}
|
Main.java:6: error: class RLE is public, should be declared in a file named RLE.java
public class RLE{
^
1 error
|
s690274191
|
p00077
|
C
|
#include <stdio.h>
#include <string.h>
int i,j,k,l;
char nyuroku[114514],m;
int main(int argc,char **argv){
while( scanf("%s",&nyuroku[0]) != EOF )
{
printf("debug = %s\n",nyuuroku);
l = strlen(nyuroku);
for(i=0;i<l;i++)
{
if( nyuroku[i] != '@' )
{
printf("%c",nyuroku[i]);
}
else
{
for(m='0';m<nyuroku[i+1];m++)
{
printf("%c",nyuroku[i+2]);
}
}
}
puts("");
}
return 0;
}
|
main.c: In function 'main':
main.c:10:29: error: 'nyuuroku' undeclared (first use in this function); did you mean 'nyuroku'?
10 | printf("debug = %s\n",nyuuroku);
| ^~~~~~~~
| nyuroku
main.c:10:29: note: each undeclared identifier is reported only once for each function it appears in
|
s668818098
|
p00077
|
C
|
#include <stdio.h>
#include <string.h>
#define LENGTH 1000
int ctoi(char input)
{
int i;
i = input - '0';
return i;
}
int main()
{
char st[LENGTH] = {};
char output_st[LENGTH] = {};
int i = 0, j = 0, k = 0;
for( k = 0 ; k < 50 ; k++ )
{
if( (scanf("%s", st)) != EOF )
{
i = 0;
while( st[i] != '\0' )
{
if( st[i] == '@' )
{
i++;
j = ctoi(st[i]);
i++;
for( ; j > 0 ; j-- )
sprintf(output_st, "%s%c", output_st, st[i]);
}
else
sprintf(output_st, "%s%c", output_st, st[i]);
i++;
}
printf("%s\n", output_st);
memset(output_st, '\0', LENGTH);
}
else
return 0;
}
r
}
|
main.c: In function 'main':
main.c:44:3: error: 'r' undeclared (first use in this function)
44 | r
| ^
main.c:44:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:44:4: error: expected ';' before '}' token
44 | r
| ^
| ;
45 | }
| ~
|
s339213587
|
p00077
|
C
|
main(i,j){
char s[256];
for(;gets(s);){
for(i=0;s[i];i++){
if(s[i]=='@'){
for(j=0;j<s[i+1]-'0';j++)putchar(s[i+2]);
i++;
}
else putchar(s[i]);
}
puts("");
}
exit(0);
}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(i,j){
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:3:14: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
3 | for(;gets(s);){
| ^~~~
main.c:6:58: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
6 | for(j=0;j<s[i+1]-'0';j++)putchar(s[i+2]);
| ^~~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'putchar'
+++ |+#include <stdio.h>
1 | main(i,j){
main.c:11:17: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
11 | puts("");
| ^~~~
main.c:11:17: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:13:9: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
13 | exit(0);
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | main(i,j){
main.c:13:9: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
13 | exit(0);
| ^~~~
main.c:13:9: note: include '<stdlib.h>' or provide a declaration of 'exit'
|
s641299609
|
p00077
|
C
|
include<stdio.h>
#include<string.h>
main(){
char c[102];
int i,j,len,s,s2;
while(scanf("%s",c)!=EOF){
len=strlen(c);
for(i=0;i<len;i++){
if(c[i]=='@'){
s=c[i+1]-'0';
for(j=0;j<s;j++){
printf("%c",c[i+2]);
}
i+=2;
}
else{
printf("%c",c[i]);
}
}
printf("\n");
}
return 0;
}
|
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
In file included from main.c:2:
/usr/include/string.h:44:22: error: unknown type name 'size_t'
44 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
33 | #include <stddef.h>
+++ |+#include <stddef.h>
34 |
/usr/include/string.h:47:56: error: unknown type name 'size_t'
47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
| ^~~~~~
/usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:55:32: error: unknown type name 'size_t'
55 | int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:55:32: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:61:42: error: unknown type name 'size_t'
61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:64:56: error: unknown type name 'size_t'
64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:80:60: error: unknown type name 'size_t'
80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:107:48: error: unknown type name 'size_t'
107 | extern void *memchr (const void *__s, int __c, size_t __n)
| ^~~~~~
/usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:145:53: error: unknown type name 'size_t'
145 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:153:23: error: unknown type name 'size_t'
153 | size_t __n) __THROW __nonnull ((1, 2));
| ^~~~~~
/usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:159:57: error: unknown type name 'size_t'
159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:166:8: error: unknown type name 'size_t'
166 | extern size_t strxfrm (char *__restrict __dest,
| ^~~~~~
/usr/include/string.h:166:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:167:54: error: unknown type name 'size_t'
167 | const char *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:8: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:179:59: error: unknown type name 'size_t'
179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
| ^~~~~~
/usr/include/string.h:179:59: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:195:45: error: unknown type name 'size_t'
195 | extern char *strndup (const char *__string, size_t __n)
| ^~~~~~
/usr/include/string.h:195:45: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:293:8: error: unknown type name 'size_t'
293 | extern size_t strcspn (const char *__s, const char *__reject)
| ^~~~~~
/usr/include/string.h:293:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:297:8: error: unknown type name 'size_t'
297 | extern size_t strspn (const char *__s, const char *__accept)
| ^~~~~~
/usr/include/string.h:297:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:389:46: error: unknown type name 'size_t'
389 | extern void *memmem (const void *__haystack, size_t __haystacklen,
| ^~~~~~
/usr/include/string.h:389:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:390:44: error: unknown type name 'size_t'
390 | const void *__needle, size_t __needlelen)
| ^~~~~~
/usr/include/string.h:390:44: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:398:55: error: unknown type name 'size_t'
398 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:398:55: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:401:53: error: unknown type name 'size_t'
401 | const void *__restrict __src, size_t __n)
| ^~~~~~
/usr/include/string.h:401:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:407:8: error: unknown type name 'size_t'
407 | extern size_t strlen (const char *__s)
| ^~~~~~
/usr/include/string.h:407:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:8: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:8: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:413:46: error: unknown type name 'size_t'
413 | extern size_t strnlen (const char *__string, size_t __maxlen)
| ^~~~~~
/usr/include/string.h:413:46: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/features.h:523,
from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
from /usr/include/string.h:26:
/usr/include/string.h:432:12: error: unknown type name 'size_t'
432 | extern int __REDIRECT_NTH (strerror_r,
| ^~~~~~~~~~~~~~
/usr/include/string.h:432:12: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
In file included from /usr/include/string.h:462:
/usr/include/strings.h:34:54: error: unknown type name 'size_t'
34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:24:1: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
23 | #include <stddef.h>
+++ |+#include <stddef.h>
24 |
/usr/include/strings.h:38:53: error: unknown type name 'size_t'
38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
| ^~~~~~
/usr/include/strings.h:38:53: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:42:31: error: unknown type name 'size_t'
42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
| ^~~~~~
/usr/include/strings.h:42:31: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:120:61: error: unknown type name 'size_t'
120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
| ^~~~~~
/usr/include/strings.h:120:61: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/strings.h:134:27: error: unknown type name 'size_t'
134 | size_t __n, locale_t __loc)
| ^~~~~~
/usr/include/strings.h:134:27: note: 'size_t' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
/usr/include/string.h:466:40: error: unknown type name
|
s719343941
|
p00077
|
C
|
#include <stdio.h>#include <stdlib.h> int main(void){ int i,j,k; char word[100],output[1000],loopWord[2],tmpWord; int loop; while(scanf("%s",word)!=EOF) { i=0; j=0; while(word[i]!='0') { //@があったら if(word[i]=='@') { //次の文字を見て繰り返す回数を見る i++; loopWord[0]=word[i]; loop=atoi(loopWord); //printf("%d回\n",loop); //更に次の文字を見て繰り返される文字を見る i++; tmpWord=word[i]; for(k=1;k<loop;k++) { output[j]=tmpWord; j++; } } //それ以外の時 else { output[j]=word[i]; i++; j++; } } output[j]='\0'; printf("%s\n",output); } return 0;}
|
main.c:1:19: warning: extra tokens at end of #include directive
1 | #include <stdio.h>#include <stdlib.h> int main(void){ int i,j,k; char word[100],output[1000],loopWord[2],tmpWord; int loop; while(scanf("%s",word)!=EOF) { i=0; j=0; while(word[i]!='0') { //@があったら if(word[i]=='@') { //次の文字を見て繰り返す回数を見る i++; loopWord[0]=word[i]; loop=atoi(loopWord); //printf("%d回\n",loop); //更に次の文字を見て繰り返される文字を見る i++; tmpWord=word[i]; for(k=1;k<loop;k++) { output[j]=tmpWord; j++; } } //それ以外の時 else { output[j]=word[i]; i++; j++; } } output[j]='\0'; printf("%s\n",output); } return 0;}
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s014427281
|
p00077
|
C++
|
#include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
int main() {
string s1;
cin >> s1;
for (int i=0;i<s1.size();++i) {
char c = s[i];
int d = s[i+1];
char e = s[i+2];
if (c == @) {
s1.erase(s1.begin() + i);
string s2;
for (int t=0;t<d;++t){
s2 += e;
}
s1.insert(s1.begin() + i, s2);
}
return 0;
}
|
a.cc:13:18: error: stray '@' in program
13 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:10:18: error: 's' was not declared in this scope
10 | char c = s[i];
| ^
a.cc:13:19: error: expected primary-expression before ')' token
13 | if (c == @) {
| ^
a.cc:19:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, std::string&)'
19 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed:
a.cc:19:33: note: cannot convert 's1.std::__cxx11::basic_string<char>::begin().__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::operator+(((__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)i))' (type '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >') to type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
19 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2086 | insert(size_type __pos1, const _Tp& __svt,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]'
1831 | insert(const_iterator __p, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1911:59: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<char>'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1939 | insert(size_type __pos1, const basic_string& __str)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1939:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
1939 | insert(size_type __pos1, const basic_string& __str)
| ~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1963 | insert(size_type __pos1, const basic_string& __str,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1987 | insert(size_type __pos, const _CharT* __s, size_type __n)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2007 | insert(size_type __pos, const _CharT* __s)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2007:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
2007 | insert(size_type __pos, const _CharT* __s)
| ~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2032 | insert(size_type __pos, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
2051 | insert(__const_iterator __p, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2051:43: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
2051 | insert(__const_iterator __p, _CharT __c)
| ~~~~~~~^~~
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s153521335
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
for (int i=0;i<s1.size();++i) {
char c = s[i];
if (c == @) {
int d = s[i+1];
char e = s[i+2];
s1.erase(s1.begin() + i);
string s2;
for (int t=0;t<d;++t){
s2 += e;
}
s1.insert(s1.begin() + i, s2);
}
return 0;
}
|
a.cc:10:18: error: stray '@' in program
10 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:9:18: error: 's' was not declared in this scope
9 | char c = s[i];
| ^
a.cc:10:19: error: expected primary-expression before ')' token
10 | if (c == @) {
| ^
a.cc:18:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, std::string&)'
18 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed:
a.cc:18:33: note: cannot convert 's1.std::__cxx11::basic_string<char>::begin().__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::operator+(((__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >::difference_type)i))' (type '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >') to type 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
18 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2086 | insert(size_type __pos1, const _Tp& __svt,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]'
1831 | insert(const_iterator __p, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1911:59: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'std::initializer_list<char>'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1939 | insert(size_type __pos1, const basic_string& __str)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1939:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
1939 | insert(size_type __pos1, const basic_string& __str)
| ~~~~~~~~~~^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1963 | insert(size_type __pos1, const basic_string& __str,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1987 | insert(size_type __pos, const _CharT* __s, size_type __n)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2007 | insert(size_type __pos, const _CharT* __s)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2007:24: note: no known conversion for argument 1 from '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >' to 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'}
2007 | insert(size_type __pos, const _CharT* __s)
| ~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2032 | insert(size_type __pos, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
2051 | insert(__const_iterator __p, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2051:43: note: no known conversion for argument 2 from 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'char'
2051 | insert(__const_iterator __p, _CharT __c)
| ~~~~~~~^~~
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s263179282
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
for (int i=0;i<s1.size();++i) {
char c = s[i];
if (c == @) {
int d = s[i+1];
char e = s[i+2];
s1.erase(s1.begin() + i);
string s2;
for (int t=0;t<d;++t){
s2.insert(0,e);
}
s1.insert(s1.begin() + i, s2);
}
return 0;
}
|
a.cc:10:18: error: stray '@' in program
10 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:9:18: error: 's' was not declared in this scope
9 | char c = s[i];
| ^
a.cc:10:19: error: expected primary-expression before ')' token
10 | if (c == @) {
| ^
a.cc:16:25: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int, char&)'
16 | s2.insert(0,e);
| ~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
2007 | insert(size_type __pos, const _CharT* __s)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2007:7: note: conversion of argument 2 would be ill-formed:
a.cc:16:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
16 | s2.insert(0,e);
| ^
| |
| char
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string<char>&]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = char; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:2: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::insert(size_type, const _Tp&) [with _Tp = char]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
a.cc:16:25: required from here
16 | s2.insert(0,e);
| ~~~~~~~~~^~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string<char>&>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2086 | insert(size_type __pos1, const _Tp& __svt,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]'
1831 | insert(const_iterator __p, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1911:29: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::const_iterator'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1939 | insert(size_type __pos1, const basic_string& __str)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1939:52: note: no known conversion for argument 2 from 'char' to 'const std::__cxx11::basic_string<char>&'
1939 | insert(size_type __pos1, const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1963 | insert(size_type __pos1, const basic_string& __str,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1987 | insert(size_type __pos, const _CharT* __s, size_type __n)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2032 | insert(size_type __pos, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
2051 | insert(__const_iterator __p, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2051:31: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'}
2051 | insert(__const_iterator __p, _CharT __c)
| ~~~~~~~~~~~~~~~~~^~~
a.cc:18:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, std::string&)'
18 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: cand
|
s952014266
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == @) {
int d = s1[i+1];
char e = s1[i+2];
s1.erase(s1.begin() + i);
string s2;
for (int t=0;t<d;++t){
s2.insert(0,e);
}
s1.insert(s1.begin() + i, s2);
}
return 0;
}
|
a.cc:10:18: error: stray '@' in program
10 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:10:19: error: expected primary-expression before ')' token
10 | if (c == @) {
| ^
a.cc:16:25: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(int, char&)'
16 | s2.insert(0,e);
| ~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:2007:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (near match)
2007 | insert(size_type __pos, const _CharT* __s)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2007:7: note: conversion of argument 2 would be ill-formed:
a.cc:16:28: error: invalid conversion from 'char' to 'const char*' [-fpermissive]
16 | s2.insert(0,e);
| ^
| |
| char
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, _InputIterator, _InputIterator) [with <template-parameter-2-2> = _InputIterator; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1876 | insert(const_iterator __p, _InputIterator __beg, _InputIterator __end)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2069:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/move.h:37,
from /usr/include/c++/14/bits/exception_ptr.h:41,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/type_traits: In substitution of 'template<bool _Cond, class _Tp> using std::enable_if_t = typename std::enable_if::type [with bool _Cond = false; _Tp = std::__cxx11::basic_string<char>&]':
/usr/include/c++/14/bits/basic_string.h:149:8: required by substitution of 'template<class _CharT, class _Traits, class _Alloc> template<class _Tp, class _Res> using std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv = std::enable_if_t<((bool)std::__and_<std::is_convertible<const _Tp&, std::basic_string_view<_CharT, _Traits> >, std::__not_<std::is_convertible<const _Tp*, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>*> >, std::__not_<std::is_convertible<const _Tp&, const _CharT*> > >::value), _Res> [with _Tp = char; _Res = std::__cxx11::basic_string<char>&; _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
149 | using _If_sv = enable_if_t<
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2069:2: required by substitution of 'template<class _Tp> std::__cxx11::basic_string<char>::_If_sv<_Tp, std::__cxx11::basic_string<char>&> std::__cxx11::basic_string<char>::insert(size_type, const _Tp&) [with _Tp = char]'
2069 | insert(size_type __pos, const _Tp& __svt)
| ^~~~~~
a.cc:16:25: required from here
16 | s2.insert(0,e);
| ~~~~~~~~~^~~~~
/usr/include/c++/14/type_traits:2711:11: error: no type named 'type' in 'struct std::enable_if<false, std::__cxx11::basic_string<char>&>'
2711 | using enable_if_t = typename enable_if<_Cond, _Tp>::type;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate: 'template<class _Tp> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_If_sv<_Tp, std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _Tp&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
2086 | insert(size_type __pos1, const _Tp& __svt,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2086:9: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator; size_type = long unsigned int]'
1831 | insert(const_iterator __p, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1831:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1911:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1911:29: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::const_iterator'
1911 | insert(const_iterator __p, initializer_list<_CharT> __l)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/basic_string.h:1939:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1939 | insert(size_type __pos1, const basic_string& __str)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1939:52: note: no known conversion for argument 2 from 'char' to 'const std::__cxx11::basic_string<char>&'
1939 | insert(size_type __pos1, const basic_string& __str)
| ~~~~~~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&, size_type, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1963 | insert(size_type __pos1, const basic_string& __str,
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1963:7: note: candidate expects 4 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, const _CharT*, size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
1987 | insert(size_type __pos, const _CharT* __s, size_type __n)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:1987:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(size_type, size_type, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
2032 | insert(size_type __pos, size_type __n, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2032:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/basic_string.h:2051:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::insert(__const_iterator, _CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; iterator = std::__cxx11::basic_string<char>::iterator; __const_iterator = std::__cxx11::basic_string<char>::const_iterator]'
2051 | insert(__const_iterator __p, _CharT __c)
| ^~~~~~
/usr/include/c++/14/bits/basic_string.h:2051:31: note: no known conversion for argument 1 from 'int' to 'std::__cxx11::basic_string<char>::__const_iterator' {aka 'std::__cxx11::basic_string<char>::const_iterator'}
2051 | insert(__const_iterator __p, _CharT __c)
| ~~~~~~~~~~~~~~~~~^~~
a.cc:18:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::insert(__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >, std::string&)'
18 | s1.insert(s1.begin() + i, s2);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/basic_string.h:1876:9: note: candidate: 'template<class _InputIterator, class> std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::iterator std
|
s952282604
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
string s2;
if (c == @) {
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
else{
s2.insert(s2.end(), c);
}
return 0;
}
|
a.cc:11:18: error: stray '@' in program
11 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before ')' token
11 | if (c == @) {
| ^
a.cc:17:9: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:11:21: note: to match this '{'
11 | if (c == @) {
| ^
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s645587602
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
string s2;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == @) {
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
else{
s2.insert(s2.end(), c);
}
return 0;
}
|
a.cc:11:18: error: stray '@' in program
11 | if (c == @) {
| ^
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before ')' token
11 | if (c == @) {
| ^
a.cc:17:9: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:11:21: note: to match this '{'
11 | if (c == @) {
| ^
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s679061376
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
string s2;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == @){
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
}
else{
s2.insert(s2.end(), c);
}
return 0;
}
|
a.cc:11:18: error: stray '@' in program
11 | if (c == @){
| ^
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before ')' token
11 | if (c == @){
| ^
a.cc:22:2: error: expected '}' at end of input
22 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int main() {
| ^
|
s568856788
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
string s2;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == @){
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
}
else{
s2.insert(s2.end(), c);
}
}
return 0;
}
|
a.cc:11:18: error: stray '@' in program
11 | if (c == @){
| ^
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before ')' token
11 | if (c == @){
| ^
|
s519731246
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
string s2;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == "@"){
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
}
else{
s2.insert(s2.end(), c);
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if (c == "@"){
| ~~^~~~~~
|
s161282441
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main() {
string s1;
cin >> s1;
string s2;
for (int i=0;i<s1.size();++i) {
char c = s1[i];
if (c == "@"){
int d = s1[i+1];
char e = s1[i+2];
for (int t=0;t<d;++t){
s2.insert(s2.end(), e);
}
}
else{
s2.insert(s2.end(), c);
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:11:15: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
11 | if (c == "@"){
| ~~^~~~~~
|
s499542860
|
p00077
|
C++
|
#include<iostream>
#include<string>
using namespace std;
int main(){
string s;
while(cin >> s){
while(s.find("@")!=-1){
int x=s.find("@");
string buf;
for(int i=0;i<s[x+1]-"0";i++) buf+=s[x+2];
s.replace(x,3,buf);
}
cout << s << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:10:27: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
10 | for(int i=0;i<s[x+1]-"0";i++) buf+=s[x+2];
|
s178767564
|
p00077
|
C++
|
#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define _MAX 81
int main(void)
{
char str[MAX], ans[MAX * 9];
while (gets_s(str, MAX) != NULL) {
for (int i = 0, j = 0; str[i - 1] != '\0'; ++i) {
if (str[i] == '@' && str[i + 2] != '\0') {
if ('0' <= str[i + 1] && str[i + 1] <= '9') {
for (int k = 0; k < str[i + 1] - '0'; ++k, ++j) {
ans[j] = str[i + 2];
}
i += 2;
}
else {
ans[j] = str[i];
++j;
}
}
else {
ans[j] = str[i];
++j;
}
}
printf("%s\n", ans);
}
}
|
a.cc: In function 'int main()':
a.cc:13:16: error: 'gets_s' was not declared in this scope
13 | while (gets_s(str, MAX) != NULL) {
| ^~~~~~
|
s704524421
|
p00077
|
C++
|
#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define _MAX 81
int main(void)
{
char str[MAX];
while (gets_s(str, MAX) != NULL) {
for (int i = 0; str[i - 1] != '\0'; ++i) {
if (str[i] == '@') {
for (int j = 0; j < str[i + 1] - '0'; ++i) {
printf("%c", str[i + 2]);
}
i += 2;
}
else {
printf("%c", str[i]);
}
}
printf("\n");
}
}
|
a.cc: In function 'int main()':
a.cc:13:16: error: 'gets_s' was not declared in this scope
13 | while (gets_s(str, MAX) != NULL) {
| ^~~~~~
|
s236771594
|
p00077
|
C++
|
//#define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 101
#define _MAX 81
int main(void)
{
char str[MAX];
while (gets_s(str, MAX) != NULL) {
for (int i = 0; str[i - 1] != '\0'; ++i) {
if (str[i] == '@') {
for (int j = 0; j < str[i + 1] - '0'; ++j) {
printf("%c", str[i + 2]);
}
i += 2;
}
else {
printf("%c", str[i]);
}
}
printf("\n");
}
}
|
a.cc: In function 'int main()':
a.cc:13:16: error: 'gets_s' was not declared in this scope
13 | while (gets_s(str, MAX) != NULL) {
| ^~~~~~
|
s724064827
|
p00077
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
while (cin >> s){
for (auto& it = s.begin(); it != s.end(); it++){
if (*it != '@'){
cout << *it;
continue;
}
it++;
int n = (*it) - '0';
it++;
for (int i = 0; i < n; i++){
cout << *it;
}
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:40: error: cannot bind non-const lvalue reference of type '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >&' to an rvalue of type 'std::__cxx11::basic_string<char>::iterator'
10 | for (auto& it = s.begin(); it != s.end(); it++){
| ~~~~~~~^~
|
s490238672
|
p00077
|
C++
|
#include <iostream>
#include <string>
using namespace std;
int main(){
string s;
while (cin >> s){
for (auto& it = s.begin(); it != s.end(); it++){
if (*it != '@'){
cout << *it;
continue;
}
it++;
int n = (*it) - '0';
it++;
for (int i = 0; i < n; i++){
cout << *it;
}
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:40: error: cannot bind non-const lvalue reference of type '__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char> >&' to an rvalue of type 'std::__cxx11::basic_string<char>::iterator'
10 | for (auto& it = s.begin(); it != s.end(); it++){
| ~~~~~~~^~
|
s024123346
|
p00077
|
C++
|
#include <iostream>
#include <string>
#include <cstdio>
using namespace std;
int main()
{
int i, j, n;
char c[100], b, d;
string s;
while (cin >> c)
{
if (cin.eof()) break;
s = "";
for (i = 0; i < strlen(c);)
{
if (c[i] == '@')
{
d = c[++i];
n = atoi(&d);
b = c[++i];
for (j = 0; j < n; j++)
{
s += b;
}
}
else
{
s += c[i];
}
i++;
}
cout << s << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:33: error: 'strlen' was not declared in this scope
14 | for (i = 0; i < strlen(c);)
| ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <cstdio>
+++ |+#include <cstring>
4 | using namespace std;
|
s991701820
|
p00077
|
C++
|
#include <iostream>
#include <string>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
int i, j, n;
char c[100], b, d;
string s;
while (cin >> c)
{
if (cin.eof()) break;
s = "";
for (i = 0; i < strlen(c);)
{
if (c[i] == '@')
{
d = c[++i];
n = atoi(&d);
b = c[++i];
for (j = 0; j < n; j++)
{
s += b;
}
}
else
{
s += c[i];
}
i++;
}
cout << s << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:33: error: 'strlen' was not declared in this scope
15 | for (i = 0; i < strlen(c);)
| ^~~~~~
a.cc:5:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <cstdlib>
+++ |+#include <cstring>
5 | using namespace std;
|
s064072961
|
p00077
|
C++
|
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
int n, i, j, c;
char s[101] = "", r[101] = "", t;
while (cin >> s, !cin.eof())
{
c = 0;
for (i = 0; i < strlen(s); i++)
{
if (s[i] == '@')
{
t = s[i+1];
n = atoi(&t);
for (j = 0; j < n; j++)
{
r[c] = s[i+2];
c++;
}
i += 2;
}
else
{
r[c] = s[i];
c++;
}
}
r[c] = '\0';
cout << r << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:33: error: 'strlen' was not declared in this scope
11 | for (i = 0; i < strlen(s); i++)
| ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <cstdlib>
+++ |+#include <cstring>
3 | using namespace std;
|
s092916333
|
p00077
|
C++
|
include <string>
#include <cstdio>
#include <iostream>
using namespace std;
int main(){
string s;
while(cin>>s){
for(int i=0; i<s.size(); i++){
if(s[i]!='@') putchar(s[i]);
else {
i++;
int n=s[i]-'0';
i++;
for(int j=0; j<n; j++){
putchar(s[i]);
}
}
}
putchar('\n');
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <string>
| ^~~~~~~
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a type
68 | typedef ptrdiff_t streamsize; // Signed integral type
| ^~~~~~~~~
/usr/include/c++/14/bits/postypes.h:41:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
40 | #include <cwchar> // For mbstate_t
+++ |+#include <cstddef>
41 |
In file included from /usr/include/c++/14/bits/exception_ptr.h:38,
from /usr/include/c++/14/exception:166,
from /usr/include/c++/14/ios:41:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
In file included from /usr/include/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/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
132 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
134 | __attribute__((__externally_visible__));
| ^
/usr/include/c++/14/new:140:29: error: 'std::size_t' has not been declared
140 | void operator delete(void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:142:31: error: 'std::size_t' has not been declared
142 | void operator delete[](void*, std::size_t) _GLIBCXX_USE_NOEXCEPT
| ^~~
/usr/include/c++/14/new:145:26: error: declaration of 'operator new' as non-function
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:145:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:145:52: error: expected primary-expression before 'const'
145 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:147:26: error: declaration of 'operator new []' as non-function
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:147:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:147:54: error: expected primary-expression before 'const'
147 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
| ^~~~~
/usr/include/c++/14/new:154:26: error: declaration of 'operator new' as non-function
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:154:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:154:68: error: expected primary-expression before ')' token
154 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:155:73: error: attributes after parenthesized initializer ignored [-fpermissive]
155 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:156:26: error: declaration of 'operator new' as non-function
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:156:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:156:68: error: expected primary-expression before ',' token
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:156:70: error: expected primary-expression before 'const'
156 | _GLIBCXX_NODISCARD void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:162:26: error: declaration of 'operator new []' as non-function
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~~~
/usr/include/c++/14/new:162:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:162:70: error: expected primary-expression before ')' token
162 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t)
| ^
/usr/include/c++/14/new:163:73: error: attributes after parenthesized initializer ignored [-fpermissive]
163 | __attribute__((__externally_visible__, __alloc_size__ (1), __malloc__));
| ^
/usr/include/c++/14/new:164:26: error: declaration of 'operator new []' as non-function
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~~~
/usr/include/c++/14/new:164:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
214 | typedef __SIZE_TYPE__ size_t;
| ^~~~~~
/usr/include/c++/14/new:164:70: error: expected primary-expression before ',' token
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^
/usr/include/c++/14/new:164:72: error: expected primary-expression before 'const'
164 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, std::align_val_t, const std::nothrow_t&)
| ^~~~~
/usr/include/c++/14/new:171:29: error: 'std::size_t' has not been declared
171 | void operator delete(void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:173:31: error: 'std::size_t' has not been declared
173 | void operator delete[](void*, std::size_t, std::align_val_t)
| ^~~
/usr/include/c++/14/new:179:33: error: declaration of 'operator new' as non-function
179 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
| ^~~~~~~~
/usr/include/c++/14/new:179:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
179 | _GLIBCXX_NODISCARD inline void* operator n
|
s625223860
|
p00078
|
Java
|
#include <stdio.h>
#include <stdlib.h>
#define sqr(x) ((x)*(x))
int main(void) {
int n,x,y,i,j;
int **magic;
while (1) {
scanf("%d",&n);
if (n==0) break;
magic = (int **)calloc(n,sizeof(int *));
for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
x = n/2;
y = n/2+1;
for (i=1;i<=sqr(n);i++) {
if (magic[y][x]==0) magic[y][x] = i;
else {
while (magic[y][x]>0) {
x = (x+n-1)%n;
y = (y+1)%n;
}
magic[y][x] = i;
}
x = (x+1)%n;
y = (y+1)%n;
}
for (i=0;i<n;i++) {
for (j=0;j<n;j++) printf("%4d",magic[i][j]);
putchar('\n');
free(magic[i]);
}
free(magic);
}
return 0;
}
|
Main.java:1: error: illegal character: '#'
#include <stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <stdio.h>
^
Main.java:2: error: illegal character: '#'
#include <stdlib.h>
^
Main.java:3: error: illegal character: '#'
#define sqr(x) ((x)*(x))
^
Main.java:7: error: class, interface, enum, or record expected
int **magic;
^
Main.java:9: error: class, interface, enum, or record expected
while (1) {
^
Main.java:11: error: class, interface, enum, or record expected
if (n==0) break;
^
Main.java:12: error: class, interface, enum, or record expected
magic = (int **)calloc(n,sizeof(int *));
^
Main.java:13: error: class, interface, enum, or record expected
for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
^
Main.java:13: error: class, interface, enum, or record expected
for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
^
Main.java:13: error: class, interface, enum, or record expected
for (i=0;i<n;i++) magic[i] = (int *)calloc(n,sizeof(int));
^
Main.java:14: error: class, interface, enum, or record expected
x = n/2;
^
Main.java:15: error: class, interface, enum, or record expected
y = n/2+1;
^
Main.java:16: error: class, interface, enum, or record expected
for (i=1;i<=sqr(n);i++) {
^
Main.java:16: error: class, interface, enum, or record expected
for (i=1;i<=sqr(n);i++) {
^
Main.java:16: error: class, interface, enum, or record expected
for (i=1;i<=sqr(n);i++) {
^
Main.java:18: error: class, interface, enum, or record expected
else {
^
Main.java:21: error: class, interface, enum, or record expected
y = (y+1)%n;
^
Main.java:22: error: class, interface, enum, or record expected
}
^
Main.java:24: error: class, interface, enum, or record expected
}
^
Main.java:26: error: class, interface, enum, or record expected
y = (y+1)%n;
^
Main.java:27: error: class, interface, enum, or record expected
}
^
Main.java:28: error: class, interface, enum, or record expected
for (i=0;i<n;i++) {
^
Main.java:28: error: class, interface, enum, or record expected
for (i=0;i<n;i++) {
^
Main.java:29: error: class, interface, enum, or record expected
for (j=0;j<n;j++) printf("%4d",magic[i][j]);
^
Main.java:29: error: class, interface, enum, or record expected
for (j=0;j<n;j++) printf("%4d",magic[i][j]);
^
Main.java:30: error: class, interface, enum, or record expected
putchar('\n');
^
Main.java:31: error: class, interface, enum, or record expected
free(magic[i]);
^
Main.java:32: error: class, interface, enum, or record expected
}
^
Main.java:34: error: class, interface, enum, or record expected
}
^
Main.java:37: error: class, interface, enum, or record expected
}
^
31 errors
|
s656871256
|
p00078
|
Java
|
import java.util.Scanner;
public class Main {
static int cnt;
static int x, y;
static int[][] a;
static int n;
static void pushNumber(){
// 2. 次の数字を右斜め下のマス目に...
x++;
y++;
/* 2-1. 右にはみ出した場合には、同じ行の左はしに、
* 左にはみ出した場合には、同じ行の右はしに、
* 下にはみ出した場合には、同じ列の一番上に... */
if(x>=n){
x=0;
}
if(y>=n){
y=0;
}
if(x<0){
x=n-1;
}
if(y<0){
y=n-1;
}
if(a[x][y]==0){
a[x][y]=cnt++; // 数字を入れる
}
else{
/* 数字をいれようとしたマス目が埋まっているときには、
* その埋まっているマス目の左斜め下のマス目に*/
y-=2;
}
}
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
while(true){
n = stdIn.nextInt(); // Input
if(n==0){ // Finish
return;
}
a = new int[n][n]; // Box Make
// 1. 中央のマス目のちょうど一つ下のマス目に1をいれる。
x=(n-1)/2;
y=x++;
a[x][y]=1;
cnt = 2;
while(true){
if(cnt>n*n){
break;
}
pushNumber();
}
// Output
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.printf("%4d",a[i][j]);
}
System.out.println();
}
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
import java.util.Scanner;
^
Main.java:1: error: illegal character: '#'
import java.util.Scanner;
^
Main.java:1: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
|
s627633498
|
p00078
|
Java
|
import java.util.Scanner;
public class Main {
static int cnt;
static int x, y;
static int[][] a;
static int n;
static void pushNumber(){
// 2. 次の数字を右斜め下のマス目に...
x++;
y++;
/* 2-1. 右にはみ出した場合には、同じ行の左はしに、
* 左にはみ出した場合には、同じ行の右はしに、
* 下にはみ出した場合には、同じ列の一番上に... */
if(x>=n){
x=0;
}
if(y>=n){
y=0;
}
if(x<0){
x=n-1;
}
if(y<0){
y=n-1;
}
if(a[x][y]==0){
a[x][y]=cnt++; // 数字を入れる
}
else{
/* 数字をいれようとしたマス目が埋まっているときには、
* その埋まっているマス目の左斜め下のマス目に*/
y-=2;
}
}
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
while(true){
n = stdIn.nextInt(); // Input
if(n==0){ // Finish
return;
}
a = new int[n][n]; // Box Make
// 1. 中央のマス目のちょうど一つ下のマス目に1をいれる。
x=(n-1)/2;
y=x++;
a[x][y]=1;
cnt = 2;
while(true){
if(cnt>n*n){
break;
}
pushNumber();
}
// Output
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
System.out.printf("%4d",a[i][j]);
}
System.out.println();
}
}
}
}
|
Main.java:1: error: class, interface, enum, or record expected
import java.util.Scanner;
^
Main.java:1: error: illegal character: '#'
import java.util.Scanner;
^
Main.java:1: error: class, interface, enum, or record expected
import java.util.Scanner;
^
3 errors
|
s471066843
|
p00078
|
C
|
#include <stdio.h>
#include <string.h>
int main(){
int number = 0;
int magic[100][100];
int i;
int j;
int position[2] = {};
// int insert[100][100];
scanf("%d", &number);
position[0] = number - 1;
position[1] = number/2;
// magic[number - 1][(number/2 + 1) - 1] = 1;
for(i = 0; i < number; i++){
if(position[0] >= number){
position[0] = 0;
}
if(position[1] >= number){
position[1] = number -1;
}
magic[position[0]][position[1]] = i;
position[0]++;
position[1]--;
}
for(i = 0; i < number; i++){
for(j = 0; j < number; j++){
position[i][j];
}
printf("\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:32:18: error: subscripted value is neither array nor pointer nor vector
32 | position[i][j];
| ^
|
s357214847
|
p00078
|
C++
|
include<bits/stdc++.h>
using namespace std;
int main(){
int n;
while(cin >> n , n) {
int mass[20][20]={0};
int nowx = n / 2;
int nowy = nowx + 1;
int limit = n * n + 1;
int cou = 2;
mass[nowy][nowx] = 1;
while(cou != limit) {
if(mass[(nowy+1)%n][(nowx+1)%n] == 0){
nowy = (nowy + 1) % n;
nowx = (nowx + 1) % n;
mass[nowy][nowx] = cou;
}
else {
nowy = (nowy + 1) % n;
nowx = (nowx + 1) % n;
nowy = (nowy + 1) % n;
if(nowx - 1 == -1) nowx = n - 1;
else nowx = nowx - 1;
mass[nowy][nowx] = cou;
}
cou++;
}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++){
printf("%4d",mass[i][j]);
}
cout << endl;
}
}
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | while(cin >> n , n) {
| ^~~
a.cc:31:9: error: 'printf' was not declared in this scope
31 | printf("%4d",mass[i][j]);
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include<bits/stdc++.h>
a.cc:33:7: error: 'cout' was not declared in this scope; did you mean 'cou'?
33 | cout << endl;
| ^~~~
| cou
a.cc:33:15: error: 'endl' was not declared in this scope
33 | cout << endl;
| ^~~~
|
s211971904
|
p00078
|
C++
|
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>> anser;
int n;
bool input(){
cin>>n;
if(n == 0)return false;
return true;
}
int main(){
while(input()){
solve();
output();
}
void solve(){
int c = n/2;
int h = n/2+1;
anser.clear();
anser.resize(n);
for(int i = 0;i < n;i ++){
anser[i].resize(n);
}
int count = 1;
while(1){
if(anser[h][c]==0){
anser[h][c] = count;
}else{
h=(h+n+1)%n;
c=(c+n-1)%n;
anser[h][c] = count;
}
count++;
h=(h+n+1)%n;
c=(c+n+1)%n;
if(count == 1+n*n)return ;
}
}
void output(){
const auto ans = anser;
for(int i = 0;i < ans.size(); i++){
for(int j = 0;j < ans[i].size(); j++){
printf("%4d",ans[i][j]);
}cout<<endl;
}
}
}
|
a.cc: In function 'int main()':
a.cc:13:5: error: 'solve' was not declared in this scope
13 | solve();
| ^~~~~
a.cc:14:5: error: 'output' was not declared in this scope
14 | output();
| ^~~~~~
a.cc:17:13: error: a function-definition is not allowed here before '{' token
17 | void solve(){
| ^
a.cc:41:14: error: a function-definition is not allowed here before '{' token
41 | void output(){
| ^
|
s867193961
|
p00078
|
C++
|
#define _USE_MATH_DEFINES
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
int n;
while (cin >> n&&n) {
vector<vector<int >???>v(n, vector<int>(n));
for (int i = 0; i < n; i++)for (int j = 0; j < n; j++)v[i][j] = -1;
v[n / 2 + 1][n / 2] = 1;
pair<int, int>pp;
pp.first = n / 2 + 1;
pp.second = n / 2;
int cnt = 1;
pair<int, int>pn;
pn.first = pp.first + 1;
pn.second = pp.second + 1;
while (cnt < n*n) {
if (pn.second == n) {
pn.second = 0;
//cout << "right" << endl;
}
if (pn.second == -1) {
pn.second = n - 1;
//cout << "left" << endl;
}
if (pn.first == n) {
pn.first = 0;
//cout << "under" << endl;
}
if (v[pn.first][pn.second] != -1) {
pn.first++;
pn.second--;
//cout << "full" << endl;
}
else {
cnt++;
v[pn.first][pn.second] = cnt;
pn.first++;
pn.second++;
//cout << "success" << endl;
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
printf("%4d", v[i][j]);
}
putchar('\n');
}
}
return 0;
}
|
a.cc:23:37: warning: trigraph ??> ignored, use -trigraphs to enable [-Wtrigraphs]
23 | vector<vector<int >???>v(n, vector<int>(n));
a.cc: In function 'int main()':
a.cc:23:39: error: template argument 1 is invalid
23 | vector<vector<int >???>v(n, vector<int>(n));
| ^
a.cc:23:39: error: template argument 2 is invalid
a.cc:23:59: error: expression list treated as compound expression in initializer [-fpermissive]
23 | vector<vector<int >???>v(n, vector<int>(n));
| ^
a.cc:23:45: error: cannot convert 'std::vector<int>' to 'int' in initialization
23 | vector<vector<int >???>v(n, vector<int>(n));
| ^~~~~~~~~~~~~~
| |
| std::vector<int>
a.cc:24:72: error: invalid types 'int[int]' for array subscript
24 | for (int i = 0; i < n; i++)for (int j = 0; j < n; j++)v[i][j] = -1;
| ^
a.cc:25:18: error: invalid types 'int[int]' for array subscript
25 | v[n / 2 + 1][n / 2] = 1;
| ^
a.cc:47:30: error: invalid types 'int[int]' for array subscript
47 | if (v[pn.first][pn.second] != -1) {
| ^
a.cc:54:34: error: invalid types 'int[int]' for array subscript
54 | v[pn.first][pn.second] = cnt;
| ^
a.cc:62:48: error: invalid types 'int[int]' for array subscript
62 | printf("%4d", v[i][j]);
| ^
|
s284478871
|
p00078
|
C++
|
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<queue>
#include<map>
using namespace std;
int main() {
int a[15][15];
int b;
while (cin >> b, b) {
memset(a, -1, sizeof(a));
int x = b / 2 + 1, y = b / 2;
a[x][y] = 1;
for (int c = 2; c <= b * b; c++) {
x++; y++;
while (1) {
if (x >= b)x -= b;
if (y < 0)y += b;
if (y >= b)y -= b;
if (a[x][y] == -1) {
a[x][y] = c;
break;
}
x++; y--;
}
}
for (int p = 0; p < b; p++) {
for (int q = 0; q < b; q++) {
cout << a[p][q] << " ";
}
puts("");
}
}
}
|
a.cc: In function 'int main()':
a.cc:13:17: error: 'memset' was not declared in this scope
13 | memset(a, -1, sizeof(a));
| ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
6 | #include<map>
+++ |+#include <cstring>
7 | using namespace std;
|
s436871208
|
p00078
|
C++
|
#include <stdio.h>
int main(int argc, char **argv)
{
int n, **a, i, j, t=0;
while(1){
scanf("%d", &n);
if(n == 0){
break;
}
a = (int **)calloc(n, sizeof(int));
for(i = 0; i < n; i++){
a[i] = (int *)calloc(n, sizeof(int));
}
i = n/2+1;
j = n/2;
t = 1;
while(t <= n*n){
if(a[i][j] != 0){
i++;
j--;
} else {
a[i++][j++] = t++;
}
if(n == i){
i = 0;
}
if(n == j){
j = 0;
} else if(j < 0){
j = n-1;
}
}
for(i = 0; i < n-1; i++){
printf("%4d", a[i][0]);
for(j = 1; j < n; j++){
printf("%4d", a[i][j]);
}
printf("\n");
}
for(i = 0; i < n; i++){
free(a[i]);
}
free(a);
}
return 0;
}
|
a.cc: In function 'int main(int, char**)':
a.cc:13:29: error: 'calloc' was not declared in this scope
13 | a = (int **)calloc(n, sizeof(int));
| ^~~~~~
a.cc:2:1: note: 'calloc' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
1 | #include <stdio.h>
+++ |+#include <cstdlib>
2 |
a.cc:47:25: error: 'free' was not declared in this scope
47 | free(a[i]);
| ^~~~
a.cc:47:25: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
a.cc:50:17: error: 'free' was not declared in this scope
50 | free(a);
| ^~~~
a.cc:50:17: note: 'free' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
|
s374191391
|
p00078
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdlib>
#include <cstdio>
using namespace std;
int main(){
int n;
int field[16][16];
while(cin>>n&&n!=0){
memset(field,0,sizeof(field));
field[(n/2)+1][n/2]=1;
int cx=n/2;
int cy=(n/2)+1;
int num=2;
int sw=0;
while(1){
if(sw==0){
int ny=(cy+1)%n;
int nx=(cx+1)%n;
if(field[ny][nx]==0){
field[ny][nx]=num;
if(num==n*n)
break;
if(num==5){
cout<<endl;
}
num++;
cx=nx,cy=ny;
}
else{
sw=1;
cx=nx,cy=ny;
}
}
else{
int ny=(cy+1)%n;
int nx=(cx+n-1)%n;
if(field[ny][nx]==0){
field[ny][nx]=num;
if(num==n*n)
break;
num++;
sw=0;
cx=nx,cy=ny;
}
else{
sw=1;
cx=nx,cy=ny;
}
}
}
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
printf("%4d",field[i][j]);
}
cout<<endl;
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:17: error: 'memset' was not declared in this scope
14 | memset(field,0,sizeof(field));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include <cstdio>
+++ |+#include <cstring>
6 |
|
s788078561
|
p00078
|
C++
|
#include<iostream>
#include<vector>
#include<string>
#include<cstdio>
#include<cstdlib>
using namespace::std;
int main(){
int number;
int i, j;
int center = 0;
int h = 0;
int w = 0;
cin>>number;
while(number != 0){
int magic[number][number];
memset(magic, -1, sizeof(magic));
center = number/2;
h = center + 1;
w = center;
magic[h][w] = 1;
for(i = 2; i <= number * number; i++){
h = (h + 1) % number;
w = (w + 1) % number;
if(magic[h][w] != -1){
h = (h + 1) % number;
w = w - 1;
if(w == -1){
w = w + number;
}
}
magic[h][w] = i;
}
for(i = 0; i < number; i++){
for(j = 0; j < number; j++){
printf("%3d", magic[i][j]);
}
printf("\n");
}
cin>>number;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:20:3: error: 'memset' was not declared in this scope
20 | memset(magic, -1, sizeof(magic));
| ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
5 | #include<cstdlib>
+++ |+#include <cstring>
6 |
|
s001763401
|
p00078
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int a[15][15];
int main(){
int n;
while(cin>>n&&n){
memset(a,0,sizeof(a));
int y=n/2+1,x=n/2;
int cur=1;
while(cur<=n*n){
if(a[y][x]==0){
a[y][x]=cur++;
y++;x++;
}else{
y++;x--;
}
if(x<0)x=n-1;
else if(n<=x)x=0;
if(n<=y)y=0;
}
for(y=0;y<n;y++){
for(x=0;x<n;x++){
printf(" %3d",a[y][x]);
}
puts("");
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:17: error: 'memset' was not declared in this scope
9 | memset(a,0,sizeof(a));
| ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include<cstdio>
+++ |+#include <cstring>
3 | using namespace std;
|
s955704951
|
p00078
|
C++
|
#include <iomanip>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
int magic(int n){
int c=1,x=n/2,y=x+1;
while(1){
A[y][x]=c;
if(c== n*n)break;
while(1){
x=(x+1)%n;
y=(y+1)%n;
if(A[y][x]==0)break;
x=(x+n-1)%n;
y=(y+1)%n;
if(A[y][x]==0)break;
}
c++;
}
return 0;
}
int main(){
int n,i,j;
while(cin>>n,n!=0){
A.resize(n);
for(i=0;i<n;i++)A[i].resize(n,0);
magic(n);
stringstream buf;
for(i=0;i<n;i++){
for(j=0;j<n;j++)buf<<setw(4)<<setfill(' ')<< A[i][j];
cout<<buf.str()<< endl;
buf.str("");
}
A.clear();
}
}
|
a.cc: In function 'int magic(int)':
a.cc:9:17: error: 'A' was not declared in this scope
9 | A[y][x]=c;
| ^
a.cc: In function 'int main()':
a.cc:26:17: error: 'A' was not declared in this scope
26 | A.resize(n);
| ^
|
s967342611
|
p00079
|
C
|
#include<math.h>
int main() {
double x[21], y[21], ans = 0;
int n = 0;
while (scanf("%lf,%lf", &x[n], &y[n]) != EOF) {
n++;
}
for (int i = 1; i < n; i++) {
double s = (x[i] - x[0])*(y[i + 1] - y[0]) - (x[i + 1] - x[0])*(y[i] - y[0]);
if (s < 0)s *= -1;
ans += s;
}
printf("%.8lf", ans);
}
|
main.c: In function 'main':
main.c:6:16: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | while (scanf("%lf,%lf", &x[n], &y[n]) != EOF) {
| ^~~~~
main.c:2:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
1 | #include<math.h>
+++ |+#include <stdio.h>
2 |
main.c:6:16: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
6 | while (scanf("%lf,%lf", &x[n], &y[n]) != EOF) {
| ^~~~~
main.c:6:16: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:50: error: 'EOF' undeclared (first use in this function)
6 | while (scanf("%lf,%lf", &x[n], &y[n]) != EOF) {
| ^~~
main.c:6:50: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:6:50: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
14 | printf("%.8lf", ans);
| ^~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s153329468
|
p00079
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i,j;
double x[20],y[20],s=0;
//値の読み込み
for(i=0;i<20 ;i++){
if(scanf("%lf%lf",&x[i],&y[i]) ==EOF) break;
//scanf("%lf%lf",&x[i],&y[i]);
j=i;
}
n=i-1;
for(i=0;i<n;i++){
s+=(fabs(x[i]*y[i+1]-x[i+1]*y[i])/2.0);
}
printf("%0.6lf\n",s);
return 0;
}
|
main.c: In function 'main':
main.c:13:9: error: 'n' undeclared (first use in this function)
13 | n=i-1;
| ^
main.c:13:9: note: each undeclared identifier is reported only once for each function it appears in
|
s537921080
|
p00079
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i=0,j;
double x[20],y[20],s=0;
//値の読み込み
while(scanf("%lf,%lf\n",&x[i],&y[i]) !=EOF) {
//scanf("%lf%lf",&x[i],&y[i]);
i++;
}
j=i
for(i=1;i<j;i++){
s+=(x[i]*y[i+1]-x[i+1]*y[i]);
}
s+=(x[i]*y[0]-x[0]*y[i]);)
printf("%0.6lf\n",fabs(s)/2.0);
return 0;
}
|
main.c: In function 'main':
main.c:12:12: error: expected ';' before 'for'
12 | j=i
| ^
| ;
13 | for(i=1;i<j;i++){
| ~~~
main.c:16:34: error: expected statement before ')' token
16 | s+=(x[i]*y[0]-x[0]*y[i]);)
| ^
|
s010243559
|
p00079
|
C
|
#include <stdio.h>
#include <math.h>
int main(){
int i=0,j;
double x[20],y[20],s=0;
//値の読み込み
while(scanf("%lf,%lf\n",&x[i],&y[i]) !=EOF) {
//scanf("%lf%lf",&x[i],&y[i]);
i++;
}
j=i
for(i=1;i<j;i++){
s+=(x[i]*y[i+1]-x[i+1]*y[i]);
}
s+=(x[i]*y[0]-x[0]*y[i]);
printf("%0.6lf\n",fabs(s)/2.0);
return 0;
}
|
main.c: In function 'main':
main.c:12:12: error: expected ';' before 'for'
12 | j=i
| ^
| ;
13 | for(i=1;i<j;i++){
| ~~~
|
s301895997
|
p00079
|
C
|
#include<stdio.h>
</stdio.h>
typedef struct vec vec;
struct vec {
double x, y;
};
/* 便利なコンストラクタ関数*/
static vec P(double x, double y) {
vec p = {x, y};
return p;
}
static vec add(vec a,vec b){
return Vec(a.x + b.y, a.y + b.y);
}
static vec add(vec a,vec b){
return Vec(a.x - b.y, a.y - b.y);
}
static double norm(vec a){
return sqrt(a.x * b.y, a.y * b.x);
}
static double dot(vec a,vec b){
return a.x * b.y - a.y * b.x;
}
int main(void){
vec a = {1.0,2.0};
vec b = Vec{2.0,3.0};
vec c = add(a,b);
printf("(%f,%f)\n", c.x, c.y);
printf("dot %f\n",dot(a , b));
printf("cross %f\n", cross(a,b));
return 0;
}
|
main.c:3:1: error: expected identifier or '(' before '<' token
3 | </stdio.h>
| ^
main.c:13:8: error: unknown type name 'vec'
13 | static vec P(double x, double y) {
| ^~~
main.c: In function 'P':
main.c:14:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
14 | vec p = {x, y};
| ^~~
| struct
main.c:14:17: warning: excess elements in scalar initializer
14 | vec p = {x, y};
| ^
main.c:14:17: note: (near initialization for 'p')
main.c: At top level:
main.c:18:8: error: unknown type name 'vec'
18 | static vec add(vec a,vec b){
| ^~~
main.c:18:16: error: unknown type name 'vec'
18 | static vec add(vec a,vec b){
| ^~~
main.c:18:22: error: unknown type name 'vec'
18 | static vec add(vec a,vec b){
| ^~~
main.c:22:8: error: unknown type name 'vec'
22 | static vec add(vec a,vec b){
| ^~~
main.c:22:16: error: unknown type name 'vec'
22 | static vec add(vec a,vec b){
| ^~~
main.c:22:22: error: unknown type name 'vec'
22 | static vec add(vec a,vec b){
| ^~~
main.c:26:20: error: unknown type name 'vec'
26 | static double norm(vec a){
| ^~~
main.c:30:19: error: unknown type name 'vec'
30 | static double dot(vec a,vec b){
| ^~~
main.c:30:25: error: unknown type name 'vec'
30 | static double dot(vec a,vec b){
| ^~~
main.c: In function 'main':
main.c:36:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
36 | vec a = {1.0,2.0};
| ^~~
| struct
main.c:36:10: error: stray '\343' in program
36 | vec a<U+3000>= {1.0,2.0};
| ^~~~~~~~
main.c:36:19: warning: excess elements in scalar initializer
36 | vec a = {1.0,2.0};
| ^~~
main.c:36:19: note: (near initialization for 'a')
main.c:37:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
37 | vec b = Vec{2.0,3.0};
| ^~~
| struct
main.c:37:13: error: 'Vec' undeclared (first use in this function); did you mean 'vec'?
37 | vec b = Vec{2.0,3.0};
| ^~~
| vec
main.c:37:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:37:16: error: expected ',' or ';' before '{' token
37 | vec b = Vec{2.0,3.0};
| ^
main.c:38:5: error: unknown type name 'vec'; use 'struct' keyword to refer to the type
38 | vec c = add(a,b);
| ^~~
| struct
main.c:38:13: error: implicit declaration of function 'add' [-Wimplicit-function-declaration]
38 | vec c = add(a,b);
| ^~~
main.c:39:26: error: request for member 'x' in something not a structure or union
39 | printf("(%f,%f)\n", c.x, c.y);
| ^
main.c:39:31: error: request for member 'y' in something not a structure or union
39 | printf("(%f,%f)\n", c.x, c.y);
| ^
main.c:40:23: error: implicit declaration of function 'dot' [-Wimplicit-function-declaration]
40 | printf("dot %f\n",dot(a , b));
| ^~~
main.c:41:26: error: implicit declaration of function 'cross' [-Wimplicit-function-declaration]
41 | printf("cross %f\n", cross(a,b));
| ^~~~~
|
s366721056
|
p00079
|
C
|
#include <bits/stdc++.h>
using namespace std;
int n, x[128], y[128];
double cpx(int p, int q, int i)
{
if(y[p] < y[q]) swap(p,q);
double a = y[p]-i, b = i-y[q];
return (b*x[p]+a*x[q])/(a+b);
}
int solve()
{
int ans = 0, li = *min_element(y,y+n), ri = *max_element(y,y+n);
for (int i = li; i < ri; i++) {
vector<pair<double,double>> xs;
for (int j = 0; j < n; j++) {
int nj = (j+1)%n;
if(y[j] == y[nj] or i < min(y[j], y[nj]) or i+1 > max(y[j], y[nj])) continue;
double x1 = cpx(j,nj,i), x2 = cpx(j,nj,i+1);
if(x1 > x2) swap(x1, x2);
xs.push_back(make_pair(x1,x2));
}
sort(begin(xs),end(xs));
int xr = -2048;
for (int j = 0; j < (int)xs.size()-1; j+=2) {
int l = max(int(floor(xs[j].first)), xr), r = ceil(xs[j+1].second);
ans += r-l;
xr = r;
}
}
return ans;
}
bool input()
{
scanf("%d", &n);
for (int i = 0; i < n; i++) scanf("%d %d", x+i, y+i);
return n;
}
int main()
{
while(input()) printf("%d\n", solve());
return 0;
}
|
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s017917303
|
p00079
|
C
|
#include <stdio.h> #include <math.h> double area3(double x1, double y1, double x2, double y2, double x3, double y3) { double a, b, c, z; a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); b = sqrt((x1-x3)*(x1-x3) + (y1-y3)*(y1-y3)); c = sqrt((x2-x3)*(x2-x3) + (y2-y3)*(y2-y3)); z = (a+b+c)/2.0; return sqrt(z*(z-a)*(z-b)*(z-c)); } int main() { double x0, y0, x1, y1, x2, y2; double s=0.0; scanf("%lf,%lf", &x0, &y0); scanf("%lf,%lf", &x1, &y1); while (scanf("%lf,%lf", &x2,&y2)==2) { s+=area3(x0, y0, x1, y1, x2, y2); x1=x2; y1=y2; } printf("%.6lf\n", s); return 0; }
|
main.c:1:20: warning: extra tokens at end of #include directive
1 | #include <stdio.h> #include <math.h> double area3(double x1, double y1, double x2, double y2, double x3, double y3) { double a, b, c, z; a = sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2)); b = sqrt((x1-x3)*(x1-x3) + (y1-y3)*(y1-y3)); c = sqrt((x2-x3)*(x2-x3) + (y2-y3)*(y2-y3)); z = (a+b+c)/2.0; return sqrt(z*(z-a)*(z-b)*(z-c)); } int main() { double x0, y0, x1, y1, x2, y2; double s=0.0; scanf("%lf,%lf", &x0, &y0); scanf("%lf,%lf", &x1, &y1); while (scanf("%lf,%lf", &x2,&y2)==2) { s+=area3(x0, y0, x1, y1, x2, y2); x1=x2; y1=y2; } printf("%.6lf\n", s); return 0; }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s545576039
|
p00079
|
C
|
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
const int MAX = 20;
typedef pair<long double,long double> P;
P data[MAX];
int rev;
long double ans;
long double getlength(int i, int j){
return sqrt((data[i].first - data[j].first)*(data[i].first - data[j].first)+
(data[i].second - data[j].second)*(data[i].second - data[j].second));
}
void solve(){
long double num[3];
for(int i = 1; i < rev-1; i++){
long double z = 0;
num[0] = getlength(0,i);
num[1] = getlength(0,i+1);
num[2] = getlength(i,i+1);
z = (num[0]+num[1]+num[2])/2;
ans += sqrt(z*(z-num[0])*(z-num[1])*(z-num[2]));
}
}
int main(){
char c;
while(cin >> data[rev].first >> c >> data[rev].second){
rev++;
}
solve();
// cout << ans << endl;
printf("%.6Lf\n",ans);
return 0;
}
|
main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s777135014
|
p00079
|
C
|
#include<cmath>
#include<cstdio>
using namespace std;
const int MAX = 20;
typedef pair<long double,long double> P;
P data[MAX];
int rev;
long double ans;
long double getlength(int i, int j){
return sqrt((data[i].first - data[j].first)*(data[i].first - data[j].first)+
(data[i].second - data[j].second)*(data[i].second - data[j].second));
}
void solve(){
long double num[3];
for(int i = 1; i < rev-1; i++){
long double z = 0;
num[0] = getlength(0,i);
num[1] = getlength(0,i+1);
num[2] = getlength(i,i+1);
z = (num[0]+num[1]+num[2])/2;
ans += sqrt(z*(z-num[0])*(z-num[1])*(z-num[2]));
}
}
int main(){
char c;
// while(cin >> data[rev].first >> c >> data[rev].second){
// rev++;
//}
while(scanf("%Lf %c %Lf",&data[rev].first,&c,&data[rev].second) != EOF)
rev++;
solve();
// cout << ans << endl;
printf("%.6Lf\n",ans);
return 0;
}
|
main.c:1:9: fatal error: cmath: No such file or directory
1 | #include<cmath>
| ^~~~~~~
compilation terminated.
|
s392448456
|
p00079
|
C++
|
#include <iostream>
#include <cmath>
#include <cstdio>
#include <complex>
#include <vector>
#include <iomanip>
#define EPS 1e-10
#define EQ(a,b) (abs(a - b) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
using namespace std;
typedef complex<double> P;
double cross (P a, P b) {
return (a.real() * b.imag() - a.imag() * b.real());
}
bool cmp_x (const P& p, const P& q) {
if (p.real() != q.real()) return p.real() < q.real();
else return p.imag() < q.imag();
}
vector<P> convex_hull (vector<P> ps) {
int n = ps.size(), k = 0;
vector<P> qs (n * 2);
sort(ps.begin(), ps.end(), cmp_x);
for (int i = 0; i < n; i++) {
while (k > 1 && cross (qs[k-1] - qs[k-2], ps[i] - qs[k-1]) <= 0) k--;
qs[k++] = ps[i];
}
for (int i = n - 2, t = k; i >= 0; i--) {
while (k > t && cross (qs[k-1] - qs[k-2], ps[i] - qs[k-1]) <= 0) k--;
qs[k++] = ps[i];
}
qs.resize(k-1);
return qs;
}
double triangle (P a, P b, P c) {
double x = abs(a-b), y = abs(b-c), z = abs(c-a);
double Z = (x + y + z) / 2.0;
return sqrt(Z * (Z - x) * (Z - y) * (Z - z));
}
double area_size (vector<P> v) {
if (v.size() < 3) return 0;
double res = 0.0;
for (int i = 1; i < v.size() - 1; i++) {
res += triangle(v[0], v[i], v[i+1]);
}
return res;
}
int main ()
{
vector<P> p;
double a,b;
while (scanf("%lf,%lf", &a, &b) != EOF) {
p.push_back(P(a,b));
}
auto v = convex_hull(p);
printf("%.6f\n" , area_size(v));
return 0;
}
|
a.cc: In function 'std::vector<std::complex<double> > convex_hull(std::vector<std::complex<double> >)':
a.cc:25:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
25 | sort(ps.begin(), ps.end(), cmp_x);
| ^~~~
| sqrt
|
s742750171
|
p00079
|
C++
|
#include <bits/stdc++.h>
#define MAX_N 20
using namespace std;
typedef complex<double> P;
P data[MAX_N];
double distance(P a, P b) {
double diffx = b.real()-a.real(), diffy = b.imag()-a.imag();
return(sqrt(diffx*diffx+diffy*diffy));
}
double areaOfTriangle(P a, P b, P c) {
double ret;
double A = distance(a,b),B = distance(b,c),C = distance(c,a);
double z = (A+B+C)/2.0;
ret = sqrt(z*(z-A)*(z-B)*(z-C));
return(ret);
}
void solve(int len) {
double S = 0.0;
for(int r = 1; r < len-1; r++) {
S += areaOfTriangle(data[0], data[r], data[r+1]);
}
printf("%.6f\n", S);
}
int main(void) {
double x, y;
int idx = 0;
while(scanf("%lf,%lf", &x,&y) != EOF) {
data[idx++] = P(x, y);
}
solve(idx);
return(0);
}
|
a.cc: In function 'void solve(int)':
a.cc:23:29: error: reference to 'data' is ambiguous
23 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:5:3: note: 'P data [20]'
5 | P data[MAX_N];
| ^~~~
a.cc:23:38: error: reference to 'data' is ambiguous
23 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:5:3: note: 'P data [20]'
5 | P data[MAX_N];
| ^~~~
a.cc:23:47: error: reference to 'data' is ambiguous
23 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:5:3: note: 'P data [20]'
5 | P data[MAX_N];
| ^~~~
a.cc: In function 'int main()':
a.cc:32:9: error: reference to 'data' is ambiguous
32 | data[idx++] = P(x, y);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:5:3: note: 'P data [20]'
5 | P data[MAX_N];
| ^~~~
|
s800935650
|
p00079
|
C++
|
#include <bits/stdc++.h>
#include <complex>
#define MAX_N 20
using namespace std;
typedef complex<double> P;
P data[MAX_N];
double distance(P a, P b) {
double diffx = b.real()-a.real(), diffy = b.imag()-a.imag();
return(sqrt(diffx*diffx+diffy*diffy));
}
double areaOfTriangle(P a, P b, P c) {
double ret;
double A = distance(a,b),B = distance(b,c),C = distance(c,a);
double z = (A+B+C)/2.0;
ret = sqrt(z*(z-A)*(z-B)*(z-C));
return(ret);
}
void solve(int len) {
double S = 0.0;
for(int r = 1; r < len-1; r++) {
S += areaOfTriangle(data[0], data[r], data[r+1]);
}
printf("%.6f\n", S);
}
int main(void) {
double x, y;
int idx = 0;
while(scanf("%lf,%lf", &x,&y) != EOF) {
data[idx++] = P(x, y);
}
solve(idx);
return(0);
}
|
a.cc: In function 'void solve(int)':
a.cc:24:29: error: reference to 'data' is ambiguous
24 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
from a.cc:1:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:6:3: note: 'P data [20]'
6 | P data[MAX_N];
| ^~~~
a.cc:24:38: error: reference to 'data' is ambiguous
24 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:6:3: note: 'P data [20]'
6 | P data[MAX_N];
| ^~~~
a.cc:24:47: error: reference to 'data' is ambiguous
24 | S += areaOfTriangle(data[0], data[r], data[r+1]);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:6:3: note: 'P data [20]'
6 | P data[MAX_N];
| ^~~~
a.cc: In function 'int main()':
a.cc:33:9: error: reference to 'data' is ambiguous
33 | data[idx++] = P(x, y);
| ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
344 | data(initializer_list<_Tp> __il) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
334 | data(_Tp (&__array)[_Nm]) noexcept
| ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
323 | data(const _Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note: 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
312 | data(_Container& __cont) noexcept(noexcept(__cont.data()))
| ^~~~
a.cc:6:3: note: 'P data [20]'
6 | P data[MAX_N];
| ^~~~
|
s834950420
|
p00079
|
C++
|
#include <complex>
#include <cmath>
typedef complex<double> xy_t;
xy_t P[110];
int main(){
int N = 0;
double x,y ;
while(scanf("%lf,%lf",&x,&y)){
P[N++] =xy_t(x,y);
}
double sum = 0.0;
for (int i=0;i+2<N;++i){
xy_t a=P[0],b=P[i+1], c= P[i+2];
sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
}
printf("%.6f\n",abs(sum));
}
|
a.cc:3:9: error: 'complex' does not name a type
3 | typedef complex<double> xy_t;
| ^~~~~~~
a.cc:4:1: error: 'xy_t' does not name a type
4 | xy_t P[110];
| ^~~~
a.cc: In function 'int main()':
a.cc:10:5: error: 'P' was not declared in this scope
10 | P[N++] =xy_t(x,y);
| ^
a.cc:10:13: error: 'xy_t' was not declared in this scope
10 | P[N++] =xy_t(x,y);
| ^~~~
a.cc:14:5: error: 'xy_t' was not declared in this scope
14 | xy_t a=P[0],b=P[i+1], c= P[i+2];
| ^~~~
a.cc:15:14: error: 'b' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
a.cc:15:23: error: 'a' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
a.cc:15:34: error: 'c' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
|
s943543784
|
p00079
|
C++
|
#include <complex>
#include <cmath>
typedef complex<double> xy_t;
xy_t P[110];
int main(){
int N = 0;
double x,y ;
while(scanf("%lf,%lf",&x,&y)){
P[N++] =xy_t(x,y);
}
double sum = 0.0;
for (int i=0;i+2<N;++i){
xy_t a=P[0],b=P[i+1], c= P[i+2];
sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
}
printf("%.6f\n",abs(sum));
}
|
a.cc:3:9: error: 'complex' does not name a type
3 | typedef complex<double> xy_t;
| ^~~~~~~
a.cc:4:1: error: 'xy_t' does not name a type
4 | xy_t P[110];
| ^~~~
a.cc: In function 'int main()':
a.cc:10:5: error: 'P' was not declared in this scope
10 | P[N++] =xy_t(x,y);
| ^
a.cc:10:13: error: 'xy_t' was not declared in this scope
10 | P[N++] =xy_t(x,y);
| ^~~~
a.cc:14:5: error: 'xy_t' was not declared in this scope
14 | xy_t a=P[0],b=P[i+1], c= P[i+2];
| ^~~~
a.cc:15:14: error: 'b' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
a.cc:15:23: error: 'a' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
a.cc:15:34: error: 'c' was not declared in this scope
15 | sum += ((b.real()-a.real())*(c.imag()-a.imag())+(c.real()-a.real())*(b.imag()-a.imag()))/2.0
| ^
|
s658311395
|
p00079
|
C++
|
#include<iostream>
#include<complex>
#include<cmath>
typedef complex<double> comp;
double crs_prod(comp a, comp b) { return (conj(a)*b).imag(); }
double c1, c2;
double area = 0;
comp z[20];
int n = 0;
int main(){
while(~scanf("%lf,%lf", &c1, &c2)){
z[n] = comp(c1, c2);
n++;
}
for(int i=1; i<n-1; i++){
area += crs_prod(z[i]-z[0], z[i+1]-z[0])/2;
}
printf("%f",area>0 ? area : -area);
return 0;
}
|
a.cc:4:9: error: 'complex' does not name a type
4 | typedef complex<double> comp;
| ^~~~~~~
a.cc:6:17: error: 'comp' was not declared in this scope
6 | double crs_prod(comp a, comp b) { return (conj(a)*b).imag(); }
| ^~~~
a.cc:6:25: error: 'comp' was not declared in this scope
6 | double crs_prod(comp a, comp b) { return (conj(a)*b).imag(); }
| ^~~~
a.cc:6:31: error: expression list treated as compound expression in initializer [-fpermissive]
6 | double crs_prod(comp a, comp b) { return (conj(a)*b).imag(); }
| ^
a.cc:10:1: error: 'comp' does not name a type
10 | comp z[20];
| ^~~~
a.cc: In function 'int main()':
a.cc:14:17: error: 'z' was not declared in this scope
14 | z[n] = comp(c1, c2);
| ^
a.cc:14:24: error: 'comp' was not declared in this scope
14 | z[n] = comp(c1, c2);
| ^~~~
a.cc:18:34: error: 'z' was not declared in this scope
18 | area += crs_prod(z[i]-z[0], z[i+1]-z[0])/2;
| ^
a.cc:18:56: error: 'crs_prod' cannot be used as a function
18 | area += crs_prod(z[i]-z[0], z[i+1]-z[0])/2;
| ^
|
s971201040
|
p00079
|
C++
|
#include <complex>
#include <cmath>
#include <iostream>
using namespace std;
typedef complex<double> xy_t;
xy_t P[110], a, b, c;
double cross_product(xy_t a,xy_t b) {
return (conj(a)*b).imag()/2.0;
}
int main () {
int N=0; //??????????????????????????°???N??¨??????
double x, y;
while (cin>x && cin>y) {
P[N++] = xy_t(x,y);
}
//??¢????¨????
double sum = 0.0;
for (int i=0; i+2<N; ++i) {
xy_t b=P[i+1], c=P[i+2];
sum += cross_product(b, c);
}
cout << abs(sum) <<endl;
}
|
a.cc: In function 'int main()':
a.cc:15:13: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
15 | while (cin>x && cin>y) {
| ~~~^~
| | |
| | double
| std::istream {aka std::basic_istream<char>}
a.cc:15:13: note: candidate: 'operator>(int, double)' (built-in)
15 | while (cin>x && cin>y) {
| ~~~^~
a.cc:15:13: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/bits/specfun.h:43,
from /usr/include/c++/14/cmath:3906,
from /usr/include/c++/14/complex:44,
from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
15 | while (cin>x && cin>y) {
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
507 | operator>(const reverse_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
1714 | operator>(const move_iterator<_IteratorL>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1714:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
1774 | operator>(const move_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1774:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
15 | while (cin>x && cin>y) {
| ^
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/istream:40,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45:
/usr/include/c++/14/string_view:695:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
695 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:695:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/string_view:702:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
702 | operator> (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:702:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::basic_istream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/string_view:710:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
710 | operator> (__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:710:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'double'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/basic_string.h:3915:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3915 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3915:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/basic_string.h:3929:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3929 | operator>(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3929:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/basic_string.h:3942:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3942 | operator>(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3942:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: mismatched types 'const _CharT*' and 'std::basic_istream<char>'
15 | while (cin>x && cin>y) {
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2619:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2619 | operator>(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2619:5: note: template argument deduction/substitution failed:
a.cc:15:14: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
15 | while (cin>x && cin>y) {
| ^
a.cc:15:22: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double')
15 | while (cin>x && cin>y) {
| ~~~^~
| | |
| | double
| std::istream {aka std::basic_istream<char>}
a.cc:15:22: note: candidate: 'operator>(int, double)' (built-in)
15 | while (cin>x && cin>y) {
| ~~~^~
a.cc:15:22: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1058 | operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1058:5: note: template argument deduction/substitution failed:
a.cc:15:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::pair<_T1, _T2>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
462 | operator>(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:462:5: note: template argument deduction/substitution failed:
a.cc:15:23: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
15 | while (cin>x && cin>y) {
| ^
/usr/include/c++/14/bits/stl_iterator.h:507:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>(const reverse_iterator<_Iterator>&, const r
|
s988758006
|
p00079
|
C++
|
#include <iostream>
#include <vector>
#include <algorithm>
#include <complex.h>
#include <cmath.h>
using namespace std;
type of complex<double> xy_t;
xy_t P[110];
int main(){
int N = 0;
double x,y;
while(scanf("%lf,%lf",&x, &y)) {
P[N++] = xy_t(x,y);
double sum = 0.0;
for(int i = 0; i+ 2<N; ++i) {
xy_t a=P[0], b=P[i+1], c=P[i+2];
sum += conj(b-a)*(c-a).imag();
}
pritntf("%.6f\n",abs(sum));
}
return 0;
}
|
a.cc:5:10: fatal error: cmath.h: No such file or directory
5 | #include <cmath.h>
| ^~~~~~~~~
compilation terminated.
|
s852182363
|
p00079
|
C++
|
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;
xy_t P[110];
int main(){
int N = 0;
double x,y;
while(-scanf("%lf,%lf",&x, &y)) {
P[N++] = xy_t(x,y);
double sum = 0.0;
for(int i = 0; i+ 2<N; ++i) {
xy_t a=P[0], b=P[i+1], c=P[i+2];
sum += (conj(b-a)*(c-a)).imag()/2;
}
}
printf("%.6f\n",abs(sum));
return 0;
}
|
a.cc: In function 'int main()':
a.cc:25:23: error: 'sum' was not declared in this scope
25 | printf("%.6f\n",abs(sum));
| ^~~
|
s427468172
|
p00079
|
C++
|
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
double x[20], y[20], a, b, c, s = 0.0, z;
int i;
for (i = 0; i < 20; i++){
if (scanf_s("%lf,%lf", &x[i], &y[i]) == EOF) break;
}
for (int j = 1; j < i - 1; j++){
a = sqrt((x[j] - x[0]) * (x[j] - x[0]) + (y[j] - y[0]) * (y[j] - y[0]));
b = sqrt((x[j + 1] - x[0]) * (x[j + 1] - x[0]) + (y[j + 1] - y[0]) * (y[j + 1] - y[0]));
c = sqrt((x[j + 1] - x[j]) * (x[j + 1] - x[j]) + (y[j + 1] - y[j]) * (y[j + 1] - y[j]));
z = (a + b + c) / 2.0;
s += sqrt(z * (z - a) * (z - b) * (z - c));
}
printf("%.5f\n",s);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:21: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | if (scanf_s("%lf,%lf", &x[i], &y[i]) == EOF) break;
| ^~~~~~~
| scanf
|
s842987726
|
p00079
|
C++
|
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <ctime>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <complex>
using namespace std;
typedef complex<double> xy_t;
char c;
xy_t P[20];
const int MAX = 10000000;
int main(void){
for (int i = 0; i < 20; ++i){
P[i] = xy_t(MAX, MAX);
}
for (int i = 0; i < 20; ++i){
double x, y;
cin >> x >> c >> y;
P[i] = xy_t(x, y);
}
double ans = 0;
for(int i = 1; i < 20; i++){
if(P[i + 1].real() != MAX){
ans += cross_product(xy_t (P[i] - P[0]), xy_t (P[i + 1] - P[0]))
}
}
cout << ans << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:37:32: error: 'cross_product' was not declared in this scope
37 | ans += cross_product(xy_t (P[i] - P[0]), xy_t (P[i + 1] - P[0]))
| ^~~~~~~~~~~~~
|
s192851461
|
p00079
|
C++
|
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
int main() {
typedef complex<double> xy;
double x1, y1, x2, y2, s;
xy z1, z2;
s = 0.0;
scanf( "%lf, %lf", &x1, &y1 );
while ( scanf( "%lf, %lf", &x2, &y2 ) {
z1 = xy( x1, y1 );
z2 = xy( x2, y2 );
s += ( conj( z1 ) * z2 ).real() / 2;
x1 = x2;
y1 = y2;
}
printf( "%.6f?\n", abs(s) );
}
|
a.cc: In function 'int main()':
a.cc:12:46: error: expected ')' before '{' token
12 | while ( scanf( "%lf, %lf", &x2, &y2 ) {
| ~ ^~
| )
|
s193274519
|
p00079
|
C++
|
#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
typedef complex<double> xy;
xy p[20];
int n = 0;
double x, y, s;
while ( ~scanf( "%lf, %lf", &x, &y ) ) {
p[n++] = xy( x, y );
}
for ( i = 1; i < n - 1; i++ ) {
s += ( conj( p[i] - p[0] ) * ( p[i + 1] - p[0] ) ).real() / 2;
}
printf( "%.6f\n", abs(s) );
}
|
a.cc: In function 'int main()':
a.cc:15:15: error: 'i' was not declared in this scope
15 | for ( i = 1; i < n - 1; i++ ) {
| ^
|
s534457604
|
p00079
|
C++
|
#include <iostream>
#include <complex>
#include <cmath>
#include <cstdio>
using namespace std;
int main() {
typedef complex<double> xy;
xy p[20];
int n = 0;
double x, y, s;
while ( ~scanf( "%lf, %lf", &x, &y ) ) {
p[n++] = xy( x, y );
}
for ( i = 1; i < n - 1; i++ ) {
s += ( conj( p[i] - p[0] ) * ( p[i + 1] - p[0] ) ).imag() / 2;
}
printf( "%.6f\n", abs(s) );
}
|
a.cc: In function 'int main()':
a.cc:15:15: error: 'i' was not declared in this scope
15 | for ( i = 1; i < n - 1; i++ ) {
| ^
|
s830632382
|
p00079
|
C++
|
include <iostream>
#include <stdio.h>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;
double dot_product(xy_t a, xy_t b){
return (conj(a)*b).real();
}
double cross_product(xy_t a, xy_t b){
return (conj(a)*b).imag();
}
int main(){
xy_t o,a,b;
double sum = 0,x,y;
scanf("%lf,%lf", &x, &y);
o = xy_t (x, y);
scanf("%lf,%lf", &x, &y);
a = xy_t (x, y) - o;
b = a;
while(~scanf("%lf,%lf", &x, &y)){
a = xy_t (x, y) - o;
sum += cross_product(a,b) / 2.0;
b = a;
}
printf("%.6f\n", abs(sum));
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/math.h:275,
from /usr/include/c++/14/cmath:47,
from /usr/include/c++/14/complex:44,
from a.cc:3:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
399 | __MATHDECL (__uintmax_t, ufromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:382:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
382 | __MATHDECL (__intmax_t, fromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:387:1: error: '__uintmax_t' does not name a type; did you mean '__uint128_t'?
387 | __MATHDECL (__uintmax_t, ufromfp,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:393:1: error: '__intmax_t' does not name a type; did you mean '__int128_t'?
393 | __MATHDECL (__intmax_t, fromfpx,, (_Mdouble_ __x, int __round,
| ^~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:399:1: error: '__uintmax_t' does not name a type; did you
|
s355853587
|
p00079
|
C++
|
#include <complex>
#include <cmath>
#include <stdio.h>
typedef complex<double> xy_t;
using namespace std;
xy_t P[110];
int main(){
int N = 0;
double x, y;
while (~scanf("%lf,%lf", &x, &y)) {
P[N++] = xy_t(x,y);
}
double sum = 0.0;
for (int i = 0; i+2 < N; i++) {
xy_t a = P[0], b = P[i+1], c = P[i+2];
sum += (conj(b-a)*(c-a)).imag())/2;
}
printf("%.6f\n",abs(sum));
}
|
a.cc:4:9: error: 'complex' does not name a type
4 | typedef complex<double> xy_t;
| ^~~~~~~
a.cc:7:1: error: 'xy_t' does not name a type
7 | xy_t P[110];
| ^~~~
a.cc: In function 'int main()':
a.cc:13:17: error: 'P' was not declared in this scope
13 | P[N++] = xy_t(x,y);
| ^
a.cc:13:26: error: 'xy_t' was not declared in this scope
13 | P[N++] = xy_t(x,y);
| ^~~~
a.cc:17:17: error: 'xy_t' was not declared in this scope
17 | xy_t a = P[0], b = P[i+1], c = P[i+2];
| ^~~~
a.cc:18:30: error: 'b' was not declared in this scope
18 | sum += (conj(b-a)*(c-a)).imag())/2;
| ^
a.cc:18:32: error: 'a' was not declared in this scope
18 | sum += (conj(b-a)*(c-a)).imag())/2;
| ^
a.cc:18:36: error: 'c' was not declared in this scope
18 | sum += (conj(b-a)*(c-a)).imag())/2;
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.