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... | 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 +=... | 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\U000051... |
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,
... |
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 '... |
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,
fr... |
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,
fro... |
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,
fro... |
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/... |
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);
... | 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... |
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,... |
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: ex... |
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: ex... |
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 ... |
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... |
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 ... |
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 ... |
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; ///< Link... |
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/includ... |
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... | 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 ... | 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,
... |
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... |
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... | 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_cla... |
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 al... | 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>
#... | 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;
| ~~~~~~~~~~~~~~^~~... |
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.prin... |
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();
retur... | 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;
}
... | 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/ios... |
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;
| ... |
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(cn... | 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作れる
... | 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 << e... | 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,
... |
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... | 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,
fr... |
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_cla... |
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");
r... | 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... | 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 /u... |
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;
c... | 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;
nu... | 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)
... | 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
{
... | 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
{
... | 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=M... | 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;
| ... |
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)
{
... | 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.