submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s672568647 | p03797 | C++ | #include<iostream>
using namespace std;
int main() {
long long n,m;
cin>>n>>m;
long long ans=0;
while(1) {
if(n>0 && m>1) {
ans++;
n--;
m-=2;
}
else if(m>3) {
ans++;
m-=4;
}
else break;
}
cout<<ans<<endl;
return ;
} | a.cc: In function 'int main()':
a.cc:20:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
20 | return ;
| ^~~~~~
|
s832484216 | p03797 | C++ | #include<iostream>
using namespace std;
#include<string>
int main(){
int N,M;
cin >> N >> M;
long long int num_S=N;
long long int num_C=M;
long long int res=0;
while(num_S>=1 && num_C>=2){
num_S-=1;
num_C-=2;
++res;
}
while(num_C>=4){
num_C-=4;
++res;
if
}
cout << res;
} | a.cc: In function 'int main()':
a.cc:20:3: error: expected '(' before '}' token
20 | }
| ^
| (
|
s122318344 | p03797 | C++ | n, m = map(int, input().split())
ans = 0
if n*2 >= m:
ans += n
else:
ans += n
m -= 2*n
ans += m//4
print(ans) | a.cc:1:1: error: 'n' does not name a type
1 | n, m = map(int, input().split())
| ^
|
s827018141 | p03797 | C++ | // luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int n,m;
int main()
{
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
cin>>n>>m;
cout<<min(n,m/2)+max(m-n*2,h)/4;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:36: error: 'h' was not declared in this scope
10 | cout<<min(n,m/2)+max(m-n*2,h)/4;
| ^
|
s574652527 | p03797 | C++ |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
const ll mod = 1e9 + 7;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef vector<PI> vip;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
int main (){
cin.tie(0);
ios::sync_with_stdio(false);
ll n,m;
cin >> s >> c;
ll ans;
if(c <= s * 2){
ans = c / 2;
}else{
ans = s + (c - s) / 4;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:31:12: error: 's' was not declared in this scope
31 | cin >> s >> c;
| ^
a.cc:31:17: error: 'c' was not declared in this scope
31 | cin >> s >> c;
| ^
|
s886537794 | p03797 | C++ | # https://atcoder.jp/contests/abc055/tasks/arc069_a
# C - Scc Puzzle
import math
N, M = list(map(int, input().split()))
c = 0
# 使えるSを全部使えるか
# CがM * 2個いる
if M >= N * 2:
# Sを全部使う
c += N
# 残っているcだけでSccを作れるだけ作る
c += math.floor((M - N * 2) / 4)
else:
# Sを使えるだけ使う
max_pair = math.floor(M / 2)
c += max_pair
c = int(c)
print(c) | a.cc:1:3: error: invalid preprocessing directive #https
1 | # https://atcoder.jp/contests/abc055/tasks/arc069_a
| ^~~~~
a.cc:2:3: error: invalid preprocessing directive #C
2 | # C - Scc Puzzle
| ^
a.cc:7:3: error: invalid preprocessing directive #\U00004f7f\U00003048\U0000308bS\U00003092\U00005168\U000090e8\U00004f7f\U00003048\U0000308b\U0000304b
7 | # 使えるSを全部使えるか
| ^~~~~~~~~~~~~~~~~~~~~
a.cc:8:3: error: invalid preprocessing directive #C\U0000304cM
8 | # CがM * 2個いる
| ^~~~
a.cc:10:7: error: invalid preprocessing directive #S\U00003092\U00005168\U000090e8\U00004f7f\U00003046
10 | # Sを全部使う
| ^~~~~~~~~~~
a.cc:12:7: error: invalid preprocessing directive #\U00006b8b\U00003063\U00003066\U00003044\U0000308bc\U00003060\U00003051\U00003067Scc\U00003092\U00004f5c\U0000308c\U0000308b\U00003060\U00003051\U00004f5c\U0000308b
12 | # 残っているcだけでSccを作れるだけ作る
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:15:7: error: invalid preprocessing directive #S\U00003092\U00004f7f\U00003048\U0000308b\U00003060\U00003051\U00004f7f\U00003046
15 | # Sを使えるだけ使う
| ^~~~~~~~~~~~~~~~~
a.cc:3:1: error: 'import' does not name a type
3 | import math
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
|
s423181329 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
const ll mod = 1e9 + 7;
int main()
{
ll n, m;
cin >> n >> m;
n = min(n, m / 2);
m = m - s * 2;
cout << n + m / 4 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:12:13: error: 's' was not declared in this scope
12 | m = m - s * 2;
| ^
|
s752905187 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
int main() {
ll n,m;
cin>>n>>m;
if(m*2<=n){
cout << m/2;
return 0;
}
cout << n+max{0,(m-2*n)/4};
// your code goes here
return 0;
} | a.cc: In function 'int main()':
a.cc:15:18: error: invalid operands of types 'll' {aka 'long long int'} and '<unresolved overloaded function type>' to binary 'operator+'
15 | cout << n+max{0,(m-2*n)/4};
| ~^~~~
|
s875725253 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007
int main() {
ll n,m;
cin>>n>>m;
if(m*2<=n){
cout << m/2;
return 0;
}
cout << n+max(0,(m-2*n)/4);
// your code goes here
return 0;
} | a.cc: In function 'int main()':
a.cc:15:22: error: no matching function for call to 'max(int, ll)'
15 | cout << n+max(0,(m-2*n)/4);
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:15:22: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
15 | cout << n+max(0,(m-2*n)/4);
| ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:15:22: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
15 | cout << n+max(0,(m-2*n)/4);
| ~~~^~~~~~~~~~~~~
|
s483967434 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,m;
int main{
cin>>m>>n;
if(m<=((m*2)+n)/4)
cout<<((m*2)+n)/4<<endl;
return 0;
} | a.cc:4:5: error: cannot declare '::main' to be a global variable
4 | int main{
| ^~~~
a.cc:5:14: error: expected '}' before ';' token
5 | cin>>m>>n;
| ^
a.cc:4:9: note: to match this '{'
4 | int main{
| ^
a.cc:5:11: error: invalid user-defined conversion from 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} to 'int' [-fpermissive]
5 | cin>>m>>n;
| ~~~~~~^~~
In file included from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/istream:40,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/bits/basic_ios.h:121:16: note: candidate is: 'std::basic_ios<_CharT, _Traits>::operator bool() const [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
121 | explicit operator bool() const
| ^~~~~~~~
/usr/include/c++/14/bits/basic_ios.h:121:16: note: return type 'bool' of explicit conversion function cannot be converted to 'int' with a qualification conversion
a.cc:6:5: error: expected unqualified-id before 'if'
6 | if(m<=((m*2)+n)/4)
| ^~
a.cc:8:9: error: expected unqualified-id before 'return'
8 | return 0;
| ^~~~~~
a.cc:9:1: error: expected declaration before '}' token
9 | }
| ^
|
s736743090 | p03797 | C++ | #include <iostream>
#include <conio.h>
using namespace std;
int main() {
//scc何組か
unsigned long s; unsigned long c;
cin >> s;
cin >> c;
while (s * 2 < c) {
s++;
c -= 2;
}
cout << c / 2 << endl;
//_getch();
}
| a.cc:2:10: fatal error: conio.h: No such file or directory
2 | #include <conio.h>
| ^~~~~~~~~
compilation terminated.
|
s027268434 | p03797 | C++ | #include<iostream>
using namespace std;
long long int n,m,nd;
int main(){
cin>>n>>m;/
nd=2*n;
if(nd>m)cout<<m/2<<endl;
else if(nd==m)cout<<n<<endl;
else{
m-=nd;
m/=4;
cout<<n+m<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:5:15: error: expected primary-expression before '/' token
5 | cin>>n>>m;/
| ^
|
s762179264 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
long long n,m,h=0;
int main()
{
cin>>n>>m;
cout<<min(n,m/2)+max(m-n*2,h)/4;。
return 0;
} | a.cc:8:37: error: extended character 。 is not valid in an identifier
8 | cout<<min(n,m/2)+max(m-n*2,h)/4;。
| ^
a.cc: In function 'int main()':
a.cc:8:37: error: '\U00003002' was not declared in this scope
8 | cout<<min(n,m/2)+max(m-n*2,h)/4;。
| ^~
|
s263700396 | p03797 | C++ | // luogu-judger-enable-o2
#include <bits/stdc++.h>
using namespace std;
int main(){
long long n,m,s;
cin>>n>>m;
s=min(n,m/2);
m=max((m-n*2),0);
cout<<s+m/4<<endl;
return 0;
}//不开long long毁一生。。。 | a.cc: In function 'int main()':
a.cc:8:10: error: no matching function for call to 'max(long long int, int)'
8 | m=max((m-n*2),0);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:10: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
8 | m=max((m-n*2),0);
| ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:10: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
8 | m=max((m-n*2),0);
| ~~~^~~~~~~~~~~
|
s390585356 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,m,t;
int main(){
cin>>n>>m;
t=2*n;
if(t>m)
cout<<m/2<<endl;
else if(t==m)
cout<<n<<endl;
else
m-=t;
m/=4;
cout<<n+m<<endl;
}
return 0;
} | a.cc:16:5: error: expected unqualified-id before 'return'
16 | return 0;
| ^~~~~~
a.cc:17:1: error: expected declaration before '}' token
17 | }
| ^
|
s100155328 | p03797 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
ll n,m;
cin>>n>>m;
cout << max(0,m-2*n)/4 + n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'max(int, ll)'
8 | cout << max(0,m-2*n)/4 + n << endl;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
8 | cout << max(0,m-2*n)/4 + n << endl;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
8 | cout << max(0,m-2*n)/4 + n << endl;
| ~~~^~~~~~~~~
|
s502908715 | p03797 | C++ | #include <iostream>
using namespace std;
typedef long long ll;
int main(){
ll n,m;
cin>>n>>m;
cout << max(0,m-2*n)/4 + n << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:16: error: no matching function for call to 'max(int, ll)'
8 | cout << max(0,m-2*n)/4 + n << endl;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:8:16: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
8 | cout << max(0,m-2*n)/4 + n << endl;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
|
s010128894 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,m;
cin>>n>>m;
long long ans=min(n,m/2)+max(m-n*2,0)/4;
cout<<ans<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:33: error: no matching function for call to 'max(long long int, int)'
7 | long long ans=min(n,m/2)+max(m-n*2,0)/4;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:7:33: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
7 | long long ans=min(n,m/2)+max(m-n*2,0)/4;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:7:33: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
7 | long long ans=min(n,m/2)+max(m-n*2,0)/4;
| ~~~^~~~~~~~~
|
s409726582 | p03797 | C++ | #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int ans;
if (N>=floor(M/2)) {
ans = floor(M/2);
}
else {
int d = M - N*2;
ans = floor(M / 2) + floor(d / 3);
}
cout << ans;
} | a.cc: In function 'int main()':
a.cc:12:16: error: 'floor' was not declared in this scope
12 | if (N>=floor(M/2)) {
| ^~~~~
|
s307440491 | p03797 | C | #include <stdio.h>
int
main(int argc, char *argv[])
{
long long n, m;
scanf("%lld %lld", &n, &m);
long long ans;
if(n > m / 2) ans = m / 2;
else ans = (m - 2*n)/4 + n;
printf("%lld\n", ans);
return 0;
| main.c: In function 'main':
main.c:16:3: error: expected declaration or statement at end of input
16 | return 0;
| ^~~~~~
|
s523121565 | p03797 | C++ | nclude<iostream>
#include<vector>
#include<cmath>
#include<algorithm>
#include <string>
#include <utility>
#include<array>
#include<set>
#define EPS (1e-7)
using namespace std;
int main() {
int N, M, ans =0;
cin >> N >> M;
if (N > 0) {
ans += min(N, M / 2);
N -= min(N, M / 2);
M -= 2 * min(N, M / 2);
}
if (M > 4) {
ans += M / 4;
}
cout << ans << endl;
return 0;
} | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude<iostream>
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
164 | __is_null_pointer(std::nullptr_t)
| ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
159 | __is_null_pointer(_Type)
| ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'
164 | __is_null_pointer(std::nullptr_t)
| ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:295:27: error: 'size_t' has not been declared
295 | template <typename _Tp, size_t = sizeof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'
666 | struct is_null_pointer<std::nullptr_t>
| ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
666 | struct is_null_pointer<std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
670 | struct is_null_pointer<const std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
674 | struct is_null_pointer<volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
678 | struct is_null_pointer<const volatile std::nullptr_t>
| ^
/usr/include/c++/14/type_traits:984:26: error: 'size_t' has not been declared
984 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:985:40: error: '_Size' was not declared in this scope
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:985:46: error: template argument 1 is invalid
985 | struct __is_array_known_bounds<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
1429 | : public integral_constant<std::size_t, alignof(_Tp)>
| ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'
1438 | : public integral_constant<std::size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
1438 | : public integral_constant<std::size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
1440 | template<typename _Tp, std::size_t _Size>
| ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
1441 | struct rank<_Tp[_Size]>
| ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
1441 | struct rank<_Tp[_Size]>
| ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
1442 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
1446 | : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
| ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1451:32: error: 'size_t' was not declared in this scope
1451 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:64:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
63 | #include <bits/version.h>
+++ |+#include <cstddef>
64 |
/usr/include/c++/14/type_traits:1451:41: error: template argument 1 is invalid
1451 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1451:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1453:26: error: 'size_t' has not been declared
1453 | template<typename _Tp, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1454:23: error: '_Size' was not declared in this scope
1454 | struct extent<_Tp[_Size], 0>
| ^~~~~
/usr/include/c++/14/type_traits:1454:32: error: template argument 1 is invalid
1454 | struct extent<_Tp[_Size], 0>
| ^
/usr/include/c++/14/type_traits:1455:32: error: 'size_t' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1455:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1455:40: error: '_Size' was not declared in this scope
1455 | : public integral_constant<size_t, _Size> { };
| ^~~~~
/usr/include/c++/14/type_traits:1455:45: error: template argument 1 is invalid
1455 | : public integral_constant<size_t, _Size> { };
| ^
/usr/include/c++/14/type_traits:1455:45: error: template argument 2 is invalid
/usr/include/c++/14/type_traits:1457:42: error: 'size_t' has not been declared
1457 | template<typename _Tp, unsigned _Uint, size_t _Size>
| ^~~~~~
/usr/include/c++/14/type_traits:1458:23: error: '_Size' was not declared in this scope
1458 | struct extent<_Tp[_Size], _Uint>
| ^~~~~
/usr/include/c++/14/type_traits:1458:36: error: template argument 1 is invalid
1458 | struct extent<_Tp[_Size], _Uint>
| ^
/usr/include/c++/14/type_traits:1463:32: error: 'size_t' was not declared in this scope
1463 | : public integral_constant<size_t, 0> { };
| ^~~~~~
/usr/include/c++/14/type_traits:1463:32: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1463:41: error: template argument 1 is invalid
1463 | : public integral_constant<size_t, 0> { };
| ^
/usr/include/c++/14/type_traits:1463:41: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1857:26: error: 'size_t' does not name a type
1857 | { static constexpr size_t __size = sizeof(_Tp); };
| ^~~~~~
/usr/include/c++/14/type_traits:1857:26: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/c++/14/type_traits:1859:14: error: 'size_t' has not been declared
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~~~~
/usr/include/c++/14/type_traits:1859:48: error: '_Sz' was not declared in this scope
1859 | template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
| ^~~
/usr/include/c++/14/type_traits:1860:14: error: no default argument for '_Tp'
1860 | struct __select;
| ^~~~~~~~
/usr/include/c++/14/type_traits:1862:14: error: 'size_t' has not been declared
1862 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1863:23: error: '_Sz' was not declared in this scope
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^~~
/usr/include/c++/14/type_traits:1863:57: error: template argument 1 is invalid
1863 | struct __select<_Sz, _List<_Uint, _UInts...>, true>
| ^
/usr/include/c++/14/type_traits:1866:14: error: 'size_t' has not been declared
1866 | template<size_t _Sz, typename _Uint, typename... _UInts>
| ^~~~~~
/usr/include/c++/14/type_traits:1867:23: error: '_Sz' was not declared in this scope
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| ^~~
/usr/include/c++/14/type_traits:1867:58: error: template argument 1 is invalid
1867 | struct __select<_Sz, _List<_Uint, _UInts...>, false>
| |
s007926877 | p03797 | C | #include<stdio.h>
int main(){
long long int ans=1,k,i;
scanf("%lld",&k);
for(i=1;i<=k;i++){
ans*=i;
}
k%=((10e9)+7);
printf("%lld\n",k);
return 0;
}
| main.c: In function 'main':
main.c:12:4: error: invalid operands to binary % (have 'long long int' and 'double')
12 | k%=((10e9)+7);
| ^~~~~~~~~~~~
| |
| double
|
s041954977 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
long long a,b;
int main()
{
cin>>a>>b;
cout<<min(a,b/2)+max(b-a*2,0)/4;
} | a.cc: In function 'int main()':
a.cc:7:21: error: no matching function for call to 'max(long long int, int)'
7 | cout<<min(a,b/2)+max(b-a*2,0)/4;
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:7:21: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
7 | cout<<min(a,b/2)+max(b-a*2,0)/4;
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:7:21: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
7 | cout<<min(a,b/2)+max(b-a*2,0)/4;
| ~~~^~~~~~~~~
|
s773987345 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c,a;
scanf("%lld%lld",&s,&c);
a=((s*2)+c)/4;
printf("%lld",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",&s,&c);
| ^
a.cc:7:27: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",&s,&c);
| ^
a.cc:8:6: error: expected unqualified-id before '=' token
8 | a=((s*2)+c)/4;
| ^
a.cc:9:20: error: expected primary-expression before ')' token
9 | printf("%lld",a);
| ^
|
s830786237 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c,a;
scanf("%lld%lld",&s,&c);
a=((s*2)+c)/4;
printf("%lld",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:24: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",&s,&c);
| ^
a.cc:7:27: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",&s,&c);
| ^
a.cc:8:6: error: expected unqualified-id before '=' token
8 | a=((s*2)+c)/4;
| ^
a.cc:9:20: error: expected primary-expression before ')' token
9 | printf("%lld",a);
| ^
|
s664395769 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c,a;
scanf("%lld%lld",s,c);
a=((s*2)+c)/4;
printf("%lld",a);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:7:25: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:8:6: error: expected unqualified-id before '=' token
8 | a=((s*2)+c)/4;
| ^
a.cc:9:20: error: expected primary-expression before ')' token
9 | printf("%lld",a);
| ^
|
s286833178 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c;
scanf("%lld%lld",s,c);
printf("%lld",((s*2)+c)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:7:25: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:8:22: error: expected primary-expression before '*' token
8 | printf("%lld",((s*2)+c)/4);
| ^
a.cc:8:27: error: expected primary-expression before ')' token
8 | printf("%lld",((s*2)+c)/4);
| ^
|
s778968826 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c;
scanf("%lld%lld",s,c);
printf("%lld",((m*2)+n)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:7:25: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:8:21: error: 'm' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
a.cc:8:26: error: 'n' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
|
s537553677 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
typedef long long s,c;
scanf("%lld%lld",s,c);
printf("%lld",((m*2)+n)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ',' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:7:25: error: expected primary-expression before ')' token
7 | scanf("%lld%lld",s,c);
| ^
a.cc:8:21: error: 'm' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
a.cc:8:26: error: 'n' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
|
s634922991 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
long long s,c;
scanf("%ld%ld",s,c);
printf("%ld",((m*2)+n)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:20: error: 'm' was not declared in this scope
8 | printf("%ld",((m*2)+n)/4);
| ^
a.cc:8:25: error: 'n' was not declared in this scope
8 | printf("%ld",((m*2)+n)/4);
| ^
|
s455339370 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
long long int s,c;
scanf("%lld%lld",s,c);
printf("%lld",((m*2)+n)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'm' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
a.cc:8:26: error: 'n' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
|
s466087576 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
long long s,c;
scanf("%lld%lld",s,c);
printf("%lld",((m*2)+n)/4);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:21: error: 'm' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
a.cc:8:26: error: 'n' was not declared in this scope
8 | printf("%lld",((m*2)+n)/4);
| ^
|
s118320279 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long s,c;
cin>>s>>c;
while(s!=c&&s!>c)
{
c-=2;
s++;
}
cout<<c;
return 0;
} | a.cc: In function 'int main()':
a.cc:7:18: error: expected ')' before '!' token
7 | while(s!=c&&s!>c)
| ~ ^
| )
a.cc:7:19: error: expected primary-expression before '>' token
7 | while(s!=c&&s!>c)
| ^
|
s870895003 | p03797 | C++ | #include<iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
int main() {
long N,M;
cin >> N>>M;
M = M - N*2;
M = floor(M / 4);
cout << N+M << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:9:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> N>>M;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout << N+M << endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:12:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout << N+M << endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s242612221 | p03797 | C | #include <iostream>
int main() {
int64_t N, M;
std::cin >> N >> M;
std::cout << (std::min(N*2,M)+M)/4 << std::endl;
} | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s734441599 | p03797 | C++ | #include<iostream>
#include<cstdio>
using namespace std;
long long n,m,h;
int main()
{
cin>>n>>m;
h=min(n,m/2);
m=m-n*2;
m=max(m,0);
cout<<h+m/4;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:14: error: no matching function for call to 'max(long long int&, int)'
10 | m=max(m,0);
| ~~~^~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:10:14: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
10 | m=max(m,0);
| ~~~^~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
|
s810428686 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,m;
cin>>n,m;
if(2*n<=m)cout<<n+(m-2n)/4<<endl;
else cout<<m/2<<endl;
} | a.cc: In function 'int main()':
a.cc:7:24: error: unable to find numeric literal operator 'operator""n'
7 | if(2*n<=m)cout<<n+(m-2n)/4<<endl;
| ^~
|
s605899897 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef vector<int> VI;
typedef vector<string> VS;
//container util
#define SORT(c) sort((c).begin(),(c).end())
//repetition
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
int main(void){
int N, M; cin >> N >> M;
int ans = 0;
if((M/2) >= N){
ans += (N);
M -= (2*N);
ans += (M/4);
}else{
ans += (M/2)
M -= (M/2)*2;
ans += (M/4);
}
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:30:29: error: expected ';' before 'M'
30 | ans += (M/2)
| ^
| ;
31 | M -= (M/2)*2;
| ~
|
s328333670 | p03797 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
#define endl '\n'
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll n, m;
ll ans = 0;
cin >> n >> m;
ans += min(n, m / 2);
n -= ans;
m -= ans * 2;
ans += max(0, m / 4);
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:15: error: no matching function for call to 'max(int, long long int)'
16 | ans += max(0, m / 4);
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:16:15: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
16 | ans += max(0, m / 4);
| ~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:16:15: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
16 | ans += max(0, m / 4);
| ~~~^~~~~~~~~~
|
s248119035 | p03797 | C++ | #include<iostream>;
using namespace std;
int main()
{
long long n,m;;
cin>>m>>n;
if(m<=((m*2)+n)/4)cout<<((m*2)+n)/4<<endl;
else cout<<n/2<<endl;
return 0;
} | a.cc:1:9: fatal error: iostream>��: No such file or directory
1 | #include<iostream>;
| ^~~~~~~~~~~~
compilation terminated.
|
s233681838 | p03797 | C++ | #include<iostream>;
using namespace std;
int main()
{
long long n,m;;
cin>>m>>n;
if(m<=((m*2)+n)/4)cout<<((m*2)+n)/4<<endl;
else cout<<n/2<<endl;
} | a.cc:1:9: fatal error: iostream>��: No such file or directory
1 | #include<iostream>;
| ^~~~~~~~~~~~
compilation terminated.
|
s768553637 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
cin>>a>>b;
if(a<=((a*2)+b)/4)
cout<<((a*2)+b)/4<<endl;
else
cout<<b/2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin>>a>>b;
| ^
a.cc:5:13: error: 'b' was not declared in this scope
5 | cin>>a>>b;
| ^
|
s277628059 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
cin>>a>>b;
if(m<=((a*2)+b)/4)
cout<<((a*2)+b)/4<<endl;
else
cout<<b/2<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:5:10: error: 'a' was not declared in this scope
5 | cin>>a>>b;
| ^
a.cc:5:13: error: 'b' was not declared in this scope
5 | cin>>a>>b;
| ^
a.cc:6:8: error: 'm' was not declared in this scope; did you mean 'tm'?
6 | if(m<=((a*2)+b)/4)
| ^
| tm
|
s356347280 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> p_int;
typedef pair<ll,ll> p_ll;
typedef tuple<ll,ll,ll> t3_ll;
int dx[] = {-1,0,1,0},dy[] = {0,1,0,-1};
int prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97};
const ll inf = 1000000007;
int main() {
ll n,m;
cin >> n >> m;
if (n * 2 < m) {
ll a = m - n * 2;
cout << n + a/4 << endl;
return 0;
} else {
cout << y/2 << endl;
return 0;
}
} | a.cc: In function 'int main()':
a.cc:20:25: error: 'y' was not declared in this scope
20 | cout << y/2 << endl;
| ^
|
s674940867 | p03797 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
using namespace std;
int main()
{
long long int N,M,ans;
cin>>N>>M;
cout<< min(N,M/2)+max(0,(M-2*N)/4) <<endl;
}
| a.cc: In function 'int main()':
a.cc:13:25: error: no matching function for call to 'max(int, long long int)'
13 | cout<< min(N,M/2)+max(0,(M-2*N)/4) <<endl;
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:13:25: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
13 | cout<< min(N,M/2)+max(0,(M-2*N)/4) <<endl;
| ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:13:25: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
13 | cout<< min(N,M/2)+max(0,(M-2*N)/4) <<endl;
| ~~~^~~~~~~~~~~~~
|
s722885192 | p03797 | C++ | // #include <bits/stdc++.h>
#include <map>
#include <set>
#include <ctime>
#include <cstring>
#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;
#define mod 1000000007
#define INF 1000000000
#define mp make_pair
#define pb push_back
#define mt make_tuple
#define eb emplace_back
#define all(x) begin(x), end(x)
#define len(x) ((int)(x).size())
#define contains(a, x) (a.find(x) != end(a))
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define F(i,a,b) for(int i = (int)(a); i < (int)(b); ++i)
#define RF(i,a,b)for(int i = (int)(a); i >= (int)(b); --i)
using dbl = double;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvl = vector<long long>;
using pi = pair<int,int>;
#define fast() {ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#define log(x) cout << x << endl;
// ll brute(ll s, ll c) {
// int x = 0;
// while (s*2 < c) {
// s += 1;
// c -= 2;
// }
// return min(s, c>>1);
// }
ll solve(ll s, ll c) {
if (s*2 >= c) {
return min(s, c>>1);
}
ll x = round((c-2*s)/4);
s += x, c -= 2*x;
if (s*2 < c) s+=1, c-=2;
return min(s, c>>1);
}
int main() {
ll s, c;
cin >> s >> c;
log(solve(s, c))
return 0;
}
| a.cc: In function 'll solve(ll, ll)':
a.cc:50:16: error: 'round' was not declared in this scope
50 | ll x = round((c-2*s)/4);
| ^~~~~
|
s188805216 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//Compiler version g++ 6.3.0
int main()
{
ll n, m;
cin >> n >> m;
ll c = 2*n + m;
cout << max(c/4, min(n, m/2))) << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:12:38: error: expected ';' before ')' token
12 | cout << max(c/4, min(n, m/2))) << endl;
| ^
| ;
|
s541269999 | p03797 | C++ | /* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>
// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
/* ---------- Namespace ---------- */
using namespace std;
/* ---------- Type Abbreviation ---------- */
template <typename T>
using PQ = priority_queue<T>;
template <typename T>
using GPQ = priority_queue<T, vector<T>, greater<T>>;
using ll = long long;
#define fst first
#define snd second
#define mp make_pair
#define mt make_tuple
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/* ---------- conversion ---------- */
#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)
/* ---------- container ---------- */
#define ALL(v) (v).begin(), (v).end()
#define SIZE(v) (LL((v).size()))
#define each(itr,v) for(auto (itr):(v))
#define FIND(v, k) (v).find(k) != (v).end()
#define VFIND(v, k) find(ALL(v), k) != (v).end()
#define gsort(b, e) sort(b, e, greater<decltype(*b)>())
/* ----------- debug ---------- */
template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
os << "[";
for (auto vv : v)
os << vv << ",";
return os << "]";
}
template <class T>
ostream& operator<<(ostream& os, set<T> v) {
os << "[";
for (auto vv : v)
os << vv << ",";
return os << "]";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
return os << "(" << p.fst << "," << p.snd << ")";
}
/* ---------- Constants ---------- */
// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// mt19937 mert(LL(time(0)));
/* ---------- Short Functions ---------- */
template <typename T>
T sq(T a) {
return a * a;
}
template <typename T>
T gcd(T a, T b) {
if (a > b) return gcd(b, a);
return a == 0 ? b : gcd(b % a, a);
}
template <typename T, typename U>
T mypow(T b, U n) {
if (n == 0) return 1;
if (n == 1) return b /* % MOD */;
if (n % 2 == 0) {
return mypow(b * b /* % MOD */, n / 2);
}
else {
return mypow(b, n - 1) * b /* % MOD */;
}
}
ll pcnt(ll b) {
return __builtin_popcountll(b);
}
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
ll N, M;
cin >> N >> M;
if (2 * N >= M) cout << M / 2 < endl;
else cout << N << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:142: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>')
142 | if (2 * N >= M) cout << M / 2 < endl;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/istream:40,
from /usr/include/c++/14/fstream:40,
from a.cc:5:
/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:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
142 | if (2 * N >= M) cout << M / 2 < 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:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::reverse_iterator<_Iterator>'
142 | if (2 * N >= M) cout << M / 2 < 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:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
142 | if (2 * N >= M) cout << M / 2 < 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:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::move_iterator<_IteratorL>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51:
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator<(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
1045 | operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1045:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::pair<_T1, _T2>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54:
/usr/include/c++/14/string_view:673:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator<(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
673 | operator< (basic_string_view<_CharT, _Traits> __x,
| ^~~~~~~~
/usr/include/c++/14/string_view:673:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
142 | if (2 * N >= M) cout << M / 2 < 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:142:41: note: 'std::basic_ostream<char>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
142 | if (2 * N >= M) cout << M / 2 < 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:142:41: note: couldn't deduce template parameter '_CharT'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3874 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3874:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
3888 | operator<(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3888:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator<(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
3901 | operator<(const _CharT* __lhs,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3901:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: mismatched types 'const _CharT*' and 'std::basic_ostream<char>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/tuple:2600:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator<(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
2600 | operator<(const tuple<_TElements...>& __t,
| ^~~~~~~~
/usr/include/c++/14/tuple:2600:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::tuple<_UTypes ...>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from /usr/include/c++/14/vector:66,
from /usr/include/c++/14/bits/random.h:34,
from /usr/include/c++/14/random:48,
from a.cc:14:
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator<(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
2089 | operator<(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
| ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2089:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::vector<_Tp, _Alloc>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from a.cc:17:
/usr/include/c++/14/array:339:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> bool std::operator<(const array<_Tp, _Nm>&, const array<_Tp, _Nm>&)'
339 | operator<(const array<_Tp, _Nm>& __a, const array<_Tp, _Nm>& __b)
| ^~~~~~~~
/usr/include/c++/14/array:339:5: note: template argument deduction/substitution failed:
a.cc:142:41: note: 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} is not derived from 'const std::array<_Tp, _Nm>'
142 | if (2 * N >= M) cout << M / 2 < endl;
| ^~~~
In file included from /usr/include/c++/14/dequ |
s604502812 | p03797 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
using namespace std;
int main(){
long long N,M,sum=0;
cin >> N >> M;
if(2*n<=m){
sum=N+(M-2*N)/4;
}else sum=M/2;
cout << sum<< endl;
} | a.cc: In function 'int main()':
a.cc:10:14: error: 'n' was not declared in this scope
10 | if(2*n<=m){
| ^
a.cc:10:17: error: 'm' was not declared in this scope
10 | if(2*n<=m){
| ^
|
s609200783 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
ll N,M;
int main(){
cin >> N >> M;
ll ans=0;
if(N*2 <= M) ans += N + (M-(2*N))/4;
else if ans += M/2;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:11: error: expected '(' before 'ans'
11 | else if ans += M/2;
| ^~~
| (
|
s946622478 | p03797 | C++ | #include<iostream>
using namespace std;
int main()
{
long long int a,b;
cin>>a>>b;
if(a<=((a*2)+b)/4))
{
cout<<(a*2)+b)/4<<endl;
}
else
{
cout<<b/2<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:7:23: error: expected primary-expression before ')' token
7 | if(a<=((a*2)+b)/4))
| ^
|
s833208759 | p03797 | Java | import java.util.*;
public class Main {
public static void main(String args[]) {
int n = sc.nextInt();
int m = sc.nextInt();
System.out.println((int) Math.foolo((n * 2 + m) / 4));
}
} | Main.java:5: error: cannot find symbol
int n = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:6: error: cannot find symbol
int m = sc.nextInt();
^
symbol: variable sc
location: class Main
Main.java:7: error: cannot find symbol
System.out.println((int) Math.foolo((n * 2 + m) / 4));
^
symbol: method foolo(int)
location: class Math
3 errors
|
s664200554 | p03797 | C++ | N, M = gets.split.map(&:to_i)
if N > M/2
print M/2, "\n"
else
print (M - 2 * N) / 4 + N, "\n"
end
| a.cc:1:1: error: 'N' does not name a type
1 | N, M = gets.split.map(&:to_i)
| ^
|
s972661886 | p03797 | C++ | #include "stdafx.h"
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<stack>
#include<map>
#include<queue>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
if (n * 2 >= m)cout << n << endl;
else cout << (n * 2 + m) / 4 << endl;
getchar();
getchar();
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s765260513 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long n, m;
cin >> n >> m;
if (n - m / 2 < 0)
{
while (n - m / 2 < 0)
{
if(n-m/2<=100000){m-=100000;n+=50000}
m -= 2;
n++;
}
cout << m/2;
}
else
{
cout << m / 2;
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:11:49: error: expected ';' before '}' token
11 | if(n-m/2<=100000){m-=100000;n+=50000}
| ^
| ;
|
s084300351 | p03797 | C++ | #include "stdafx.h"
#include "iostream"
using namespace std;
int main() {
long n, m;
cin >> n >> m;
if (2 * n < m) {
long np = 2 * n;
long mp = m - (2 * n);
mp /= 4;
cout << np + mp;
}
else {
long mp = m / 2;
cout << mp;
}
return 0;
}
| a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s114402970 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long n, m;
cin >> n >> m;
if (n - m / 2 < 0)
{
for (; n - m / 2 <= 0)
{
m -= 2;
n++;
}
}
else
{
cout << m / 2;
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:9:30: error: expected ';' before ')' token
9 | for (; n - m / 2 <= 0)
| ^
| ;
|
s129685587 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
long long n, m;
cin >> n >> m;
if (n - m / 2 < 0)
{
for (;n - m / 2 <= 0);)
{
m-=2;
n++;
}
}
else
{
cout << m / 2;
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:9:29: error: expected ';' before ')' token
9 | for (;n - m / 2 <= 0);)
| ^
| ;
a.cc:9:31: error: expected primary-expression before ')' token
9 | for (;n - m / 2 <= 0);)
| ^
|
s584899742 | p03797 | C++ | #include <bits/stdc++.h>
int main(int argc, char const *argv[])
{
long long n,m;
cin>>n>>m;
if(n-m/2<1){
cout<<n;
}else{
cout<<m/2;
}
return 0;
}
| a.cc: In function 'int main(int, const char**)':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>n>>m;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:7:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
7 | cout<<n;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:9:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<m/2;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s970526337 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
ll N, M;
cin >> N >> M;
ll a = min(N, M / 2); // Sとcの組み合わせで作る
ll b = (M - 2 * a) / 4; // cのみで作る
cout << a + b << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:5:4: error: 'll' was not declared in this scope
5 | ll N, M;
| ^~
a.cc:6:11: error: 'N' was not declared in this scope
6 | cin >> N >> M;
| ^
a.cc:6:16: error: 'M' was not declared in this scope
6 | cin >> N >> M;
| ^
a.cc:7:6: error: expected ';' before 'a'
7 | ll a = min(N, M / 2); // Sとcの組み合わせで作る
| ^~
| ;
a.cc:8:6: error: expected ';' before 'b'
8 | ll b = (M - 2 * a) / 4; // cのみで作る
| ^~
| ;
a.cc:9:12: error: 'a' was not declared in this scope
9 | cout << a + b << endl;
| ^
a.cc:9:16: error: 'b' was not declared in this scope
9 | cout << a + b << endl;
| ^
|
s244886295 | p03797 | C++ | #include <iostream>
using namespace std;
int main() {
long int s, c, a;
cin >> s >> c;
if (s >= c / 2){
cout << c / 2 << endl;
}else{
cour << ((c / 2) - s) / 2 + s << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:10:17: error: 'cour' was not declared in this scope
10 | cour << ((c / 2) - s) / 2 + s << endl;
| ^~~~
|
s680398438 | p03797 | C++ | #include <iostream>
using namespace std;
int main() {
long int s, c, a;
cin >> s >> c;
if (s >= c / 2){
cout << c / 2 << endl;
}else{
cout << a = (c / 2) / 2 << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:41: error: invalid operands of types 'long int' and '<unresolved overloaded function type>' to binary 'operator<<'
9 | cout << a = (c / 2) / 2 << endl;
| ~~~~~~~~~~~~^~~~~~~
|
s421481699 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long N;
long M;
long a = 0;
cin >> M >> N;
if(N/2 < M){
a = N / 2;
}
else{
if(N - M * 2 > 3){
M = M + (N - M * 2) / 4
}
a = M;
}
cout << a << endl;
} | a.cc: In function 'int main()':
a.cc:16:28: error: expected ';' before '}' token
16 | M = M + (N - M * 2) / 4
| ^
| ;
17 | }
| ~
|
s531575693 | p03797 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
long int s, c, a;
cin >> s >> c;
if (s > c / 2){
cout << c / 2 << endl;
}else{
a = (c / 2) - s
a = a / 2;
cout << (c / 2) + a << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'a'
11 | a = (c / 2) - s
| ^
| ;
12 | a = a / 2;
| ~
|
s622660812 | p03797 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
long int s, c, a;
cin >> s >> c;
if (s > c / 2){
cout << c / 2 << endl;
}else{
a = (c / 2) - s
a = a / 2
cout << (c / 2) + a << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'a'
11 | a = (c / 2) - s
| ^
| ;
12 | a = a / 2
| ~
|
s185373918 | p03797 | C++ | #include <iostream>
using namespace std;
int main(){
int n,m;
cin>>n>>m;
if(m==1) {cout<<0<<"\n";return 0;}
if(n>=m) {cout<<m/2<<"\n"; return 0;}
if(n*2>=m){cout<<m/2<<"\n";return 0;}
ll ans=0;
m = m-n*2;
ans += m/4;
cout<<ans+n<<"\n";
}
| a.cc: In function 'int main()':
a.cc:10:3: error: 'll' was not declared in this scope
10 | ll ans=0;
| ^~
a.cc:12:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | ans += m/4;
| ^~~
| abs
|
s902063034 | p03797 | C++ | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
long long int main(void){
int a,b,ans;
cin>>a>>b;
if(a<=b*2){
ans=a;
}
ans=ans+(b-a*2)/4;
cout<<ans<<endl;
} | a.cc:5:11: error: '::main' must return 'int'
5 | long long int main(void){
| ^~~
|
s429124702 | p03797 | C++ | #include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
using namespace std;
int main()
{
long long N,M;
cin>>N>>M;
if(2*N>=M){
cout<M/2<<endl;
}
else{
cout<<N+(M-2*N)/4<<endl;
}
} | a.cc: In function 'int main()':
a.cc:11:13: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
11 | cout<M/2<<endl;
| ~~~^~~~~~
|
s421720337 | p03797 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long
int main() {
ll n, m; cin >> n >> m;
ll ans = min(n, m/2);
if (ans == n) {
m -= 2*ans;
ans += m/4;
}
cout << ans << endl;
return 0;
} | a.cc:5:4: error: expected ';' before 'main'
5 | int main() {
| ^~~~~
| ;
|
s648294453 | p03797 | Java | import java.util.Scanner;
public class C055 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
long n=sc.nextLong(); //S
long m=sc.nextLong(); //C
int cnt=0;
if( m>=n*2) {
cnt+=((m-2*n)/4)+n;
}else{
cnt+=m/2;
}
System.out.println(cnt);
}
} | Main.java:2: error: class C055 is public, should be declared in a file named C055.java
public class C055 {
^
1 error
|
s714729733 | p03797 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
long n=sc.nextLong(); //S
long m=sc.nextLong(); //C
int cnt=0;
if( m>=n*2) { //s:c=1:2なので
cnt+=n;
m=m-(cnt*2);
}
if(m>=4){ //cが4個でScc作れる
cnt+=m/4;
}
System.out.println(cnt);
} | Main.java:19: error: reached end of file while parsing
}
^
1 error
|
s699496958 | p03797 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
#define MOD (1000000007ll)
bool conccomp(int x, int y, int p, int q){
return (p*y>x*q);
}
int main(void){
int n,m,ans;
cin >> n >> m;
ans = min(n,m/2);
m -= 2*n;
ans += max(0ll,m/4);
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:19: error: no matching function for call to 'max(long long int, int)'
17 | ans += max(0ll,m/4);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:17:19: note: deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
17 | ans += max(0ll,m/4);
| ~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:17:19: note: mismatched types 'std::initializer_list<_Tp>' and 'long long int'
17 | ans += max(0ll,m/4);
| ~~~^~~~~~~~~
|
s194383045 | p03797 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
#define MOD (1000000007ll)
bool conccomp(int x, int y, int p, int q){
return (p*y>x*q);
}
int main(void){
ll n,m,ans;
cin >> n >> m;
ans = min(n,m/2);
m -= 2*n;
ans += max(0,m/4);
cout << ans << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:17:19: error: no matching function for call to 'max(int, ll)'
17 | ans += max(0,m/4);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:17:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
17 | ans += max(0,m/4);
| ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
5706 | max(initializer_list<_Tp> __l)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
5716 | max(initializer_list<_Tp> __l, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: template argument deduction/substitution failed:
a.cc:17:19: note: mismatched types 'std::initializer_list<_Tp>' and 'int'
17 | ans += max(0,m/4);
| ~~~^~~~~~~
|
s370807418 | p03797 | C++ | i | a.cc:1:1: error: 'i' does not name a type
1 | i
| ^
|
s030317826 | p03797 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main()
{
int m,n,ans;
cin>>m>>n;
ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
cout<<ans;
return 0;
} | a.cc: In function 'int main()':
a.cc:8:8: error: no matching function for call to 'min(int&, float)'
8 | ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
233 | min(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: template argument deduction/substitution failed:
a.cc:8:8: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'float')
8 | ans=min(n,(m-2*(m-ceil(float(2*n+m)/2)/2))/2);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
281 | min(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate expects 3 arguments, 2 provided
|
s905922069 | p03797 | C++ | #include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a>=b/2){
ans+=b/2;
cout<<ans;
system("pause");
return 0;
}
else
cout<<a+(b-2*a)/4;
system("pause");
return 0;
} | a.cc: In function 'int main()':
a.cc:18:1: error: 'ans' was not declared in this scope; did you mean 'abs'?
18 | ans+=b/2;
| ^~~
| abs
|
s489481069 | p03797 | C++ | #include<iostream>
#include<string.h>
#include<queue>
#include<map>
#include<vector>
#include <cstdlib>
#include<algorithm>
#include <cstdio>
#include <cctype>
using namespace std;
const long long INF=10000000000000LL;
typedef long long ll;
typedef pair<ll,ll> P;
ll N,M,K=1,C;
ll A,B,W;
ll T,a,b;
double v[55],D[55],Q,l,r;
ll ans=0;
//bool D[100005];
ll S[50][50]={};
string str1[55],str2="abcdefghijklmnopqrstuvwxyz";
map<string,int> m;
int main(){
cin>>N>>M;
if(N*2<=M){
ans+=S;
M-=N*2;
ans+=M/4;
}else{
ans+=M/4;
}
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:27:20: error: invalid conversion from 'll (*)[50]' {aka 'long long int (*)[50]'} to 'll' {aka 'long long int'} [-fpermissive]
27 | ans+=S;
| ~~~^~~
| |
| ll (*)[50] {aka long long int (*)[50]}
|
s766844083 | p03797 | C | #include <stdio.h>
int main(){
int n, m;
scanf("%d %d", &n, &m);
while(n => 0 && m => 0){
if(m/2 <= n){
printf("%d\n", m/2);
return 0;
}else{
n++;
m = m - 2;
}
}
printf("0\n");
return 0;
} | main.c: In function 'main':
main.c:8:14: error: expected expression before '>' token
8 | while(n => 0 && m => 0){
| ^
|
s272284102 | p03797 | C | #include <stdio.h>
int main(){
long int n, m;
scanf("%d %d", &n, &m);
while(n => 0 && m => 0){
if(m/2 <= n){
printf("%d\n", m/2);
return 0;
}else{
n++;
m = m - 2;
}
}
printf("0\n");
return 0;
} | main.c: In function 'main':
main.c:8:14: error: expected expression before '>' token
8 | while(n => 0 && m => 0){
| ^
|
s711165040 | p03797 | Java | import java.util.Scanner;
public class D {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
long x = scan.nextLong() * 2;
long y = scan.nextLong();
scan.close();
long ans = 0;
if (y > x) ans = x / 2 + (y - x) / 4;
else ans = x / 2;
System.out.println(ans);
return;
}
} | Main.java:2: error: class D is public, should be declared in a file named D.java
public class D {
^
1 error
|
s031063642 | p03797 | C++ | #include <iostream>
using namespace std;
using LL =long long;
int main() {
LL N, M;
cin >> N >> M;
int max_ = 0;
for (int i = 1; i <= M / 2; i++) {
max_ = max(max_, min(N + i, (M - i * 2) / 2));
}
cout << max_ << endl;
} | a.cc: In function 'int main()':
a.cc:14:19: error: no matching function for call to 'max(int&, const long long int&)'
14 | max_ = max(max_, min(N + i, (M - i * 2) / 2));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
a.cc:14:19: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
14 | max_ = max(max_, min(N + i, (M - i * 2) / 2));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate expects 3 arguments, 2 provided
|
s117949560 | p03797 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int N, M,ans;
cin >> N >> M;
if (M == 0){
ans = 0;
}
else{
M = (M - (M % 2)) / 2;
ans = ((N + M) - ((N + M) % 2)) / 2;
}
cout << ans << endl;
} | a.cc:4:1: error: extended character is not valid in an identifier
4 |
| ^
a.cc:4:1: error: '\U000000a0' does not name a type
4 |
| ^
|
s185203820 | p03797 | C++ | int main() {
long N, M;
long result;
if(N >= M / 2){
result = M / 2;
}else{
result = N + (M - N * 2) / 4;
}
std::cout << N + (M - N * 2) / 4;
return 0;
} | a.cc: In function 'int main()':
a.cc:10:8: error: 'cout' is not a member of 'std'
10 | std::cout << N + (M - N * 2) / 4;
| ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | int main() {
|
s203853198 | p03797 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,m;
cin>>n>>m;
cout << (n > m) ? m/2 : n + (m-2*n)/4 << endl;
} | a.cc: In function 'int main()':
a.cc:6:39: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
6 | cout << (n > m) ? m/2 : n + (m-2*n)/4 << endl;
| ~~~~~~~~~~~~~~^~~~~~~
|
s124626995 | p03797 | C++ | #include<iostream>
using namespace std;
int main(){
long long int n,m;
int p=0;
cin>>n>>m;
if(2*n <= m){
p = n;
p += (m-n)/4
}else{
p = m/2;
}
cout<<p+m<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before '}' token
11 | p += (m-n)/4
| ^
| ;
12 | }else{
| ~
|
s533557531 | p03797 | C++ | #include <iostream>
using namespace std;
int main(){
unsigned long long int a,b,c,d;
cin>>a>>b;
if(a*2>=b){
d=b/2
cout<<d;
}
else {
c = b-a*2;
d = a+c/4;
cout<<d;
}
} | a.cc: In function 'int main()':
a.cc:8:14: error: expected ';' before 'cout'
8 | d=b/2
| ^
| ;
9 | cout<<d;
| ~~~~
|
s719876561 | p03797 | C++ | #include <stdio.h>
#include <algorithm>
using namespace std;
int main(int argc, char *argv[])
{
long long n,m,s;
scanf("%lld %lld",&n,&m);
if(2*n<=m)
{
s=n;
m=m-2*n;
sum+=m/4;
printf("%lld\n",s);
}
else
{
printf("%lld\n",m/2);
}
return 0;
}
| a.cc: In function 'int main(int, char**)':
a.cc:12:17: error: 'sum' was not declared in this scope
12 | sum+=m/4;
| ^~~
|
s569957605 | p03797 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef long long ll
int main()
{
ll n,m;
while ( ~scanf("%lld %lld", &n, &m) ) {
if ( n > m/2 )
{
printf("%lld\n", m/2);
}
else{
ll cnt = n;
m = m - 2*n;
cnt = cnt + m/4;
printf("%lld\n", cnt);
}
}
return 0;
} | a.cc:8:1: error: expected initializer before 'int'
8 | int main()
| ^~~
|
s231288475 | p03797 | Java |
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner scanneer = new Scanner(System.in);
int N = scanneer.nextInt();
int M = scanneer.nextInt();
int t=M-2*N;
int s=t/4;
int sum = N+s;
System.out.println(sum);
}
}
| Main.java:4: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s121836527 | p03797 | Java | package main;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanneer = new Scanner(System.in);
int N = scanneer.nextInt();
int M = scanneer.nextInt();
int t=M-2*N;
int s=t/4;
int sum = N+s;
System.out.println(sum);
}
}
| Main.java:5: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s639645947 | p03797 | Java | package main;
import java.util.Scanner;
public class Test02 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanneer = new Scanner(System.in);
int N = scanneer.nextInt();
int M = scanneer.nextInt();
int t=M-2*N;
int s=t/4;
int sum = N+s;
System.out.println(sum);
}
}
| Main.java:5: error: class Test02 is public, should be declared in a file named Test02.java
public class Test02 {
^
1 error
|
s628381963 | p03797 | C | #include <stdio.h>
int main()
{
long long n,m,num;
while(scanf("%lld%lld",&n,&m)!=EOF)
{
num=0;
if(n>m/2)
{
printf("%lld\n",m/2);
}
else if(n==m/2)
printf("%lld",n);
else
{
num=n;
m=m-2*n;
num+=m/4;
printf("%lld\n",num);
}
return 0;
}
| main.c: In function 'main':
main.c:23:1: error: expected declaration or statement at end of input
23 | }
| ^
|
s760575139 | p03797 | C | #include <stdio.h>
int main()
{
long long n,m;
while(scanf("%lld%lld",&n,&m)!=EOF)
{
long long i,j;
i=m/4;
j=m%4;
if(n<=m/2)
printf("%lld\n",i);
else
{
if(j==0)
printf("%d",i);
else if(j/2<=n)
printf("%lld\n",i+j/2);
else
printf("%lld\n",i+n);
}
}
return 0; | main.c: In function 'main':
main.c:23:5: error: expected declaration or statement at end of input
23 | return 0;
| ^~~~~~
|
s919230488 | p03797 | C | #include<stdio.h>
int main()
{
__int64 n,m,total=0;
scanf("%I64d%I64d",&n,&m);
if(m>=2*n)
{
total+=n;
m-=2*n;
n=0;
}
else
{
total+=m/2;
m=m-total*2;
n-=total;
}
if(m==0)
{
printf("%I64d\n",total);
}
else
{
printf("%I64d\n",total+m/4);
}
return 0;
}
| main.c: In function 'main':
main.c:4:5: error: unknown type name '__int64'; did you mean '__int64_t'?
4 | __int64 n,m,total=0;
| ^~~~~~~
| __int64_t
|
s721056421 | p03797 | C | #include<stdio.h>
int main()
{
__int64 n,m,total=0;
scanf("%I64d%I64d",&n,&m);
if(m>=2*n)
{
total+=n;
m-=2*n;
n=0;
}
else
{
total+=m/2;
m=m-total*2;
n-=total;
}
if(m==0)
{
printf("%I64d\n",total);
}
else
{
printf("%I64d\n",total+m/4);
}
return 0;
}
| main.c: In function 'main':
main.c:4:5: error: unknown type name '__int64'; did you mean '__int64_t'?
4 | __int64 n,m,total=0;
| ^~~~~~~
| __int64_t
|
s794251649 | p03797 | C | #include <stdio.h>
long long n,m,count;
int main()
{
scanf("%I64d%I64d",&n,&m)
{
if(n<=m/2)
{
count=n;
m-=n*2;
count+=m/4;
}
else
count=m/2;
printf("%I64d",count);
}
return 0;
}
| main.c: In function 'main':
main.c:5:30: error: expected ';' before '{' token
5 | scanf("%I64d%I64d",&n,&m)
| ^
| ;
6 | {
| ~
|
s831729966 | p03797 | Java | import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class java{
static long mod=1000000007;
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
long n=in.nextLong(),m=in.nextLong();
long c=0;
c=Math.min(m/2,n);
m=m-c*2;
if (m>0){
c=c+m/4;
}
w.println(c);
w.close();
}
static class InputReader {
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;
public InputReader(InputStream stream) {
this.stream = stream;
}
public int snext() {
if (snumChars == -1)
throw new InputMismatchException();
if (curChar >= snumChars) {
curChar = 0;
try {
snumChars = stream.read(buf);
} catch (IOException e) {
throw new InputMismatchException();
}
if (snumChars <= 0)
return -1;
}
return buf[curChar++];
}
public int nextInt() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
int res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public long nextLong() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
int sgn = 1;
if (c == '-') {
sgn = -1;
c = snext();
}
long res = 0;
do {
if (c < '0' || c > '9')
throw new InputMismatchException();
res *= 10;
res += c - '0';
c = snext();
} while (!isSpaceChar(c));
return res * sgn;
}
public int[] nextIntArray(int n) {
int a[] = new int[n];
for (int i = 0; i < n; i++) {
a[i] = nextInt();
}
return a;
}
public String readString() {
int c = snext();
while (isSpaceChar(c)) {
c = snext();
}
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isSpaceChar(c));
return res.toString();
}
public String nextLine() {
int c = snext();
while (isSpaceChar(c))
c = snext();
StringBuilder res = new StringBuilder();
do {
res.appendCodePoint(c);
c = snext();
} while (!isEndOfLine(c));
return res.toString();
}
public boolean isSpaceChar(int c) {
if (filter != null)
return filter.isSpaceChar(c);
return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
private boolean isEndOfLine(int c) {
return c == '\n' || c == '\r' || c == -1;
}
public interface SpaceCharFilter {
public boolean isSpaceChar(int ch);
}
}
}
| Main.java:4: error: class java is public, should be declared in a file named java.java
public class java{
^
1 error
|
s399580600 | p03797 | C++ | int main() {
ll s, c, ans = 0;
cin >> s >> c;
if (s * 2 <= c) {
ans = s + ((c - s * 2) / 4);
} else {
ans = c / 2;
}
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:5: error: 'll' was not declared in this scope
2 | ll s, c, ans = 0;
| ^~
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin >> s >> c;
| ^~~
a.cc:3:12: error: 's' was not declared in this scope
3 | cin >> s >> c;
| ^
a.cc:3:17: error: 'c' was not declared in this scope
3 | cin >> s >> c;
| ^
a.cc:6:9: error: 'ans' was not declared in this scope
6 | ans = s + ((c - s * 2) / 4);
| ^~~
a.cc:8:9: error: 'ans' was not declared in this scope
8 | ans = c / 2;
| ^~~
a.cc:11:5: error: 'cout' was not declared in this scope
11 | cout << ans << endl;
| ^~~~
a.cc:11:13: error: 'ans' was not declared in this scope
11 | cout << ans << endl;
| ^~~
a.cc:11:20: error: 'endl' was not declared in this scope
11 | cout << ans << endl;
| ^~~~
|
s352034997 | p03797 | Java | package spring21;
public class ABC055_C {
public static void main(String[] args){
int N=1,M=6,sum=0;
for(;;){
if(N>=1&&M>=2){
N--;
M-=2;
sum++;
}
else if(N==0&&M>=4){
sum++;
M-=4;
}
else{
break;
}
}
System.out.println(sum);
}
} | Main.java:3: error: class ABC055_C is public, should be declared in a file named ABC055_C.java
public class ABC055_C {
^
1 error
|
s812847779 | p03797 | C | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#define print printf("%ld", answer)
int main(void){
longlong N, M, answer, k, l;
scanf("%ld", &N);
scanf("%ld", &M);
if(N>=0&&M<=1000000000000)
{
if(M%2==0)
{
k = M/2;
if(N>=k)
{
answer = k;
}
if(N==k-1)
{
answer = N;
}
if(N<=k-2)
{
if(k%2==0)
{
l = k/2;
answer = N + l;
}
if(k%2==1)
{
l = (k-1)/2;
answer = N + l;
}
}
}
if(M%2==1)
{
k = (M+1)/2;
if(N>=k-1)
{
answer=k-1;
}
if(N==k-2)
{
answer = N;
}
else
{
if((k-1-N)%2==0)
{
l = (k-1-N)/2;
answer = N + l;
}
else
{
l = (k-2-N)/2;
answer = N + l;
}
}
}
print;
}
return 0;
}
| main.c: In function 'main':
main.c:7:3: error: unknown type name 'longlong'
7 | longlong N, M, answer, k, l;
| ^~~~~~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.