submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s961152384 | p03723 | C++ | #include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
int main() {
int a,b,c; cin>>a>>b>>c;
if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
return 0;}
if(a==b&&b==c){cout<<-1<<endl;
return 0;}
int ab=abs(a-b);
int bc=abs(b-c);
int ca=abs(c-a);
ll count==0;
bool equ=false
while(!(ab&2==1||bc%2==1||ca%2==1)){
ab/=2;
bc/=2;
ca/=2;
count++;
if(ab==0&&bc==0&&ca==0){cout<<-1<<endl;
equ=true;
break;}
if(!equ)
cout<<count<<endl;
}
| a.cc: In function 'int main()':
a.cc:9:37: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: couldn't deduce template parameter '_Bi_iter'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: couldn't deduce template parameter '_Bi_iter'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::__cxx11::sub_match<_BiIter>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h: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:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::pair<_T1, _T2>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::reverse_iterator<_Iterator>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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:9:38: note: 'std::basic_ostream<char>' is not derived from 'const std::move_iterator<_IteratorL>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view: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:9:38: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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:9:38: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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:9:38: note: couldn't deduce template parameter '_CharT'
9 | if(a&2==1||b%2==1||c%2==1){cout<<0<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 a |
s573638278 | p03723 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
#define sz(x) ((int)(x).size())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MEMSET(v, h) memset((v), h, sizeof(v))
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define pb push_back
#define mp make_pair
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll INF = 1LL<<58;
int main(){
ll A, B, C;
ll ans = 0;
cin >> A >> B >> C;
ll tempA = A;
ll tempB = B;
ll tempC = C;
if(A == B && A == C){
cout << -1 << endl;
return 0;
}
ll temp;
ll temp2;
while(tempA % 2 == 0 && tempB % 2 == 0 && tempC % 2 == 0){
temp = tempB / 2 + tempC / 2;
temp2 = tempA / 2 + tempC / 2;
tempC = tempA / 2 + tempB / 2;
tempA = temp;
tempB = temp2;
++ans;
}
cout << ans << endl;
} | a.cc:35:17: error: extended character is not valid in an identifier
35 | if(A == B && A == C){
| ^
a.cc: In function 'int main()':
a.cc:35:17: error: 'B\U00003000' was not declared in this scope
35 | if(A == B && A == C){
| ^~~
|
s359769555 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int A,B,C;
cin>>A>>B>>C;
int it;
while(A%2==0&&B%2==0&&C%2==0){
int a=A/2,b=B/2,c=C/2;
B=a+c;
C=a+b;
A=b+c;
it++;
if(it>1000000){
cout<<-1<<endl;
return 0;
}`
}
cout<<it<<endl;
}
| a.cc:18:6: error: stray '`' in program
18 | }`
| ^
|
s765158217 | p03723 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int A,B,C;
cin >> A >> B >> C;
long long int D=max(abs(A-B),max(abs(B-C),abs(C-A)));
if (D==0)cout << -1 <<endl;
int count=0;
else {
if (A%2==1 || B%2==1 || C%2==1)cout << count <<endl;
else {
count++;
long long int D,E,F;
D=(B+C)/2;
E=(C+A)/2;
F=(A+B)/2;
A=D;
B=E;
C=F;
}
}
} | a.cc: In function 'int main()':
a.cc:9:3: error: 'else' without a previous 'if'
9 | else {
| ^~~~
|
s550199015 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c;
int r=0;
double arr[3];
int p=-1;
double t1,t2,t3;
cin>>a>>b>>c;
if(a==b&&a==c&&b==c)
{
cout<<p<<endl;
}
else if(a%2==1||b%2==1||c%2==1)
{
cout<<p<<endl;
}
else
{
arr[0]=a;
arr[1]=b;
arr[2]=c;
sort(arr,arr+3);
a=arr[0];
b=arr[1];
c=arr[2];
while(1)
{
a=a/2;
b=b/2;
c=c/2;
t1=a;
a=a+b;
b=b+c;
c=c+t1;
arr[0]=a;
arr[1]=b;
arr[2]=c;
sort(arr,arr+3);
a=arr[0];
b=arr[1];
c=arr[2];
if(arr[0]<1)
{
cout<<p<<endl;
}
else
{
r++;
if(a%2==1||b%2==1||c%2==1)
{
cout<<r<<endl;
break;
}
}
}
}
}
| a.cc: In function 'int main()':
a.cc:18:14: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:18:22: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:18:30: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:21: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:29: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:37: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
|
s216369432 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c;
int r=0;
int arr[3];
int p=-1;
int t1,t2,t3;
cin>>a>>b>>c;
if(a==b&&a==c&&b==c)
{
cout<<p<<endl;
}
else if(a%2==1||b%2==1||c%2==1)
{
cout<<p<<endl;
}
else
{
arr[0]=a;
arr[1]=b;
arr[2]=c;
sort(arr,arr+3);
a=arr[0];
b=arr[1];
c=arr[2];
while(1)
{
a=a/2;
b=b/2;
c=c/2;
t1=a;
a=a+b;
b=b+c;
c=c+t1;
arr[0]=a;
arr[1]=b;
arr[2]=c;
sort(arr,arr+3);
a=arr[0];
b=arr[1];
c=arr[2];
if(arr[0]<1)
{
cout<<p<<endl;
}
else
{
r++;
if(a%2==1||b%2==1||c%2==1)
{
cout<<r<<endl;
break;
}
}
}
}
}
| a.cc: In function 'int main()':
a.cc:18:14: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:18:22: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:18:30: error: invalid operands of types 'double' and 'int' to binary 'operator%'
18 | else if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:21: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:29: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
a.cc:56:37: error: invalid operands of types 'double' and 'int' to binary 'operator%'
56 | if(a%2==1||b%2==1||c%2==1)
| ~^~
| | |
| | int
| double
|
s444479794 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
ll a, b, c; cin >> a >> b >> c;
ll ans;
for(int i = 0; i < 30; i++){
if(a == b && b == c){
ans = -1; break;
}
if(a*b*c % 2 == 1){
ans = i; break;
}
ll s = a, t = b; u = c;
a = (t+u)/2;
b = (u+s)/2;
c = (s+t)/2;
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:20:26: error: 'u' was not declared in this scope
20 | ll s = a, t = b; u = c;
| ^
|
s746364858 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 10000000005
#define NIL -1
int main(){
ll a, b, c; cin >> a >> b >> c;
ll s = a, t = b, u = c;
ll ans = 0;
for(ll i = 0;; i++){
if(a == b && b == c) {
if(a % 2 == 0)ans = -1;
else ans = i;
if(a%2==1 || b%2== 1 || c%2==1) ans = i;
else {
a += (t+u)/2, b += (s+u)/2, c += (s+t)/2;
s = a, t = b, u = c;
}
cout << ans << endl;
}
} | a.cc: In function 'int main()':
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:10:11: note: to match this '{'
10 | int main(){
| ^
|
s563287107 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 10000000005
#define NIL -1
int main(){
ll a, b, c; cin >> a >> b >> c;
ll s = a, t = b, u = c;
ll ans = 0;
for(ll i = 0;; i++){
if(a == b && b == c) {
if(a % 2 == 0)ans = -1;
else ans = i;
if(a%2==! || b%2== ! || c%2==1) ans = i;
else {
a += (t+u)/2, b += (s+u)/2, c += (s+t)/2;
s = a, t = b, u = c;
}
cout << ans << endl;
}
} | a.cc: In function 'int main()':
a.cc:18:19: error: expected primary-expression before '||' token
18 | if(a%2==! || b%2== ! || c%2==1) ans = i;
| ^~
a.cc:18:30: error: expected primary-expression before '||' token
18 | if(a%2==! || b%2== ! || c%2==1) ans = i;
| ^~
a.cc:25:2: error: expected '}' at end of input
25 | }
| ^
a.cc:10:11: note: to match this '{'
10 | int main(){
| ^
|
s303734391 | p03723 | C++ | a, b, c = [int(x) for x in input().strip().split()]
def f(a, b, c, count):
if a % 2 == 1 and b % 2 == 1 and c % 2 == 1:
count += 1
return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
count += 1
return f(a/2+b/2, c/2+b/2, a/2+c/2, count)
else:
return count
if a == b and b == c:
print(-1)
else:
print(f(a, b, c, 0))
| a.cc:1:1: error: 'a' does not name a type
1 | a, b, c = [int(x) for x in input().strip().split()]
| ^
|
s340375983 | p03723 | C++ | #include<iostream>
using namespace std;
int main(){
long A,B,C;
cin>>A>>B>>C;
int ans=0;
if(A%2==!||B%2==1||C%2==1){
cout<<0<<endl;
return 0;
}
if(A==B&&B==C){
cout<<-1<<endl;
return 0;
}
else{
bool ccc=true;
while(ccc){
ans++;
if(A%2==1&&B%2==1&&C%2==1){
break;
}
else{
A/=2;
B/=2;
C/=2;
if(A%2==1&&((A%2)!=(B%2)||(A%2)!=(C%2))||B%2==1&&((B%2)!=(A%2)||(B%2)!=(C%2))||C%2==1&&((C%2)!=(A%2)||(C%2)!=(B%2))){
ccc=0;
break;
}
}
}
}
cout<<ans<<endl;
}
| a.cc: In function 'int main()':
a.cc:13:14: error: expected primary-expression before '||' token
13 | if(A%2==!||B%2==1||C%2==1){
| ^~
|
s535274226 | p03723 | Java | import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class Main1 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int[] P = new int[3];
int i = 0;
while(i < 3) {
P[i] = scan.nextInt();
i++;
}
if((P[0] == P[1]) && (P[1] == P[2])){
System.out.println(-1);
return;
}
int x=0,y=0,z=0;
int count = 0;
while(true){
x = P[0]/2;
y = P[1]/2;
z = P[2]/2;
P[0] = 0;
P[1] = 0;
P[2] = 0;
P[0] = y + z;
P[1] = x + z;
P[2] = x + y;
count++;
if((P[0]%2 != 0) || (P[1]%2 != 0) || (P[2]%2 != 0)){
System.out.print(count);
return;
}
}
}
} | Main.java:8: error: class Main1 is public, should be declared in a file named Main1.java
public class Main1 {
^
1 error
|
s719803668 | p03723 | Java | import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class A_Cookie {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int[] P = new int[3];
int i = 0;
while(i < 3) {
P[i] = scan.nextInt();
i++;
}
if((P[0] == P[1]) && (P[1] == P[2])){
System.out.println(-1);
return;
}
int x=0,y=0,z=0;
int count = 0;
while(true){
x = P[0]/2;
y = P[1]/2;
z = P[2]/2;
P[0] = 0;
P[1] = 0;
P[2] = 0;
P[0] = y + z;
P[1] = x + z;
P[2] = x + y;
count++;
if((P[0]%2 != 0) || (P[1]%2 != 0) || (P[2]%2 != 0)){
System.out.print(count);
return;
}
}
}
} | Main.java:8: error: class A_Cookie is public, should be declared in a file named A_Cookie.java
public class A_Cookie {
^
1 error
|
s272566123 | p03723 | Java | import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class A_Cookie {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int[] P = new int[3];
int i = 0;
while(i < 3) {
P[i] = scan.nextInt();
i++;
}
if((P[0] == P[1]) && (P[1] == P[2])){
System.out.println(-1);
return;
}
int x=0,y=0,z=0;
int count = 0;
while(true){
x = P[0]/2;
y = P[1]/2;
z = P[2]/2;
P[0] = 0;
P[1] = 0;
P[2] = 0;
P[0] = y + z;
P[1] = x + z;
P[2] = x + y;
count++;
if((P[0]%2 != 0) || (P[1]%2 != 0) || (P[2]%2 != 0)){
System.out.print(count);
return;
}
}
}
} | Main.java:8: error: class A_Cookie is public, should be declared in a file named A_Cookie.java
public class A_Cookie {
^
1 error
|
s568331957 | p03723 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args)throws Exception {
BufferedReader br = new BufferedReader ( new InputStreamReader(System.in));
String [] input = br.readLine().split(" ");
int A = Integer.parseInt(input[0]);
int B = Integer.parseInt(input[1]);
int C = Integer.parseInt(input[2]);
int defineA= A;
int defineB = B;
int defineC = C;
int result = 0;
if(Even(A,B,C)) {
result = -1;
}else {
while(true) {
int A2 = A/2;
int B2 = B/2;
int C2 = C/2;
A = B2 + C2;
B = A2 + C2;
C = A2 + B2;
result++;
if(Even(A) || Even(B) || Even(C)) {
break;
}/*else if(defineA == A && defineB == B && defineC == C) {
result = -1;
break;
}*/
}
}
System.out.println(result);
}
private static boolean Even(int A,int B,int C) {
return (A % 2!=0) && (B % 2!=0) && (C % 2!=0);
}
private static boolean Even(int var) {
return (var % 2!=0);
}
| Main.java:42: error: reached end of file while parsing
}
^
1 error
|
s367200005 | p03723 | C++ | #include <iostream>
#include<string>
using namespace std;
int main() {
long long a, b,c;
int iwa = 0;
cin >> a >> b>>c;
for (;;) {
if (a % 2 != 0 || b % 2 != 0 || c % 2 != 0) { cout << iwa << endl; break; }
else if (a == b && b == c) { cout << -1 << endl; break; }
a = b / 2 + c / 2;
b = a / 2 + c / 2;
c = b / 2 + a / 2;
iwa++;
} | a.cc: In function 'int main()':
a.cc:15:14: error: expected '}' at end of input
15 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s811224828 | p03723 | C++ | #include <iostream>
#include <stdio.h>
#include <algorithm>
//#include <string>
//#include <math.h>
//#include <vector>
using namespace std;
int main() {
int a, b, c;
long int a0, b0, c0;
long int counter=0;
cin >> a0 >> b0 >> c0;
while(a0%2==0 && b0%2==0 && c0%2==0){
counter++;
a = b0/2+c0/2;
b = c0/2+a0/2;
c = a0/2+b0/2;
if(a==b && b==c){
counter = -1;
break;
}
a0=a;b0=b;c0=c;
}
cout << counter;
return 0;
}
| a.cc:34:1: error: extended character is not valid in an identifier
34 |
| ^
a.cc:34:1: error: extended character is not valid in an identifier
a.cc:34:1: error: '\U00003000\U00003000' does not name a type
34 |
| ^~~~
|
s191757327 | p03723 | C++ | #include<stdio.h>
#include<iostream>
#include<string>
#include<math.h>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<time.h>
#include<ctime>
#include<functional>
#define int long long
#define INT INT_MAX
#define LONG LLONG_MAX
#define f(i,n) for(int i=0;i<(n);i++)
#define P pair<int,int>
typedef long long ll;
using namespace std;
char mutu(int a,int b) {
if (a > b) return '>';
else return '<';
}
signed main() {
int a, b, c;
cin >> a >> b >> c;
if (a == b && b == c) puts("-1");
else {
int n = 0;
while (!(a%2||b%2||c%2)) {
int x = a, y = b, z = c;
a = (y + z) / 2;
b = (x + z) / 2;
c = (y + z) / 2;
n++;
}
}
cout << n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:41:17: error: 'n' was not declared in this scope
41 | cout << n << endl;
| ^
|
s700709678 | p03723 | C++ | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
const int mnx = 3e5 + 9;
const int mod = 1e9 + 7;
int n, m;
int a, b;
int cnt[mnx];
int main(){
cin>>n>>m;
for(int i=0; i<m; i++){
cin>>a>>b;
cnt[a]++; cnt[b]++;
}
for(int i=1; i<=n; i++){
if(cnt[i] % 2 != 0){
cout<<"NO\n";
return 0;
}
}
cout<<"YES\n";
return 0;
}
return 0;
}
| a.cc:33:1: error: expected unqualified-id before 'return'
33 | return 0;
| ^~~~~~
a.cc:35:1: error: expected declaration before '}' token
35 | }
| ^
|
s815862934 | p03723 | C | #include<iostream>
using namespace std;
int main()
{
long long A, B, C;
while( cin >> A >> B >> C ){
if(A%2 == 1 || B%2 == 1 || C%2 == 1)
cout << "0" << endl;
else{
long long cnt = 0;
for( ; ; ){
int t1, t2, t3;
t1 = A;
t2 = B;
t3 = C;
A = t2/2 + t3/2;
B = t1/2 + t3/2;
C = t1/2 + t2/2;
cnt++;
if( A%2 == 1 || B%2 == 1 || C%2 == 1 ) break;
if( cnt > 1000 ) break;
}
if( cnt > 1000 ) cout << "-1" << endl;
else cout << cnt << endl;
}
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s331253651 | p03723 | C++ | #include</dev/console> | a.cc:1:9: fatal error: /dev/console: No such file or directory
1 | #include</dev/console>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s087306283 | p03723 | C++ | #include<con> | a.cc:1:9: fatal error: con: No such file or directory
1 | #include<con>
| ^~~~~
compilation terminated.
|
s229925051 | p03723 | C++ | #include<con> | a.cc:1:9: fatal error: con: No such file or directory
1 | #include<con>
| ^~~~~
compilation terminated.
|
s242129296 | p03723 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
bool compare(int a,int b)
{
return a>b;
}
int main(){
long long double a,b,c,e,f,g;
cin>>a>>b>>c;
int n=0;
while(n<1000000){
n++;
e=a;g=b;f=c;
a=(g+f)/2.0;
b=(e+f)/2.0;
c=(e+g)/2.0;
if(a>(int)a||b>(int)b||c>(int)c){
n--;
cout<<n<<endl;
break;
}
}
if(n==1000000)
printf("-1\n");
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: 'long long' specified with 'double'
10 | long long double a,b,c,e,f,g;
| ^~~~
a.cc:10:14: error: 'long long' specified with 'double'
a.cc:10:14: error: 'long long' specified with 'double'
a.cc:10:14: error: 'long long' specified with 'double'
a.cc:10:14: error: 'long long' specified with 'double'
a.cc:10:14: error: 'long long' specified with 'double'
|
s918599020 | p03723 | C | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int a,b,c,ta,tb;
while(cin>>a>>b>>c){
for(int i=1;;i++){
ta=a;tb=b;
a=b/2+c/2;
b=ta/2+c/2;
c=ta/2+tb/2;
if(a%2==1 || b%2==1 || c%2==1){
cout<<i<<endl;break;
}
if(a==b && a==c){
cout<<"-1"<<endl;break;
}
}
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s320705379 | p03723 | C | #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
int a,b,c,ta,tb;
while(cin>>a>>b>>c){
for(int i=1;;i++){
ta=a;tb=b;
a=b/2+c/2;
b=ta/2+c/2;
c=ta/2+tb/2;
if(a%2==1 || b%2==1 || c%2==1){
cout<<i;break;
}
if(a==b && a==c){
cout<<"-1";break;
}
}
}
return 0;
} | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s660838637 | p03723 | Java | a,b,c = map(int, input().split())
for i in range(100):
if a%2==1 or b%2==1 or c%2==1:
break
a, b, c = (a+b)//2,(b+c)//2,(c+a)//2
ans = i
if i == 99:
ans = -1
print(ans)
| Main.java:1: error: class, interface, enum, or record expected
a,b,c = map(int, input().split())
^
1 error
|
s836468082 | p03723 | C++ | #include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;
ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}
int main(){
ll a,b,c;
cin>>a>>b>>c;
ll ans = 0;
if(a==b&&b==c&&a%2==0){
cout<<-1<<endl; return 0;
}
while(a%2==0&&b%2==0&&c%2==0){
ans++;
int x=(b+c)/2,y=(c+a)/2,z=(a+b)/2;
a=x,y=b,z=c;
}
cout<<ans<<endl;
} | a.cc:30:20: error: extended character is not valid in an identifier
30 | cout<<-1<<endl; return 0;
| ^
a.cc: In function 'int main()':
a.cc:30:20: error: '\U00003000return' was not declared in this scope
30 | cout<<-1<<endl; return 0;
| ^~~~~~~~
|
s303227707 | p03723 | C++ | def count(seq):
seq = sorted(seq)
x , y = [seq[1] - seq[0], seq[2] - seq[0]]
if x == 0 and y == 0:
return -1
elif x == 0:
k = x & -x
elif y == 0:
k = y & -y
else:
k = min(x & -x, y & -y)
foo = 0
while (k & 1) == 0:
k >>= 1
foo += 1
return foo
def main():
seq = [int(x) for x in raw_input().strip().split()]
print count(seq)
if __name__ == '__main__':
main() | a.cc:22:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
22 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
1 | def count(seq):
| ^~~
|
s434991321 | p03723 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
if(a==b==c){
cout<<"-1"<<endl;
}
int aa=a,bb=b,cc=c,count=0;
else{
while(a%2==0&&b%2==0&&c%2==0){
a=bb/2+cc/2;
b=cc/2+aa/2;
c=aa/2+bb/2;
aa=a;
bb=b;
cc=c;
count+=1;
}
cout<<(count-count%3)/3<<endl;
}
} | a.cc: In function 'int main()':
a.cc:10:3: error: 'else' without a previous 'if'
10 | else{
| ^~~~
|
s444789780 | p03723 | C++ | #include <iostream>
#include <algorithm>
#include<string>
#include<cmath>
#include<stack>
#include <vector>
#include<queue>
#include <random>
#include <cstdint>
#include <bitset>
#include <iomanip>
using namespace std;
int main() {
int a[3],b=0;
for (int i = 0; i < 3; i++) {
scanf_s("%d", &a[i]);
a[i] %= 4;
if (a[i] % 2 == 1) {
cout << 0 << endl;
return 0;
}
b += a[i];
}
if (b == 0)cout << 3 << endl;
else if (b == 6)cout << -1 << endl;
else cout << 1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:17:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
17 | scanf_s("%d", &a[i]);
| ^~~~~~~
| scanf
|
s128607170 | p03723 | C++ | #include <iostream>
using namespace std;
int main(){
int a,b,c;
cin >> a >> b >> c;
for(int i=0;i<50000000;i++){
if(a%2==1||b%2==1||c%2==1){cout << i << endl; return 0;}
aa = (b+c) / 2;
bb = (a+c) / 2;
cc = (a+b) / 2;
a = aa; b = bb; c = cc;
}
cout << -1 << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'aa' was not declared in this scope; did you mean 'a'?
9 | aa = (b+c) / 2;
| ^~
| a
a.cc:10:5: error: 'bb' was not declared in this scope; did you mean 'b'?
10 | bb = (a+c) / 2;
| ^~
| b
a.cc:11:5: error: 'cc' was not declared in this scope; did you mean 'c'?
11 | cc = (a+b) / 2;
| ^~
| c
|
s156011382 | p03723 | C++ | a,b,c=list(map(int,input().split()))
ans=0
while 1:
if a%2!=0 or b%2!=0 or c%2!=0:
print(ans)
break
if a==b and b==c:
print('-1')
break
a,b,c=(b+c)>>1,(a+c)>>1,(a+b)>>2
ans+=1; | a.cc:8:23: warning: multi-character character constant [-Wmultichar]
8 | print('-1')
| ^~~~
a.cc:1:1: error: 'a' does not name a type
1 | a,b,c=list(map(int,input().split()))
| ^
|
s234257604 | p03723 | C++ | a,b,c=list(map(int,input().split()))
if a == b and a == c :
ans = -1
else:
ans = int(0)
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
ta = b/2 + c/2
tb = a/2 + c/2
tc = a/2 + b/2
a = ta
b = tb
c = tc
ans += 1
print(ans) | a.cc:1:1: error: 'a' does not name a type
1 | a,b,c=list(map(int,input().split()))
| ^
|
s817288009 | p03723 | C++ | #include<bits/stdc++.h>
#define pi 3.141592653897932384626
//freopen("std.in","r",stdin);freopen("std.out","w",stdout);
using namespace std;
int main()
{
long a,b,c;
cin>>a>>b>>c;
long x,y,z;
long k=0;
if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
while(k<10000000){
k++;
x=(a+b)/2;
y=(a+c)/2;
z=(b+c)/2;
if(x%2==1||y%2==1||z%2==1){cout<<k<<endl;return 0;}
a=x;b=y;c=z;
}
cout<<-1<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:39: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ~~~~~~~^~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181,
from a.cc:1:
/usr/include/c++/14/bits/regex.h:1143:5: note: candidate: 'template<class _BiIter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const sub_match<_BiIter>&)'
1143 | operator<(const sub_match<_BiIter>& __lhs, const sub_match<_BiIter>& __rhs)
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1143:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&, const sub_match<_BiIter>&)'
1224 | operator<(const __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1224:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'std::__cxx11::__sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: candidate: 'template<class _Bi_iter, class _Ch_traits, class _Ch_alloc> bool std::__cxx11::operator<(const sub_match<_BiIter>&, __sub_match_string<_Bi_iter, _Ch_traits, _Ch_alloc>&)'
1317 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1317:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type*, const sub_match<_BiIter>&)'
1391 | operator<(typename iterator_traits<_Bi_iter>::value_type const* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1391:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: couldn't deduce template parameter '_Bi_iter'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type*)'
1485 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1485:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const typename std::iterator_traits<_Iter>::value_type&, const sub_match<_BiIter>&)'
1560 | operator<(typename iterator_traits<_Bi_iter>::value_type const& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1560:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: couldn't deduce template parameter '_Bi_iter'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: candidate: 'template<class _Bi_iter> bool std::__cxx11::operator<(const sub_match<_BiIter>&, const typename std::iterator_traits<_Iter>::value_type&)'
1660 | operator<(const sub_match<_Bi_iter>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/regex.h:1660:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::sub_match<_BiIter>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/bits/stl_pair.h: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:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator<(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
448 | operator<(const reverse_iterator<_Iterator>& __x,
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:448:5: note: template argument deduction/substitution failed:
a.cc:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/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:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/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:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/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:11:40: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/string_view: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:11:40: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/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:11:40: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
11 | if(a%2==1||b%2==1||c%2==1){cout<<k<endl;return 0;}
| ^~~~
/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 | opera |
s871901821 | p03723 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CookieExchanges {
class Program {
static void Main(string[] args) {
string[] s = Console.ReadLine().Split();
int a = int.Parse(s[0]);
int b = int.Parse(s[1]);
int c = int.Parse(s[2]);
int ans = 0;
if (a == b && b == c) {
if (a % 2 == 0) {
Console.WriteLine(-1);
return;
}
else {
Console.WriteLine(0);
return;
}
}
while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
int tmpA = a / 2, tmpB = b / 2, tmpC = c / 2;
a = tmpB + tmpC;
b = tmpA + tmpC;
c = tmpA + tmpB;
ans++;
}
Console.WriteLine(ans);
}
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Threading.Tasks;
| ^~~~~~
a.cc:9:26: error: 'string' has not been declared
9 | static void Main(string[] args) {
| ^~~~~~
a.cc:9:35: error: expected ',' or '...' before 'args'
9 | static void Main(string[] args) {
| ^~~~
a.cc:34:6: error: expected ';' after class definition
34 | }
| ^
| ;
a.cc: In static member function 'static void CookieExchanges::Program::Main(int*)':
a.cc:10:13: error: 'string' was not declared in this scope
10 | string[] s = Console.ReadLine().Split();
| ^~~~~~
a.cc:10:20: error: expected primary-expression before ']' token
10 | string[] s = Console.ReadLine().Split();
| ^
a.cc:11:21: error: expected primary-expression before 'int'
11 | int a = int.Parse(s[0]);
| ^~~
a.cc:12:21: error: expected primary-expression before 'int'
12 | int b = int.Parse(s[1]);
| ^~~
a.cc:13:21: error: expected primary-expression before 'int'
13 | int c = int.Parse(s[2]);
| ^~~
a.cc:17:21: error: 'Console' was not declared in this scope
17 | Console.WriteLine(-1);
| ^~~~~~~
a.cc:21:21: error: 'Console' was not declared in this scope
21 | Console.WriteLine(0);
| ^~~~~~~
a.cc:32:13: error: 'Console' was not declared in this scope
32 | Console.WriteLine(ans);
| ^~~~~~~
|
s324315410 | p03723 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int main() {
int a, b, c;
cin >> a >> b >> c;
int a2, b2, c2;
int cnt = 0;
while(a%2==0 && b%2==0 && c%2==0){
a2 = b/2 + c/2;
b2 = a/2 + c/2;
c2 = a/2 + b/2;
if(a==a2 && b==b2 && c==c2){
cout << "-1" << endl;
return 0;
}
a = a2; b= b2; c= c2;
cnt++;
}
cout << cnt << endl;
return 0; | a.cc: In function 'int main()':
a.cc:24:14: error: expected '}' at end of input
24 | return 0;
| ^
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
s206287256 | p03723 | C++ | import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;
import std.math;
void main() {
auto abc = readln.chomp.split.map!(to!int).array;
long a = abc[0], b = abc[1], c = abc[2];
if (a == b && b == c) {
(-1).writeln;
}
else {
int ans;
while (a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
long tmp = a / 2;
a /= 2;
a += c / 2;
c /= 2;
c += b / 2;
b /= 2;
b += tmp;
ans++;
}
ans.writeln;
}
return;
}
| a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import std.algorithm;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import std.array;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import std.conv;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import std.string;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import std.math;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: '::main' must return 'int'
8 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:9:14: error: 'readln' was not declared in this scope
9 | auto abc = readln.chomp.split.map!(to!int).array;
| ^~~~~~
a.cc:13:12: error: 'b' was not declared in this scope
13 | if (a == b && b == c) {
| ^
a.cc:13:22: error: 'c' was not declared in this scope
13 | if (a == b && b == c) {
| ^
a.cc:14:10: error: request for member 'writeln' in '-1', which is of non-class type 'int'
14 | (-1).writeln;
| ^~~~~~~
a.cc:30:9: error: request for member 'writeln' in 'ans', which is of non-class type 'int'
30 | ans.writeln;
| ^~~~~~~
a.cc:33:3: error: return-statement with no value, in function returning 'int' [-fpermissive]
33 | return;
| ^~~~~~
|
s501937025 | p03723 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long i64;
i64 a,b,c;
int rec(int A,int B,int C)
{
if(A % 2 == 1 || B % 2 == 1 || C % 2 == 1)
return 0;
int p = A / 2;
int q = B / 2;
int r = C / 2;
return rec(q + r , p + r , p + q) + 1;
}
int main()
{
cin >> a >> b >> c;
if(a % 2 = 0 && a == b && b == c)
{
cout << -1 << endl;
return 0;
}
cout << rec(a,b,c) << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:23:14: error: lvalue required as left operand of assignment
23 | if(a % 2 = 0 && a == b && b == c)
| ~~^~~
|
s825779632 | p03723 | C++ | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
typedef long long i64;
#define int i64
i64 a,b,c;
signed rec(int A,int B,int C)
{
if(A % 2 == 1 || B % 2 == 1 || C % 2 == 1)
return 0;
int p = A / 2;
int q = B / 2;
int r = C / 2;
return rec(q + r , p + r , p + q) + 1;
}
int main()
{
cin >> a >> b >> c;
if(a == b && b == c)
{
cout << -1 << endl;
return 0;
}
cout << rec(a,b,c) << endl;
return 0;
}
| a.cc:8:13: error: '::main' must return 'int'
8 | #define int i64
| ^~~
a.cc:21:1: note: in expansion of macro 'int'
21 | int main()
| ^~~
|
s479509703 | p03723 | C++ | #include <bits/stdc++.h>
#define LL long long
#define PII pair
#define MP(x, y) make_pair((x),(y))
#define fi first
#define se second
#define PB(x) push_back((x))
#define MMG(x) memset((x), -1,sizeof(x))
#define MMF(x) memset((x),0,sizeof(x))
#define MMI(x) memset((x), INF, sizeof(x))
using namespace std;
const int INF = 0x3f3f3f3f;
const int N = 1e5+20;
const double eps = 1e-8;
char mp[1000][1000];
int dir[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
int vis[1000][1000];
int n, m, k;
int bfs(int sx, int sy)
{
MMF(vis);
int ans = INF;
queueq;
q.push(MP(sx, sy));
while(!q.empty())
{
PII nw = q.front();
q.pop();
int sp = min(min(nw.fi - 1, nw.se - 1), min(n - nw.fi , m - nw.se));
ans = min(sp / k + ((sp%k)?1:0), ans);
for(int i = 0; i < 4; i++)
{
int nx = nw.fi + dir[i][0];
int ny = nw.se + dir[i][1];
if(nx > 0 && ny > 0 && nx <= n && ny <= m && mp[nx][ny] == '.')
{
if(!vis[nx][ny] && abs(nx - sx) + abs(ny - sy) <= k)
vis[nx][ny] = 1, q.push(MP(nx, ny));
}
}
}
return ans;
}
int main()
{
while(cin >> n >> m >> k)
{
getchar();
int sx = -1, sy = -1;
for(int i = 1; i <= n; i++)
{
for(int j = 1; j <= m; j++)
{
scanf("%c",&mp[i][j]);
if(mp[i][j] == 'S')
sx = i, sy = j;
}
getchar();
}
int ans = bfs(sx, sy);
printf("%d\n", ans + 1);
}
return 0;
} | a.cc: In function 'int bfs(int, int)':
a.cc:25:5: error: 'queueq' was not declared in this scope
25 | queueq;
| ^~~~~~
a.cc:26:5: error: 'q' was not declared in this scope
26 | q.push(MP(sx, sy));
| ^
|
s229419764 | p03723 | C | #include <bits/stdc++.h>
using namespace std;
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)
//int dxy[5] = {0, 1, 0, -1, 0};
// cmd
signed main()
{
std::ios::sync_with_stdio(false);
std::cin.tie(0);
int3(a, b, c);
rep(i, 10001000) {
if (a % 2 || b % 2 || c % 2) {
cout << i << endl;
return 0;
}
int aa = b/2 + c/2, bb = a/2 + c/2, cc = a/2 + b/2;
a = aa; b = bb; c = cc;
}
cout << -1 << endl;
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s987252736 | p03723 | C++ | #include <cstdlib>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
using namespace std;
const int MAXN=810;
typedef pair<int,int> ii;
vector <ii> v;
int go[4][2]={{0,-1},{0,1},{1,0},{-1,0}};
int n,m,k,sx,sy;
char a[MAXN][MAXN];
int count(int x) { return x%k?(x/k+1):(x/k); }
int make(ii p)
{
int m1=min(count(p.first-1),count(n-p.first));
int m2=min(count(p.second-1),count(m-p.second));
return min(m1,m2);
}
void dfs(int x,int y,int step)
{
v.push_back(ii(x,y));
book[x][y]=1;
if(step==k+1) return;
for(int i=0;i<4;i++)
{
int tx=x+go[i][0];
int ty=y+go[i][1];
if(tx<1 || tx>n || ty<1 ||ty>m) continue;
if(a[tx][ty]=='.' && !book[tx][ty]) dfs(tx,ty,step+1);
}
}
void solve()
{
int ans=0x3f3f3f3f;
if(sx==1 || sx==n || sy==1 || sy==m) {printf("0"); return;}
dfs(sx,sy,0);
for(int i=0;i<v.size();i++)
ans=min(ans,make(v[i]));
cout<<ans+1;
}
int main()
{
//freopen("input","r",stdin);
scanf("%d %d %d\n",&n,&m,&k);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
scanf("%c",&a[i][j]);
if(a[i][j]=='S')
sx=i,sy=j;
}
scanf("\n");
}
solve();
return 0;
} | a.cc: In function 'void dfs(int, int, int)':
a.cc:29:9: error: 'book' was not declared in this scope; did you mean 'bool'?
29 | book[x][y]=1;
| ^~~~
| bool
|
s916127937 | p03723 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,c;
int main() {
cin >> a >> b >> c;
if(a == b && b == c && A % 2 == 0) {
cout <<"-1"<<endl;
return 0;
}
ll ans = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
ll s = a / 2;
ll t = b / 2;
ll r = c / 2;
a = t + r;
b = s + r;
c = s + t;
ans++;
}
cout << ans << endl;
}
| a.cc: In function 'int main()':
a.cc:12:26: error: 'A' was not declared in this scope
12 | if(a == b && b == c && A % 2 == 0) {
| ^
|
s076574615 | p03723 | C++ | #include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int, int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))
int main(void){
vector<lli> a(3, 0), b(3, 0);
cin >> a[0] >> a[1] >> a[2];
rep(i, 3) if(a[0]%2 == 1) {cout << '0' << endl; return 0;}
lli n = accumulate(a.begin(), a.end(), 0ll);
rep(i, 3){
lli c = a[i]*3 - n;
if(c == 0){ b[i] = LINF; continue;}
while(c%2 == 0){
c /= 2;
b[i]++;
}
}
lli ans = *min_element(b.begin(), b.end());
cout << (ans == LINF?-1:ans) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:17: error: 'accumulate' was not declared in this scope
31 | lli n = accumulate(a.begin(), a.end(), 0ll);
| ^~~~~~~~~~
|
s048351642 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int i = 0;
if(a == b && b == c && a % 2 == 0 ) {
i = -1;
} else {
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
int A = a;
int B = b;
int C = c;
a = B/2 + C/2;
b = C/2 + A/2;
c = A/2 + B/2;
i++;
}
}
Sysytem.out.println(i);
}
} | Main.java:27: error: package Sysytem does not exist
Sysytem.out.println(i);
^
1 error
|
s357364636 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int i = 0;
if(a == b && b == c && a % 2 == 0 ) {
i = -1;
} else {
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
int A = a;
int B = b;
int C = c;
a = B/2 + C/2;
b = C/2 + A/2;
c = A/2 + B/2;
i++;
}
}
Sysytem.out.println(i);
}
} | Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
2 errors
|
s408241397 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long a = sc.nextLong();
long b = sc.nextLong();
long c = sc.nextLong();
long i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
a = b/2 + c/2;
b = c/2 + a/2;
c = a/2 + b/2;
i++;om
}
Sysytem.out.println(i);
}
} | Main.java:7: error: illegal character: '\u3000'
??long a = sc.nextLong();
^
Main.java:7: error: illegal character: '\u3000'
??long a = sc.nextLong();
^
Main.java:17: error: not a statement
i++;om
^
Main.java:17: error: ';' expected
i++;om
^
4 errors
|
s438932860 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
double a = sc.nextDouble();
double b = sc.nextDouble();
double c = sc.nextDouble();
double i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
a = b/2 + c/2;
b = c/2 + a/2;
c = a/2 + b/2;
i++;
}
Sysytem.out.println(i);
}
} | Main.java:7: error: illegal character: '\u3000'
??double a = sc.nextDouble();
^
Main.java:7: error: illegal character: '\u3000'
??double a = sc.nextDouble();
^
2 errors
|
s495947778 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
a = b/2 + c/2;
b = c/2 + a/2;
c = a/2 + b/2;
i++;
}
Sysytem.out.println(i);
} | Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:20: error: reached end of file while parsing
}
^
3 errors
|
s790530117 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
a == b/2 + c/2;
b == c/2 + a/2;
c == a/2 + b/2;
i++;
}
Sysytem.out.println(i);
}
}
| Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:14: error: not a statement
a == b/2 + c/2;
^
Main.java:15: error: not a statement
b == c/2 + a/2;
^
Main.java:16: error: not a statement
c == a/2 + b/2;
^
5 errors
|
s123903209 | p03723 | Java | import java.util.Scanner;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
a == b/2 + c/2;
b == c/2 + a/2;
c == a/2 + b/2;
i++;
}
}
}
System.out.println(i);
| Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:7: error: illegal character: '\u3000'
??int a = sc.nextInt();
^
Main.java:14: error: not a statement
a == b/2 + c/2;
^
Main.java:15: error: not a statement
b == c/2 + a/2;
^
Main.java:16: error: not a statement
c == a/2 + b/2;
^
Main.java:21: error: class, interface, enum, or record expected
System.out.println(i);
^
6 errors
|
s371104913 | p03723 | C++ | #include<cstdio>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a > b) a ^= b ^= a ^= b;
if(b > c) b ^= c ^= b ^= c;
if(a > b) a ^= b ^= a ^= b;
int i;
for(i = 0; i < 32; i ++)
if((a & (1 << i) )||(b & (1 << i)) || (c & & (1 << i)))
break;
if((a == b || b == c) && i > 0)
printf("-1");
else
printf("%d",i+1);
return 0;
} | a.cc: In function 'int main()':
a.cc:11:65: error: lvalue required as unary '&' operand
11 | if((a & (1 << i) )||(b & (1 << i)) || (c & & (1 << i)))
| ~~~^~~~~
|
s031972202 | p03723 | C++ | #include<iostream>
using namespace std;
int main(){
int a[]={}, b[]={}, c[]={};
int counter;
cin >> a[0]>>b[0]>>c[0];
if(a[0]==b[0] && b[0]==c[0]){
cout << -1;
return 0;
}
while(1){
int i;
a[i+1]=(b[i]+c[i])/2;
b[i+1]=(a[i]+c[i])/2;
c[i+1]=(a[i]+b[i])/2;
counter++;
if(a[i+1]%2==1|b[i+1]%2==1|c[i+1]%2==1){
cout<<counter<<endl;
return 0;
}
if(counter>1000){
return 0;
}
} | a.cc: In function 'int main()':
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s738186144 | p03723 | C++ | include<iostream>
using namespace std;
int main(){
int a[]={}, b[]={}, c[]={};
int counter;
cin >> a[0]>>b[0]>>c[0];
if(a[0]==b[0] && b[0]==c[0]){
cout << -1;
return 0;
}
while(1){
int i;
a[i+1]=(b[i]+c[i])/2;
b[i+1]=(a[i]+c[i])/2;
c[i+1]=(a[i]+c[i])/2;
counter++;
if(a[i+1]%2==1|b[i+1]%2==1|c[i+1]%2==1){
cout<<counter<<endl;
return 0;
}
if(counter>1000){
return 0;
}
} | a.cc:1:1: error: 'include' does not name a type
1 | include<iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
8 | cin >> a[0]>>b[0]>>c[0];
| ^~~
a.cc:11:9: error: 'cout' was not declared in this scope
11 | cout << -1;
| ^~~~
a.cc:23:13: error: 'cout' was not declared in this scope
23 | cout<<counter<<endl;
| ^~~~
a.cc:23:28: error: 'endl' was not declared in this scope
23 | cout<<counter<<endl;
| ^~~~
a.cc:30:2: error: expected '}' at end of input
30 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s904704997 | p03723 | C++ | int main(){
int a[]={},b[]={},c[]={};
int counter=0;
cin >> a[0] >> b[0] >>c[0];
if(a[0]==b[0]&&b[0]==c[0]){
cout << -1<< endl;
return 0;
}
while(1){
int i=0;
a[i+1]=(b[i]+c[i])/2;
b[i+1]=(a[i]+c[i])/2;
c[i+1]=(a[i]+b[i])/2;
counter++;
i++;
if(a[i+1]%2==1|b[i+1]%2==1|c[i+1]%2==1){
cout << counter<<endl;
return 0;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> a[0] >> b[0] >>c[0];
| ^~~
a.cc:7:17: error: 'cout' was not declared in this scope
7 | cout << -1<< endl;
| ^~~~
a.cc:7:30: error: 'endl' was not declared in this scope
7 | cout << -1<< endl;
| ^~~~
a.cc:19:25: error: 'cout' was not declared in this scope
19 | cout << counter<<endl;
| ^~~~
a.cc:19:42: error: 'endl' was not declared in this scope
19 | cout << counter<<endl;
| ^~~~
|
s060072786 | p03723 | C++ | #include "stdafx.h"
#include <stdio.h>
int main()
{
int a[] = { 0,1,3,1,2,1,2,1,1,2,1,2,1 };
int x, y;
scanf("%d", &x);
scanf("%d", &y);
if (a[x] == a[y]) {
printf("YES\n");
}
else { printf("NO\n"); }
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s841249490 | p03723 | Java | 454 414 444 | Main.java:1: error: class, interface, enum, or record expected
454 414 444
^
1 error
|
s132609270 | p03723 | Java | package agc014;
public class CookieExchanges {
public static void main(String[] args) {
int a = Integer.parseInt(args[0]);
int b = Integer.parseInt(args[1]);
int c = Integer.parseInt(args[2]);
int nextA, nextB, nextC;
nextA = nextB = nextC = 0;
int times = 0;
while(true){
nextB += a / 2;
nextC += a / 2;
nextC += b / 2;
nextA += b / 2;
nextA += c / 2;
nextB += c / 2;
if(a % 2 != 0 || b % 2 != 0 || c % 2 != 0){
break;
}
else if(nextA == nextB && nextB == nextC){
times = -1;
break;
}
a = nextA;
b = nextB;
c = nextC;
nextA = nextB = nextC = 0;
times++;
}
System.out.print(times);
}
}
| Main.java:3: error: class CookieExchanges is public, should be declared in a file named CookieExchanges.java
public class CookieExchanges {
^
1 error
|
s273169178 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
const LL base = 1e10;
LL A[2][3];
int solve(){
ST.clear();
LL sum = A[0][0] + A[0][1] + A[0][2];
int f = 0;
LL v;
for(int i=0; ;i++){
sort(A[f], A[f]+3);
v = A[f][0] * base + A[f][1];
if(ST.count(v)){
return -1;
}
ST.insert(v);
for(int j=0; j<3; j++){
if(A[f][j] & 1){
return i;
}
}
for(int i=0; i<3; i++){
A[f^1][i] = (sum - A[f][i]) >> 1;
}
f ^= 1;
}
}
int main(){
while(~scanf("%llu %llu %llu", &A[0][0], &A[0][1], &A[0][2])){
printf("%d\n", solve());
}
return 0;
}
| a.cc: In function 'int solve()':
a.cc:9:9: error: 'ST' was not declared in this scope
9 | ST.clear();
| ^~
|
s685154761 | p03723 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Atcoder
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(CookieExchanges());
}
public static int CookieExchanges()
{
var inputs = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
int count = -1;
int sum = inputs.Sum();
if(inputs[0] == inputs[1] && inputs[0] == inputs[2] && inputs[0] % 2 == 0)
{
return count;
}
count = 0;
while (!inputs.Any(x => x % 2 != 0))
{
inputs = inputs.Select(x => (sum - x) / 2).ToArray();
count++;
}
return count;
}
}
}
| a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Threading.Tasks;
| ^~~~~~
a.cc:11:26: error: 'string' has not been declared
11 | static void Main(string[] args)
| ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
11 | static void Main(string[] args)
| ^~~~
a.cc:16:15: error: expected ':' before 'static'
16 | public static int CookieExchanges()
| ^~~~~~~
| :
a.cc:37:6: error: expected ';' after class definition
37 | }
| ^
| ;
a.cc: In static member function 'static void Atcoder::Program::Main(int*)':
a.cc:13:13: error: 'Console' was not declared in this scope
13 | Console.WriteLine(CookieExchanges());
| ^~~~~~~
a.cc: In static member function 'static int Atcoder::Program::CookieExchanges()':
a.cc:18:13: error: 'var' was not declared in this scope
18 | var inputs = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
| ^~~
a.cc:20:23: error: 'inputs' was not declared in this scope
20 | int sum = inputs.Sum();
| ^~~~~~
a.cc:29:32: error: 'x' was not declared in this scope
29 | while (!inputs.Any(x => x % 2 != 0))
| ^
a.cc:29:35: error: expected primary-expression before '>' token
29 | while (!inputs.Any(x => x % 2 != 0))
| ^
a.cc:31:43: error: expected primary-expression before '>' token
31 | inputs = inputs.Select(x => (sum - x) / 2).ToArray();
| ^
|
s753805659 | p03723 | C++ | /*AGC*/
#include<stdio.h>
int exchangesCount(int a,int b, int c){
while(a%2==b%2==c%2==0){
int as, bs, cs;
as=(b+c)/2;
bs=(c+a)/2;
cs=(a+b)/2;
i++;
a=as;
b=bs;
c=cs;
if(i>1000000)return -1;
}
return i;
}
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d\n",exchangesCount(a,b,c));
return 0;
} | a.cc: In function 'int exchangesCount(int, int, int)':
a.cc:10:9: error: 'i' was not declared in this scope
10 | i++;
| ^
a.cc:16:12: error: 'i' was not declared in this scope
16 | return i;
| ^
|
s130277128 | p03723 | C++ | /*AGC*/
#include<stdio.h>
int exchangesCount(int a,int b, int c){
while(a%2==b%2==c%2==0){
as=(b+c)/2;
bs=(c+a)/2;
cs=(a+b)/2;
i++;
a=as;
b=bs;
c=cs;
if(i>1000000)return -1;
}
return i;
}
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d\n",exchangesCount(a,b,c));
return 0;
} | a.cc: In function 'int exchangesCount(int, int, int)':
a.cc:6:9: error: 'as' was not declared in this scope; did you mean 'a'?
6 | as=(b+c)/2;
| ^~
| a
a.cc:7:9: error: 'bs' was not declared in this scope; did you mean 'b'?
7 | bs=(c+a)/2;
| ^~
| b
a.cc:8:9: error: 'cs' was not declared in this scope; did you mean 'c'?
8 | cs=(a+b)/2;
| ^~
| c
a.cc:9:9: error: 'i' was not declared in this scope
9 | i++;
| ^
a.cc:15:12: error: 'i' was not declared in this scope
15 | return i;
| ^
|
s452031435 | p03723 | C++ | #include<cstdio>
int a, b, c, aNew, bNew, cNew;
int main()
{
scanf("%d%d%d", &a, &b, &c);
int n = 0;
while(!(a&1) && !(b&1) && !(c&1))
{
n++;
aNew = (b + c) >> 1; bNew = (a + c) >> 1; cNew = (a + b) >> 1;
if(a == aNew && b == bNew && c == cNew)
{
printf("%d\n", -1);
return 0;
}
a = aNew; b = bNew; c = cNew;
}
printf("%d\n", t);
return 0;
} | a.cc: In function 'int main()':
a.cc:20:20: error: 't' was not declared in this scope
20 | printf("%d\n", t);
| ^
|
s919981812 | p03723 | Java | public static void main(String[] args) {
int val = 11;
if (val == 10) {
System.out.println("変数valは10です");
} else {
System.out.println("変数valは10ではありません");
} // 結果:変数valは10ではありません
} | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s857703576 | p03723 | C++ | a , b , c = map(int , raw_input().split())
ans = 0
while not ((a & 1) | (b & 1) | (c & 1)):
a , b , c = (b + c) >> 1 , (a + c) >> 1 , (a + b) >> 1
ans += 1
if ans > 1 << 15:
ans = -1
break
print ans | a.cc:1:1: error: 'a' does not name a type
1 | a , b , c = map(int , raw_input().split())
| ^
|
s682146445 | p03723 | C++ | #include <iostream>
int main(){
int a,b,c;
int cnt=0;
cin >> a >> b >> c;
while(!a%2 || !b%2 || !c%2){
cnt++;
int _a = (b+c)/2;
int _b = (a+c)/2;
int _c = (a+b)/2;
a=_a;b=_b;c=_c;
}
std::cout << cnt ;
} | a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> a >> b >> c;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s427446240 | p03723 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#pragma warning(disable : 4996)
using namespace std;
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
//最大公約数
long gcd(long a, long b){
if (a%b==0){
return b;
}
else{
return gcd(b,a%b);
}
}
//最小公倍数
long lcm(long a, long b){
return (a*b) / gcd(a,b);
}
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a < b) { a = b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
const ll INF = 1ll<<29;
const ll MOD = 1000000007;
const double EPS = 1e-10;
int main(){
int a, b, c;
cin >> a >> b >> c;
if (a%2 || b%2 || c%2) cout << 0 << endl;
else if{
if (a == b && b == c) cout << -1 << endl;
else {
int ans = 0;
int t1 = a, t2 = b, t3 = c;
while(t1%2 == 0 && t2%2 == 0 && t3%2 == 0){
ans++;
a = t2/2 + t3/2;
b = t1/2 + t3/2;
c = t1/2 + t2/2;
t1 = a;
t2 = b;
t3 = c;
}
cout << ans << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:45:17: error: expected '(' before '{' token
45 | else if{
| ^
| (
|
s741963943 | p03723 | C++ | #include <iostream>
using namespace std;
int A,B,C;
int ans;
int main() {
cin >> A >> B >> C;
if(A == B && B == C && (C % 2 == 0)) {cout << "-1" <<endl; return 0;}
while((A % 2 == 0) && (B % 2 == 0) && (C % 2 == 0)) {
int tmp = A / 2;
int tmp2 = B / 2;
int tmp3 = C / 2;
A = tmp2 + tmp3;
B = tmp + tmp3;
C = tmp + tmp2;
ans++;
}
cout << ans << endl;
}
#include <iostream>
using namespace std;
int A,B,C;
int ans;
int main() {
cin >> A >> B >> C;
if(A == B && B == C && (C % 2 == 0)) {cout << "-1" <<endl; return 0;}
while((A % 2 == 0) && (B % 2 == 0) && (C % 2 == 0)) {
int tmp = A / 2;
int tmp2 = B / 2;
int tmp3 = C / 2;
A = tmp2 + tmp3;
B = tmp + tmp3;
C = tmp + tmp2;
ans++;
}
cout << ans << endl;
}
| a.cc:30:5: error: redefinition of 'int A'
30 | int A,B,C;
| ^
a.cc:5:5: note: 'int A' previously declared here
5 | int A,B,C;
| ^
a.cc:30:7: error: redefinition of 'int B'
30 | int A,B,C;
| ^
a.cc:5:7: note: 'int B' previously declared here
5 | int A,B,C;
| ^
a.cc:30:9: error: redefinition of 'int C'
30 | int A,B,C;
| ^
a.cc:5:9: note: 'int C' previously declared here
5 | int A,B,C;
| ^
a.cc:31:5: error: redefinition of 'int ans'
31 | int ans;
| ^~~
a.cc:6:5: note: 'int ans' previously declared here
6 | int ans;
| ^~~
a.cc:32:5: error: redefinition of 'int main()'
32 | int main() {
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
7 | int main() {
| ^~~~
|
s246900540 | p03723 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan= new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int count=0;
if(a==b && b==c){
if(a%2==1 && b%2==0 && c%2==0)) count=-1;
}else{
while(a%2==0 && b%2==0 && c%2==0){
int a1=a;
int b1=b;
int c1=c;
a = c1/2 + b1/2;
b = a1/2 + c1/2;
c = a1/2 + b1/2;
count++;
}
}
System.out.println(count);
}
} | Main.java:12: error: illegal start of expression
if(a%2==1 && b%2==0 && c%2==0)) count=-1;
^
1 error
|
s275692276 | p03723 | C++ | #include<iostream>
#include<cstdio>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<climits>
#include<cmath>
#include<vector>
#include <bitset>
#include<algorithm>
#include <queue>
#include<map>
#define inf 9999999;
using namespace std;
/*start:2017/5/6 15:38*/
/*end:2017/5/6 16:56*/
long long int x, y, z, ans, sum, k;
int i;
int main()
{
cin >> x >> y >> z;
k = abs(x - y);
s = abs(y - z);
sum = 0;
while (k%2==0&&s%2==0)
{
sum++;
k /= 2;
s /= 2;
}
cout << sum << endl;
} | a.cc: In function 'int main()':
a.cc:26:9: error: 's' was not declared in this scope
26 | s = abs(y - z);
| ^
|
s734006035 | p03723 | C++ | //In the Name of God
//Let Our Voices Echo
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define X real()
#define Y imag()
typedef long long ll;
typedef double ld;
typedef complex<ld> point;
const ld eps=1e-9;
const int MAX=1e5+9,MOD=1e9+7;
int n,d[MAX];
vector<int> g[MAX];
queue<int> q;
int main()
{
ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
memset(d,-1,sizeof d);
cin>>n;
if (n==2) return cout<<"Second",0;
for (int i=1,v,u;i<n;i++)
{
cin>>v>>u,v--,u--,g[v].push_back(u),g[u].push_back(v);
}
for (int i=0;i<n;i++)
if (g[i].size()==1)
q.push(i),d[i]=0;
while (q.size())
{
int v=q.front();
q.pop();
for (auto u:g[v])
if (d[u]==-1)
d[u]=d[v]+1,q.push(u);
}
int mx=*max_element(d,d+n),cnt=0;
for (int i=0;i<n;i++) if (d[i]==mx) cnt++;
if (cnt==1) return cout<<"First",0;
for (int i=0;i<n;i++)
{
int cnt=0;
for (auto u:g[i])
if (d[u]==d[i]-1)
cnt++;
if (cnt>1) return cout<<"First",0;
}
if (mx%2==1) return cout<<"Second",0;
cout<<"Second"<<Endl;
} | a.cc: In function 'int main()':
a.cc:49:25: error: 'Endl' was not declared in this scope
49 | cout<<"Second"<<Endl;
| ^~~~
|
s860517831 | p03723 | C++ | #include <stdio.h>
int main()
{ int a,b,c,ans;
scanf("%d%d%d",&a,&b,&c);
for(int i=1;;i++){
int q=a/2;
int w=b/2;
int e=c/2;
if(a==b&&b==c&&a!=0&&a%2==0){
ans=-1;
break;
}
if((a%2!=0&&b%2!=0)||(a%2!=0&&c%2!=0)||(c%2!=0&&b%2!=0)){
ans=0;
break;
}
if(i>2000){
ans=-1;
break;
}
if((q+w)%2!=0){
ans=i;
break;
}
if((q+e)%2!=0){
ans=i;
break;
}
if((w+e)%2!=0){
ans=i;
break;
}
a=e+w;
b=q+e;
c=q+w;
#include <stdio.h>
int main()
{ int a,b,c,ans;
scanf("%d%d%d",&a,&b,&c);
for(int i=1;;i++){
int q=a/2;
int w=b/2;
int e=c/2;
if(a==b&&b==c&&a!=0&&a%2==0){
ans=-1;
break;
}
if((a%2!=0&&b%2!=0)||(a%2!=0&&c%2!=0)||(c%2!=0&&b%2!=0)){
ans=0;
break;
}
if(i>2000){
ans=-1;
break;
}
if((q+w)%2!=0){
ans=i;
break;
}
if((q+e)%2!=0){
ans=i;
break;
}
if((w+e)%2!=0){
ans=i;
break;
}
a=e+w;
b=q+e;
c=q+w;
}
printf("%d",ans);
return 0;
}
#include <stdio.h>
int main()
{ int a,b,c,ans;
scanf("%d%d%d",&a,&b,&c);
for(int i=1;;i++){
int q=a/2;
int w=b/2;
int e=c/2;
if(a==b&&b==c&&a!=0&&a%2==0){
ans=-1;
break;
}
if((a%2!=0&&b%2!=0)||(a%2!=0&&c%2!=0)||(c%2!=0&&b%2!=0)){
ans=0;
break;
}
if(i>2000){
ans=-1;
break;
}
if((q+w)%2!=0){
ans=i;
break;
}
if((q+e)%2!=0){
ans=i;
break;
}
if((w+e)%2!=0){
ans=i;
break;
}
a=e+w;
b=q+e;
c=q+w;
}
printf("%d",ans);
return 0;
}
}
printf("%d",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:47:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
47 | int main()
| ^~
a.cc:47:9: note: remove parentheses to default-initialize a variable
47 | int main()
| ^~
| --
a.cc:47:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:48:1: error: a function-definition is not allowed here before '{' token
48 | { int a,b,c,ans;
| ^
a.cc:97:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
97 | int main()
| ^~
a.cc:97:9: note: remove parentheses to default-initialize a variable
97 | int main()
| ^~
| --
a.cc:97:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:98:1: error: a function-definition is not allowed here before '{' token
98 | { int a,b,c,ans;
| ^
|
s235539082 | p03723 | C++ | #include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define poq pop_back
#define tof ios_base :: sync_with_stdio(NULL);cin.tie(0);cout.tie(0)
using namespace std;
char y[809][809];
bool viz[809][809];
bool vizz[809][809];
int main()
{
ll h,w,k,X,Y;
cin»h»w»k;
for (ll i=0; i<h; i++)
{
for (ll j=0; j<w; j++)
{
cin»y[i][j];
if (y[i][j]=='S')
{
X=i;
Y=j;
}
}
}
stack<pair<ll,ll> > stk;
stack<pair<ll,ll> >sttk;
stack<pair<ll,ll> >stttk;
pair<ll,ll> v;
stk.push(mp(X,Y));
stttk.push(mp(X,Y));
viz[X][Y]=1;
ll ans=0;
for (ll i=0; i<k; i++)
{
while(!stk.empty())
{
v=stk.top();
if (v.F>0)
{
if (y[v.F-1][v.S]!='#')
{
sttk.push(mp(v.F-1,v.S));
}
}
else
{
cout«1;
return 0;
}
if (v.F<h-1)
{
if (y[v.F+1][v.S]!='#')
{
sttk.push(mp(v.F+1,v.S));
}
}
else
{
cout«1;
return 0;
}
if (v.S>0)
{
if (y[v.F][v.S-1]!='#')
{
sttk.push(mp(v.F,v.S-1));
}
}
else
{
cout«1;
return 0;
}
if (v.S<w-1)
{
if (y[v.F][v.S+1]!='#')
{
sttk.push(mp(v.F,v.S+1));
}
}
else
{
cout«1;
return 0;
}
stk.pop();
}
while (!sttk.empty())
{
v=sttk.top();
if (v.F==0||v.S==0||v.F==h-1||v.S==w-1)
{
cout«1;
return 0;
}
if (!viz[v.F][v.S])
{
stk.push(v);
stttk.push(v);
viz[v.F][v.S]=1;
}
sttk.pop();
}
}
ans=1e9;
while (!stttk.empty())
{
v=stttk.top();
ans=min(ans,v.F);
ans=min(ans,v.S);
ans=min(ans,w-1-v.S);
ans=min(ans,h-1-v.F);
stttk.pop();
}
if (ans%k==0)
{
cout«ans/k+1;
}
else
{
cout«ans/k+2;
}
//efetertgete
} | a.cc:22:5: error: extended character » is not valid in an identifier
22 | cin»h»w»k;
| ^
a.cc:22:5: error: extended character » is not valid in an identifier
a.cc:22:5: error: extended character » is not valid in an identifier
a.cc:27:13: error: extended character » is not valid in an identifier
27 | cin»y[i][j];
| ^
a.cc:59:17: error: extended character « is not valid in an identifier
59 | cout«1;
| ^
a.cc:71:17: error: extended character « is not valid in an identifier
71 | cout«1;
| ^
a.cc:83:17: error: extended character « is not valid in an identifier
83 | cout«1;
| ^
a.cc:95:17: error: extended character « is not valid in an identifier
95 | cout«1;
| ^
a.cc:105:17: error: extended character « is not valid in an identifier
105 | cout«1;
| ^
a.cc:129:9: error: extended character « is not valid in an identifier
129 | cout«ans/k+1;
| ^
a.cc:133:9: error: extended character « is not valid in an identifier
133 | cout«ans/k+2;
| ^
a.cc: In function 'int main()':
a.cc:22:5: error: 'cin\U000000bbh\U000000bbw\U000000bbk' was not declared in this scope
22 | cin»h»w»k;
| ^~~~~~~~~
a.cc:27:13: error: 'cin\U000000bby' was not declared in this scope
27 | cin»y[i][j];
| ^~~~~
a.cc:59:17: error: 'cout\U000000ab1' was not declared in this scope
59 | cout«1;
| ^~~~~~
a.cc:71:17: error: 'cout\U000000ab1' was not declared in this scope
71 | cout«1;
| ^~~~~~
a.cc:83:17: error: 'cout\U000000ab1' was not declared in this scope
83 | cout«1;
| ^~~~~~
a.cc:95:17: error: 'cout\U000000ab1' was not declared in this scope
95 | cout«1;
| ^~~~~~
a.cc:105:17: error: 'cout\U000000ab1' was not declared in this scope
105 | cout«1;
| ^~~~~~
a.cc:129:9: error: 'cout\U000000abans' was not declared in this scope
129 | cout«ans/k+1;
| ^~~~~~~~
a.cc:133:9: error: 'cout\U000000abans' was not declared in this scope
133 | cout«ans/k+2;
| ^~~~~~~~
|
s948996075 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,100);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC){
cout<<myrnd(mt)%5+1<<endl;
//cout<<"3"<<endl;
}
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:39:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
39 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s870821265 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,10000000);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC){
cout<<myrnd(mt)%6<<endl;
//cout<<"3"<<endl;
}
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:39:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
39 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s429970570 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
void exec(int A,int B,int C){
//cout<<A<<" "<<B<<" "<<C<<" -> ";
if(A%2!=0 || B%2!=0 || C%2!=0){
//cout<<"0"<<endl;
return ;
}
if(A==B && B==C){
//cout<<"-1"<<endl;
return ;
}
cout<<A<<" "<<B<<" "<<C<<" -> ";
long long ans=0;
long long ans2=0;
if(A%4==0) ans2++;
if(B%4==0) ans2++;
if(C%4==0) ans2++;
cout<<ans2<<" ";
cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<"2 ";
else cout<<min(tmpA,min(tmpB,tmpC))<<" ";
//cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
//cout<<A<<" "<<B<<" "<<C<<endl;
while(A%2==0 && B%2==0 && C%2==0){
int tmpA=A,tmpB=B,tmpC=C;
A=tmpB/2+tmpC/2;
B=tmpA/2+tmpC/2;
C=tmpA/2+tmpB/2;
//cout<<A<<" "<<B<<" "<<C<<endl;
ans++;
}
cout<<ans<<endl;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,10000000);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC){
//cout<<myrnd(mt)%6<<endl;
cout<<"3"<<endl;
}
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:72:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
72 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s831335549 | p03723 | C++ | using namespace std;
int main(){
int a,b,c,result=0;
while(cin>>a>>b>>c)
{
while(a%2 == 0 && b%2 == 0 && c%2==0 && a!=b && b!=c)
{
result++;
int temp=a;
a=(b+c)/2;
int temp2=b;
b=(temp+c)/2;
c=(temp+temp2)/2;
}
if(result==0) result=-1;
cout<<result<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:4:15: error: 'cin' was not declared in this scope
4 | while(cin>>a>>b>>c)
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:16:17: error: 'cout' was not declared in this scope
16 | cout<<result<<endl;
| ^~~~
a.cc:16:17: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:16:31: error: 'endl' was not declared in this scope
16 | cout<<result<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s941949029 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
void exec(int A,int B,int C){
//cout<<A<<" "<<B<<" "<<C<<" -> ";
if(A%2!=0 || B%2!=0 || C%2!=0){
//cout<<"0"<<endl;
return ;
}
if(A==B && B==C){
//cout<<"-1"<<endl;
return ;
}
cout<<A<<" "<<B<<" "<<C<<" -> ";
long long ans=0;
long long ans2=0;
if(A%4==0) ans2++;
if(B%4==0) ans2++;
if(C%4==0) ans2++;
cout<<ans2<<" ";
cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<"2 ";
else cout<<min(tmpA,min(tmpB,tmpC))<<" ";
//cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
//cout<<A<<" "<<B<<" "<<C<<endl;
while(A%2==0 && B%2==0 && C%2==0){
int tmpA=A,tmpB=B,tmpC=C;
A=tmpB/2+tmpC/2;
B=tmpA/2+tmpC/2;
C=tmpA/2+tmpB/2;
//cout<<A<<" "<<B<<" "<<C<<endl;
ans++;
}
cout<<ans<<endl;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,10000000);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC){
cout<<myrnd(mt)%6<<endl;
}
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:72:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
72 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s514345824 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
void exec(int A,int B,int C){
//cout<<A<<" "<<B<<" "<<C<<" -> ";
if(A%2!=0 || B%2!=0 || C%2!=0){
//cout<<"0"<<endl;
return ;
}
if(A==B && B==C){
//cout<<"-1"<<endl;
return ;
}
cout<<A<<" "<<B<<" "<<C<<" -> ";
long long ans=0;
long long ans2=0;
if(A%4==0) ans2++;
if(B%4==0) ans2++;
if(C%4==0) ans2++;
cout<<ans2<<" ";
cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<"2 ";
else cout<<min(tmpA,min(tmpB,tmpC))<<" ";
//cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
//cout<<A<<" "<<B<<" "<<C<<endl;
while(A%2==0 && B%2==0 && C%2==0){
int tmpA=A,tmpB=B,tmpC=C;
A=tmpB/2+tmpC/2;
B=tmpA/2+tmpC/2;
C=tmpA/2+tmpB/2;
//cout<<A<<" "<<B<<" "<<C<<endl;
ans++;
}
cout<<ans<<endl;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,10000000);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<myrnd(mt)%6<<endl;
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:71:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
71 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s661145426 | p03723 | C++ | #define _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES 1
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <random>
#include <ctime>
#define MOD 1000000007
const long long INF = 10000000000000000;
using namespace std;
int count(int X){
int ret=0;
while(X%2==0){
X=X/2;
ret++;
}
return ret;
}
void exec(int A,int B,int C){
//cout<<A<<" "<<B<<" "<<C<<" -> ";
if(A%2!=0 || B%2!=0 || C%2!=0){
//cout<<"0"<<endl;
return ;
}
if(A==B && B==C){
//cout<<"-1"<<endl;
return ;
}
cout<<A<<" "<<B<<" "<<C<<" -> ";
long long ans=0;
long long ans2=0;
if(A%4==0) ans2++;
if(B%4==0) ans2++;
if(C%4==0) ans2++;
cout<<ans2<<" ";
cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<"2 ";
else cout<<min(tmpA,min(tmpB,tmpC))<<" ";
//cout<<count(A)<<" + "<<count(B)<<" + "<<count(C)<<" ";
//cout<<A<<" "<<B<<" "<<C<<endl;
while(A%2==0 && B%2==0 && C%2==0){
int tmpA=A,tmpB=B,tmpC=C;
A=tmpB/2+tmpC/2;
B=tmpA/2+tmpC/2;
C=tmpA/2+tmpB/2;
//cout<<A<<" "<<B<<" "<<C<<endl;
ans++;
}
cout<<ans<<endl;
}
int main(){
random_device rnd;
mt19937 mt(rnd);
uniform_int_distribution<> myrnd(4,10000000);
/* for(int i=0;i<1000;i++){
exec(myrnd(mt),myrnd(mt),myrnd(mt));
}
*/
int A,B,C;
cin>>A>>B>>C;
if(A%2!=0 || B%2!=0 || C%2!=0){
cout<<"0"<<endl;
return 0;
}
if(A==B && B==C){
cout<<"-1"<<endl;
return 0;
}
int ans=0;
int tmpA=count(A),tmpB=count(B),tmpC=count(C);
if(tmpA==tmpB && tmpB==tmpC) cout<<myrnd(mt)%6<<endl;
else cout<<min(tmpA,min(tmpB,tmpC))<<endl;
return 0;
// long long ans=0;
//cout<<A<<" "<<B<<" "<<C<<endl;
while(A%2==0 && B%2==0 && C%2==0){
int tmpA=A,tmpB=B,tmpC=C;
A=tmpB/2+tmpC/2;
B=tmpA/2+tmpC/2;
C=tmpA/2+tmpB/2;
//cout<<A<<" "<<B<<" "<<C<<endl;
ans++;
}
cout<<ans<<endl;
} | a.cc: In function 'int main()':
a.cc:71:23: error: no matching function for call to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::random_device&)'
71 | mt19937 mt(rnd);
| ^
In file included from /usr/include/c++/14/random:48,
from a.cc:15:
/usr/include/c++/14/bits/random.h:658:9: note: candidate: 'template<class _Sseq, class> std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(_Sseq&) [with <template-parameter-2-2> = _Sseq; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
658 | mersenne_twister_engine(_Sseq& __q)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:658:9: note: template argument deduction/substitution failed:
/usr/include/c++/14/bits/random.h: In substitution of 'template<class _UIntType, long unsigned int __w, long unsigned int __n, long unsigned int __m, long unsigned int __r, _UIntType __a, long unsigned int __u, _UIntType __d, long unsigned int __s, _UIntType __b, long unsigned int __t, _UIntType __c, long unsigned int __l, _UIntType __f> template<class _Sseq> using std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::_If_seed_seq = std::__detail::_If_seed_seq_for<_Sseq, std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>, _UIntType> [with _Sseq = std::random_device; _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]':
/usr/include/c++/14/bits/random.h:656:32: required from here
656 | template<typename _Sseq, typename = _If_seed_seq<_Sseq>>
| ^~~~~~~~
/usr/include/c++/14/bits/random.h:309:42: error: 'class std::random_device' has no member named 'generate'
309 | std::declval<_Sseq&>().generate(std::declval<uint_least32_t*>(),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
310 | std::declval<uint_least32_t*>()));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine(result_type) [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]'
647 | mersenne_twister_engine(result_type __sd)
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:647:43: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::result_type' {aka 'long unsigned int'}
647 | mersenne_twister_engine(result_type __sd)
| ~~~~~~~~~~~~^~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate: 'std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mersenne_twister_engine() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253]'
644 | mersenne_twister_engine() : mersenne_twister_engine(default_seed) { }
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:644:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&)'
588 | class mersenne_twister_engine
| ^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'const std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&'
/usr/include/c++/14/bits/random.h:588:11: note: candidate: 'constexpr std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>::mersenne_twister_engine(std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&)'
/usr/include/c++/14/bits/random.h:588:11: note: no known conversion for argument 1 from 'std::random_device' to 'std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>&&'
|
s940867964 | p03723 | C++ | //satyaki3794
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define MOD (1000000007LL)
#define LEFT(n) (2*(n))
#define RIGHT(n) (2*(n)+1)
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
ll pwr(ll base, ll p, ll mod){
ll ans = 1;while(p){if(p&1)ans=(ans*base)%mod;base=(base*base)%mod;p/=2;}return ans;
}
ll gcd(ll a, ll b){
if(b == 0) return a;
return gcd(b, a%b);
}
int n, color[100005];
set<int> adj[100005], orig[100005];
bool removed[100005];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n;
if(n == 1){
cout<<"First";
return 0;
}
int e = n-1;
while(e--){
int a, b;
cin>>a>>b;
adj[a].insert(b);
adj[b].insert(a);
orig[a].insert(b);
orig[b].insert(a);
}
priority_queue<ii> pq;
for(int i=1;i<=n;i++){
pq.push(ii(-(int)adj[i].size(), i));
color[i] = -1;
}
while(!pq.empty()){
int v = pq.top().ss;
int deg = -pq.top().ff;
pq.pop();
// cout<<"popped "<<v<<" "<<deg<<endl;
if(deg != (int)adj[v].size()){
pq.push(ii(-(int)adj[v].size(), v));
continue;
}
if(color[v] != -1){
for(auto it : adj[vv])
adj[it].erase(vv);
continue;
}
// cout<<"retained "<<v<<" "<<deg<<endl;
if(deg == 0){
color[v] = 0;
continue;
}
if(deg == 1){
int vv = (*adj[v].begin());
color[vv] = 0;
color[v] = 1;
for(auto it : adj[vv])
adj[it].erase(vv);
adj[v].clear();
adj[vv].clear();
continue;
}
assert(0);
}
// for(int i=1;i<=n;i++) cout<<color[i]<<" ";cout<<endl;
for(int i=1;i<=n;i++)
if(color[i] == 1)
for(auto vv : orig[i])
color[vv] = 1;
for(int i=1;i<=n;i++)
if(color[i] == 0){
cout<<"First";
return 0;
}
cout<<"Second";
return 0;
}
| a.cc: In function 'int main()':
a.cc:76:35: error: 'vv' was not declared in this scope; did you mean 'v'?
76 | for(auto it : adj[vv])
| ^~
| v
|
s314338004 | p03723 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int a,b,c,m,n,flag=0;
cin>>a>>b>>c;
while(a%2==0 && b%2==0 && c%2==0){
m=a;
n=b
a=c/2+b/2;
b=c/2+m/2;
c=n/2+m/2;
flag++;
}
cout<<flag;
} | a.cc: In function 'int main()':
a.cc:9:10: error: expected ';' before 'a'
9 | n=b
| ^
| ;
10 | a=c/2+b/2;
| ~
|
s730912126 | p03723 | C | #include<stdio.h>
#include<stdlib.h>
int main()
{
long long int a,b,c;
long long int x,y,z;
scanf("%lld %lld %lld",&a,&b,&c);
long long int flag = 0;
for(1)
{
x=a;
y=b;
z=c;
a= y/2 + z/2;
b = x/2 + z/2;
c = x/2 + y/2;
flag ++;
if(a%2==1 && b%2 == 1 && c%2 ==1)
break;
}
printf("%lld",flag);
return 0;
} | main.c: In function 'main':
main.c:9:14: error: expected ';' before ')' token
9 | for(1)
| ^
| ;
main.c:9:14: error: expected expression before ')' token
|
s142832000 | p03723 | C++ | #include <iostream>
using namespace std;
int main() {
// your code goes here
int A,B,C,i,a,b,c;
cin>>A>>B>>C;
for ( i=0; i++;);
int a[0]=A;
b[0]=B;
c[0]=C;
a[i]=a[i-1]/2;
b[i]=b[i-1]/2;
c[i]=c[i-1]/2;
if (a[i]%2!=0||b[i]%2!=0||c[i]%2!=0)cout<<"i"<<endl;
else cout<<"-1"<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:13: error: conflicting declaration 'int a [0]'
9 | int a[0]=A;
| ^
a.cc:6:21: note: previous declaration as 'int a'
6 | int A,B,C,i,a,b,c;
| ^
a.cc:10:10: error: invalid types 'int[int]' for array subscript
10 | b[0]=B;
| ^
a.cc:11:10: error: invalid types 'int[int]' for array subscript
11 | c[0]=C;
| ^
a.cc:12:10: error: invalid types 'int[int]' for array subscript
12 | a[i]=a[i-1]/2;
| ^
a.cc:12:15: error: invalid types 'int[int]' for array subscript
12 | a[i]=a[i-1]/2;
| ^
a.cc:13:10: error: invalid types 'int[int]' for array subscript
13 | b[i]=b[i-1]/2;
| ^
a.cc:13:15: error: invalid types 'int[int]' for array subscript
13 | b[i]=b[i-1]/2;
| ^
a.cc:14:10: error: invalid types 'int[int]' for array subscript
14 | c[i]=c[i-1]/2;
| ^
a.cc:14:15: error: invalid types 'int[int]' for array subscript
14 | c[i]=c[i-1]/2;
| ^
a.cc:15:14: error: invalid types 'int[int]' for array subscript
15 | if (a[i]%2!=0||b[i]%2!=0||c[i]%2!=0)cout<<"i"<<endl;
| ^
a.cc:15:25: error: invalid types 'int[int]' for array subscript
15 | if (a[i]%2!=0||b[i]%2!=0||c[i]%2!=0)cout<<"i"<<endl;
| ^
a.cc:15:36: error: invalid types 'int[int]' for array subscript
15 | if (a[i]%2!=0||b[i]%2!=0||c[i]%2!=0)cout<<"i"<<endl;
| ^
|
s583030042 | p03723 | C++ | #include <stdio.h>
int main()
{ int a,b,c,ans;
scanf("%d%d%d",&a,&b,&c);
for(int i=1;;i++){
int q=a/2;
int w=b/2;
int e=c/2;
if(a==b&&b==c||q=0||w=0||e=0){
ans=-1;
break;
}
if(i>20000){
ans=-1;
break;
}
if((q+w)%2!=0){
ans=i;
break;
}
if((q+e)%2!=0){
ans=i;
break;
}
if((w+e)%2!=0){
ans=i;
break;
}
a=e+w;
b=q+e;
c=q+w;
}
printf("%d",ans);
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:32: error: lvalue required as left operand of assignment
10 | if(a==b&&b==c||q=0||w=0||e=0){
| ~^~~
|
s216588392 | p03723 | C++ | def sort(n1, n2, n3):
n=[n1, n2, n3]
t=len(n)
for i in range(t-1):
for j in range(i+1, t):
if n[i] > n[j]:
n[i],n[j] = n[j],n[i]
return n
if __name__ == '__main__':
A, B, C=map(int, input().split())
N=0
arr=[]
flag=1
if(A%2==1 or B%2==1 or C%2==1):
flag=0
while(flag):
A, B, C = sort(A,B,C)
arr.append([A,B,C])
sum = A+B+C
A=(sum-A)/2
B=(sum-B)/2
C=(sum-C)/2
N+=1
if(A%2==1 or B%2==1 or C%2==1):
flag=0
for i in range(len(arr)-1):
if(arr[i] == [A,B,C]):
flag = 0
N=-1
print(N) | a.cc:10:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
10 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
1 | def sort(n1, n2, n3):
| ^~~
|
s470520532 | p03723 | C | #include<stdio.h>
int separate(int,int,int);
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",separate(a,b,c));
return 0;
}
int separate(int a,int b,int c){
int i;
int a2,b2,c2;
const int MAX = 1000000000;
for(i = 1 ,i<=MAX; i++){
a2 = a/2;
b2 = b/2;
c2 = c/2;
a = b2 + c2;
b = a2 + c2;
c = a2 + b2;
if(a % 2 != 0 && b % 2 != 0 && c % 2 != 0) return i;
}
return -1;
} | main.c: In function 'separate':
main.c:23:23: error: expected ';' before ')' token
23 | for(i = 1 ,i<=MAX; i++){
| ^
| ;
|
s963465760 | p03723 | C | #include<stadio.h>
int separate(int,int,int);
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",separate(a,b,c));
return 0;
}
int separate(int a,int b,int c){
int i;
int a2,b2,c2;
const double MAX = 1000000000;
for(i = 1 ,i<=MAX; i++){
a2 = a/2;
b2 = b/2;
c2 = c/2;
a = b2 + c2;
b = a2 + c2;
c = a2 + b2;
if(a % 2 != 0 && b % 2 != 0 && c % 2 != 0) return i;
}
return -1;
} | main.c:1:9: fatal error: stadio.h: No such file or directory
1 | #include<stadio.h>
| ^~~~~~~~~~
compilation terminated.
|
s703949323 | p03723 | C | #include<stadio.h>
int separate(int,int,int);
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",separate(a,b,c));
return 0;
}
int separate(int a,int b,int c){
int i;
int a2,b2,c2;
const int MAX = 1000000000;
for(i = 1 ,i<=MAX; i++){
a2 = a/2;
b2 = b/2;
c2 = c/2;
a = b2 + c2;
b = a2 + c2;
c = a2 + b2;
if(a % 2 != 0 && b % 2 != 0 && c % 2 != 0) return i;
}
return -1;
} | main.c:1:9: fatal error: stadio.h: No such file or directory
1 | #include<stadio.h>
| ^~~~~~~~~~
compilation terminated.
|
s051984834 | p03723 | C++ | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace test
{
class Program
{
static void Main(string[] args)
{
string[] str = Console.ReadLine().Split(' ');
int[] D = new int[3];
D[0] = int.Parse(str[0]);
D[1] = int.Parse(str[1]);
D[2] = int.Parse(str[2]);
int[] d = new int[3];
int ans = 0;
if(D[0] % 2 == 1 || D[1] % 2 == 1 || D[2] % 2 == 1)
{
Console.WriteLine("0");
}
if (D[0] == D[1] && D[1] == D[2]) Console.WriteLine("-1");
else
{
while (0 == (D[0] % 2 + D[1] % 2 + D[2] % 2))
{
ans++;
d[0] = (D[1] + D[2]) / 2;
d[1] = (D[0] + D[2]) / 2;
d[2] = (D[0] + D[1]) / 2;
D[0] = d[0];
D[1] = d[1];
D[2] = d[2];
}
Console.WriteLine(ans);
}
}
}
} | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
2 | using System.Collections.Generic;
| ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
3 | using System.Linq;
| ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
4 | using System.Text;
| ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
5 | using System.Threading.Tasks;
| ^~~~~~
a.cc:11:26: error: 'string' has not been declared
11 | static void Main(string[] args)
| ^~~~~~
a.cc:11:35: error: expected ',' or '...' before 'args'
11 | static void Main(string[] args)
| ^~~~
a.cc:41:6: error: expected ';' after class definition
41 | }
| ^
| ;
a.cc: In static member function 'static void test::Program::Main(int*)':
a.cc:13:13: error: 'string' was not declared in this scope
13 | string[] str = Console.ReadLine().Split(' ');
| ^~~~~~
a.cc:13:20: error: expected primary-expression before ']' token
13 | string[] str = Console.ReadLine().Split(' ');
| ^
a.cc:14:16: error: structured binding declaration cannot have type 'int'
14 | int[] D = new int[3];
| ^~
a.cc:14:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:14:16: error: empty structured binding declaration
a.cc:14:19: error: expected initializer before 'D'
14 | int[] D = new int[3];
| ^
a.cc:15:13: error: 'D' was not declared in this scope
15 | D[0] = int.Parse(str[0]);
| ^
a.cc:15:20: error: expected primary-expression before 'int'
15 | D[0] = int.Parse(str[0]);
| ^~~
a.cc:16:20: error: expected primary-expression before 'int'
16 | D[1] = int.Parse(str[1]);
| ^~~
a.cc:17:20: error: expected primary-expression before 'int'
17 | D[2] = int.Parse(str[2]);
| ^~~
a.cc:18:16: error: structured binding declaration cannot have type 'int'
18 | int[] d = new int[3];
| ^~
a.cc:18:16: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:18:16: error: empty structured binding declaration
a.cc:18:19: error: expected initializer before 'd'
18 | int[] d = new int[3];
| ^
a.cc:23:17: error: 'Console' was not declared in this scope
23 | Console.WriteLine("0");
| ^~~~~~~
a.cc:25:47: error: 'Console' was not declared in this scope
25 | if (D[0] == D[1] && D[1] == D[2]) Console.WriteLine("-1");
| ^~~~~~~
a.cc:31:21: error: 'd' was not declared in this scope
31 | d[0] = (D[1] + D[2]) / 2;
| ^
a.cc:38:17: error: 'Console' was not declared in this scope
38 | Console.WriteLine(ans);
| ^~~~~~~
|
s402935582 | p03723 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define WMAX 10000
#define HMAX 100000007
//コメントアウトするとdebug()を実行しない
#define DEBUG
using namespace std;
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
std::fill( (T*)array, (T*)(array+N), val );
}
typedef long long ll;
ll A,B,C,a,b,c,N,W,H,ans = 0,dp[HMAX][WMAX];
string S;
static const ll dx[8] = {0,1,1,1,0,-1,-1,-1},
dy[8] = {1,1,0,-1,-1,-1,0,1};
void solve(){
a = A;
b = B;
c = C;
while(true){
ll i,j,k;
if ((a+b)%2 || (b+c)%2 || (c+a)%2)
{
break;
}
i = (b+c)/2;
j = (c+a)/2;
k = (a+b)/2;
a = i;
b = j;
c = k;
ans++;
if((A == a) && (B == b) && (C == c)){
ans = -1;
break;
}
if(ans > HMAX){
ans = -1;
break;
}
}
}
void debug(){
}
void answer(){
cout << ans << "\n";
}
int main(){
cin >> A >> B >> C;
solve();
#ifdef DEBUG
debug();
#endif
answer();
return 0;
} | /tmp/cc8txrjM.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x225): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/cc8txrjM.o
a.cc:(.text+0x23e): relocation truncated to fit: R_X86_64_PC32 against symbol `S[abi:cxx11]' defined in .bss section in /tmp/cc8txrjM.o
collect2: error: ld returned 1 exit status
|
s021811216 | p03723 | C++ | #include <stdio.h>
#include <algorithm>
int main() {
int A, B, C;
scanf("%d %d %d", &A, &B, &C);
int time = 0;
while ((A % 2 == 0 && B % 2 == 0 && C % 2 == 0) && !(A == B && B == C && C == A)) {
time++;
int TA = (B + C) / 2;
int TB = (A + C) / 2;
int TC = (A + B) / 2;
A = TA;
B = TB;
C = TC;
}
if (A == B && B == C && C == A && A % 2 == 0) {
printf("%d\n", -1);
printf("%d\n",time);
} | a.cc: In function 'int main()':
a.cc:20:2: error: expected '}' at end of input
20 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s572380088 | p03723 | C | #include<stadio.h>
int separate(int,int,int);
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
printf("%d",separate(a,b,c));
return 0;
}
int separate(int a,int b,int c){
int i;
int a2,b2,c2;
const int MAX = 1000000000;
for(i = 1 ,i<=MAX; i++){
a2 = a/2;
b2 = b/2;
c2 = c/2;
a = b2 + c2;
b = a2 + c2;
c = a2 + b2;
if(a % 2 != 0 && b % 2 != 0 && c % 2 != 0) return i;
}
return -1;
} | main.c:1:9: fatal error: stadio.h: No such file or directory
1 | #include<stadio.h>
| ^~~~~~~~~~
compilation terminated.
|
s546449200 | p03723 | C++ | #include<iostream>
#include<vector>
#include<tr1/unordered_map>
#include<queue>
#include<list>
#include<cmath>
#include<algorithm>
#include<string>
#include<time.h>
using namespace std;
using namespace std::tr1;
bool noOdd(int a, int b, int c){
if((a&1) || (b&1) || (c&1)) return false;
return true;
}
bool equal(int a, int b, int, c){
return a==b && b==c;
}
int main(){
int a,b,c;
cin >> a >> b >> c;
int res = 0;
while(noOdd(a,b,c) && equal(a, b, c)){
int a1 = a/2;
int b1 = b/2;
int c1 = c/2;
a = b1+c1;
b = a1+c1;
c = a1+b1;
res++;
}
if(!noOdd(a, b, c) && equal(a, b, c)) res = -1;
cout << res <<endl;
return 0;
} | a.cc:18:31: error: 'c' has not been declared
18 | bool equal(int a, int b, int, c){
| ^
a.cc: In function 'bool equal(int, int, int, int)':
a.cc:19:27: error: 'c' was not declared in this scope
19 | return a==b && b==c;
| ^
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'bool std::__equal_aux1(_II1, _II1, _II2) [with _II1 = int; _II2 = int]':
/usr/include/c++/14/bits/stl_algobase.h:1253:31: required from 'bool std::__equal_aux(_II1, _II1, _II2) [with _II1 = int; _II2 = int]'
1253 | return std::__equal_aux1(std::__niter_base(__first1),
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1254 | std::__niter_base(__last1),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~
1255 | std::__niter_base(__first2));
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1592:30: required from 'bool std::equal(_II1, _II1, _II2) [with _II1 = int; _II2 = int]'
1592 | return std::__equal_aux(__first1, __last1, __first2);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:25:29: required from here
25 | while(noOdd(a,b,c) && equal(a, b, c)){
| ~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1241:58: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1241 | typedef typename iterator_traits<_II1>::value_type _ValueType1;
| ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1242:58: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1242 | const bool __simple = ((__is_integer<_ValueType1>::__value
| ^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1243:61: error: no type named 'value_type' in 'struct std::iterator_traits<int>'
1243 | || __is_pointer<_ValueType1>::__value)
| ^~~~~~~
|
s850535725 | p03723 | C++ | int a,b,c;
cin >> a >> b >> c;
if (!(a%2==0 && b%2 ==0 && c%2==0)) {
cout << "0" << endl;
return 0;
}
int cnt = 0;
if (a%4 != 0)
++cnt;
if (b%4 != 0)
++cnt;
if (c%4!= 0)
++cnt;
if (cnt == 3) {
cout << "-1" << endl;
return 0;
}
if (cnt == 1 || cnt == 2){
cout << 1 << endl;
return 0;
}
cout << "3" << endl; | a.cc:2:5: error: 'cin' does not name a type
2 | cin >> a >> b >> c;
| ^~~
a.cc:3:5: error: expected unqualified-id before 'if'
3 | if (!(a%2==0 && b%2 ==0 && c%2==0)) {
| ^~
a.cc:8:5: error: expected unqualified-id before 'if'
8 | if (a%4 != 0)
| ^~
a.cc:10:5: error: expected unqualified-id before 'if'
10 | if (b%4 != 0)
| ^~
a.cc:12:5: error: expected unqualified-id before 'if'
12 | if (c%4!= 0)
| ^~
a.cc:14:5: error: expected unqualified-id before 'if'
14 | if (cnt == 3) {
| ^~
a.cc:18:5: error: expected unqualified-id before 'if'
18 | if (cnt == 1 || cnt == 2){
| ^~
a.cc:22:5: error: 'cout' does not name a type
22 | cout << "3" << endl;
| ^~~~
|
s785204839 | p03723 | C++ | #include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<iomanip>
#include<algorithm>
using namespace std;
int main() {
int A,B,C;
cin >> A >> B >> C;
int count = 0;
int Ablock[3] = {};
int Bblock[3] = {};
int Cblock[3] = {};
Ablock[0] = A; Bblock[0] = B; Cblock[0] = C;
while(1){
if (A == B && B == C){
count = -1;
break;
}
else if (count > 2 && (Ablock[count % 3] = A && Bblock[count % 3] = B && Cblock[count % 3] = C)) {
count = -1;
break;
}
else if (A % 2 == 1 || B % 2 == 1 || C % 2 == 1) {
break;
}
else{
int A_alt = A;
int B_alt = B;
int C_alt = C;
A = B_alt / 2 + C_alt / 2;
B = A_alt / 2 + C_alt / 2;
C = B_alt / 2 + A_alt / 2;
count++;
}
}
cout << count << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:22:95: error: lvalue required as left operand of assignment
22 | else if (count > 2 && (Ablock[count % 3] = A && Bblock[count % 3] = B && Cblock[count % 3] = C)) {
| ~~^~~~~~~~~~~~~~~~~~~~
|
s005937594 | p03723 | C++ | int main()
{
int a, b, c;
cin >> a >> b >> c;
cout << -1 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> a >> b >> c;
| ^~~
a.cc:5:9: error: 'cout' was not declared in this scope
5 | cout << -1 << endl;
| ^~~~
a.cc:5:23: error: 'endl' was not declared in this scope
5 | cout << -1 << endl;
| ^~~~
|
s394714319 | p03723 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long int lld;
const lld mod = 1e9+7;
const lld INF = 1e9;
const lld MAXN = 1e9;
int main()
{
lld a,b,c;
cin >> a >>b >> c;
if (a%2==1 || b%2== 1 || c%2==1)
{
cout << cnt << endl;
return 0;
}
if (a==b && b==c)
{
cout << -1 << endl;
}else
{
lld cnt = 0;
while(1)
{
cnt++;
lld x=b+c,y=c+a,z=a+b;
a = x / 2;
b = y / 2;
c = z / 2;
if (a%2==1 || b%2== 1 || c%2==1)
{
cout << cnt << endl;
break;
}
if (a == b && b == c)
{
cout << -1 << endl;
break;
}
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:26:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
26 | cout << cnt << endl;
| ^~~
| int
|
s841741558 | p03723 | Java | import java.util.Scanner;
public class a{
public static void main(String[] args){
Scanner scan= new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
int count=0;
if(a==b && b==c){
System.out.println("-1");
}else{
while(a%2==0 && b%2==0 && c%2==0){
int a1=a;
int b1=b;
int c1=c;
a = c1/2 + b1/2;
b = a1/2 + c1/2;
c = a1/2 + b1/2;
count++;
}
System.out.println(count);
}
}
} | Main.java:3: error: class a is public, should be declared in a file named a.java
public class a{
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.