submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s775825830 | p03838 | C++ | #include <iostream>
#include <set>
#include <queue>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long i64;
i64 x,y;
i64 dif;
int main()
{
cin >> x >> y;
dif = abs(x - y);
typedef pair<i64,i64> P;
priority_queue<P> que;
que.push({0,x});
while(!que.empty())
{
i64 v= que.front()... | a.cc: In function 'int main()':
a.cc:26:28: error: 'class std::priority_queue<std::pair<long long int, long long int> >' has no member named 'front'
26 | i64 v= que.front().first;
| ^~~~~
a.cc:27:29: error: 'class std::priority_queue<std::pair<long long int, long long... |
s862234517 | p03838 | C++ | #include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
using namespace std;
typedef long long ll;
typedef pair<int,int> P1;
typedef pair<int,P1> P2;
const ll inf=100000000000000;
struct edge{
int t... | a.cc:29:4: error: conflicting declaration 'll x [200001]'
29 | ll x[200001]={};
| ^
a.cc:27:5: note: previous declaration as 'int x [200002]'
27 | int x[MAX_N]={};
| ^
|
s207949851 | p03838 | Java | x,y = gets.split.map &:to_i
add = 0
if y<0
add = 1
y = -y
end
p [y-x, y+x+1].min + add | Main.java:1: error: class, interface, enum, or record expected
x,y = gets.split.map &:to_i
^
1 error
|
s962910846 | p03838 | C++ | #include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#define MOD 1000000007LL
using namespace std;
int main(){
int x, y;
cin >> x >> y;
if(x > 0){
if(y <= ((-1) * x)) cout << 1 - x - y << endl;
else if(y < x) cout << 1 + x + y << endl;
el... | a.cc:29:9: error: expected unqualified-id before 'return'
29 | return 0;
| ^~~~~~
a.cc:30:1: error: expected declaration before '}' token
30 | }
| ^
|
s716246247 | p03838 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = INT_MAX - 10;
const ... | a.cc:18:17: error: 'INT_MAX' was not declared in this scope
18 | const int INF = INT_MAX - 10;
| ^~~~~~~
a.cc:13:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
12 | #include <cmath>
+++ |+#include <climits>
13 | using namespa... |
s295070120 | p03838 | C++ |
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat... | a.cc:31:23: error: '::main' must return 'int'
31 | #define int long long int
| ^~~
a.cc:36:1: note: in expansion of macro 'int'
36 | int main() {
| ^~~
|
s247193372 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int x , y;
int main()
{
cin >> x >> y;
if(x >= 0 && x <= y)
{
cout << y - x;
return 0;
}
int diff = abs(abs(x) - abs(y));
int ans = diff;
if(x >= 0 && y >= 0 && y < x)
{
cout << ans + 1 + (y > 0);
return 0;
... | a.cc:45:5: error: redefinition of 'int x'
45 | int x , y;
| ^
a.cc:4:5: note: 'int x' previously declared here
4 | int x , y;
| ^
a.cc:45:9: error: redefinition of 'int y'
45 | int x , y;
| ^
a.cc:4:9: note: 'int y' previously declared here
4 | int x , y;
| ... |
s134326497 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, n) for(int i = 0; i < (n); i++)
#define MEM(a, x) memset(a, x, sizeof(a))
#define ALL(a) a.begin(), a.end()
#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())
typedef long long ll;
int x, y;
int main(int argc, char const *argv[]) {
ios_base::sync_with_stdi... | a.cc: In function 'int main(int, const char**)':
a.cc:30:45: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
30 | else cout << -y+x+2 < endl;
| ~~~~~~~~~~~~~~~^~~~~~
In file included ... |
s631840989 | p03838 | C++ | #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
typedef long long ll;
ll abs(ll a){
if(a>=0)return a;
else return -1*a;
}
int main(){
ll x,y;
ll ans=0;
cin>>x>>y;
if(x>=0 && y>=0){
if(x>y){
ans+=2;
ans+=x-y;
}else{
ans+=y-x;
}
}else i... | a.cc: In function 'int main()':
a.cc:24:23: error: call of overloaded 'abs(ll&)' is ambiguous
24 | if(abs(x)>abs(y)){
| ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
from /u... |
s657349076 | p03838 | Java | public class Example05 {
public static void main(String[] args) {
// 画面の初期値
int x = Integer.parseInt(args[0]);
// 目標の画面の値
int y = Integer.parseInt(args[1]);
// ボタン最小押下回数
long count = 1;
// [x]と[y]の絶対値が同一の場合は何もしない
if (Math.abs(x) != Math.abs(y)) {
// 変数x,yがどちらも0以上
if (x >= 0 && y >= 0) {
... | Main.java:1: error: class Example05 is public, should be declared in a file named Example05.java
public class Example05 {
^
1 error
|
s014014486 | p03838 | Java | public static void main(String[] args) throws Exception {
// Here your code !
BufferedReader br = new BufferedReader(new
InputStreamReader(System.in));
String[] lineArray = br.readLine().split(" ", 0);
long x = Integer.parseInt(lineArray[0]);
long y = Integer.parseInt(lineArr... | Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) throws Exception {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s738638396 | p03838 | C | #include<iostream>
#include<string>
using namespace std;
int main()
{
long x, y, kaisu;
cin >> x;
cin >> y;
kaisu = 0;
if ((x >= 0 && y >= 0 ) || ((x < 0) && (y < 0))){
if(y > x){
kaisu = y - x;
} else {
if (y == 0){
kaisu = x - y + 1;
} else {
... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s649027572 | p03838 | Java | import java.util.*;
import java.io.*;
public class gg {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer stk = new StringTokenizer(br.readLine());
long x = Long.parseLong(stk.nextToken());
long y = Long.parseL... | Main.java:3: error: class gg is public, should be declared in a file named gg.java
public class gg {
^
1 error
|
s140402977 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for(int i = (s); i <= (f); ++i)
#define for1(i, f, s) for(int i = (f); i >= (s); --i)
#define fora(i, x) for (auto i : x)
#define show(x) cout << #x << " = " << x << " ";
#define skip continue;
#define pb push_back
#define _1 first
#define _2 second
... | a.cc:29:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
29 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:41:40: error: expected ';' before '}' token
41 | cout << (a > 0 ? ans + 1 : ans)
| ^
| ... |
s840358476 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for(int i = (s); i <= (f); ++i)
#define for1(i, f, s) for(int i = (f); i >= (s); --i)
#define fora(i, x) for (auto i : x)
#define show(x) cout << #x << " = " << x << " ";
#define skip continue;
#define pb push_back
#define _1 first
#define _2 second
... | a.cc:29:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
29 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:36:5: error: 'else' without a previous 'if'
36 | else if (a > 0 && b > 0 && a < b)
| ^~~~
|
s989664495 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define forn(i, s, f) for(int i = (s); i <= (f); ++i)
#define for1(i, f, s) for(int i = (f); i >= (s); --i)
#define fora(i, x) for (auto i : x)
#define show(x) cout << #x << " = " << x << " ";
#define skip continue;
#define pb push_back
#define _1 first
#define _2 second
... | a.cc:29:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
29 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:37:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
37 | ans = abs(abs(a) - abs(b));
| ^~~
| abs
|
s107606518 | p03838 | C | long long x,y;
scanf("%lld %lld",&x,&y);
int kaisu;
if(x<y){
if(x*y>=0)kaisu=y-x;
if(x*y<0){
if(x*-1<y)kaisu=y-x*-1+1
if(x*-1==y)kaisu=1;
if(x*-1>y)kaisu=x*-1-y+1;
}
}
if(x>y){
if(x*y>0){
if(y>0)kaisu=x-y+2;
if(y<0)kaisu=y*-1+x+2;
}
if(x*y<0){
if(x<y*-1)kaisu=y*-1-x+1;
if(x==y*... | main.c:2:15: error: expected declaration specifiers or '...' before string constant
2 | scanf("%lld %lld",&x,&y);
| ^~~~~~~~~~~
main.c:2:27: error: expected declaration specifiers or '...' before '&' token
2 | scanf("%lld %lld",&x,&y);
| ^
main... |
s858075177 | p03838 | C++ | x, y = map(int, raw_input().split())
if x == y:
print 0
elif x == -y:
print 1
else:
if abs(y) > abs(x):
print (x < 0) + (y < 0) + abs(y) - abs(x)
else:
print (x > 0) + (y > 0) + abs(x) - abs(y)
| a.cc:1:1: error: 'x' does not name a type
1 | x, y = map(int, raw_input().split())
| ^
|
s145984826 | p03838 | C++ | #include <stdio.h>
#include <iostream>
#include <cmath>
#define int long long
using namespace std;
const int N=123456;
int abs(int a) {
return a>=0?a:-a;
}
signed main() {
int x,y;
scanf("%lld %lld",&x,&y);
if(x>=0 && y>=0) {
if(x<=y) {
printf("%lld\n",y-x);
} else {
printf("%lld\n",min(y-x+2,y+x+... | a.cc: In function 'int main()':
a.cc:25:23: error: call of overloaded 'abs(long long int&)' is ambiguous
25 | if(abs(x)<=abs(y)) {
| ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
... |
s838613650 | p03838 | C++ | #include <stdio.h>
#include <iostream>
#include <cmath>
#define int long long
using namespace std;
const int N=123456;
int abs(int a) {
return a>=0?a:-a;
}
signed main() {
int x,y;
scanf("%lld %lld",&x,&y);
if(x>=0 && y>=0) {
if(x<=y) {
printf("%lld\n",y-x);
} else {
printf("%lld\n",min(y-x+2,y+x+... | a.cc: In function 'int main()':
a.cc:25:23: error: call of overloaded 'abs(long long int&)' is ambiguous
25 | if(abs(x)<=abs(y)) {
| ~~~^~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversions.h:43,
... |
s894969149 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int main(){
int x,y,n;
cin>>x>>y>>n;
if (y >= x) {
if (x >= 0) { //1,2
n = y-x; //B*0
} else {
if (y >= 0) {
if (y >= -x) { //-1,5
n = y+x+1; /... | a.cc: In function 'int main()':
a.cc:44:2: error: expected '}' at end of input
44 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s411988712 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int main(){
int x,y,n;
cin>>x>>y>>n;
if (y >= x) {
if (x >= 0) { //1,2
n = y-x; //B*0
} else {
if (y >= 0) {
if (y >= -x) { //-1,5
n = y+x+1; //... | a.cc:21:9: error: extended character is not valid in an identifier
21 | } else {
| ^
a.cc: In function 'int main()':
a.cc:21:9: error: 'else\U00003000' was not declared in this scope
21 | } else {
| ^~~~~~
|
s924496933 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int main(){
int x,y,n;
cin>>x>>y>>n;
if (y >= x) {
if (x >= 0) { //1,2
n = y-x; //B*0
} else {
if (y >= 0) {
if (y >= -x) { //-1,5
n = y+x+1 //B... | a.cc:21:9: error: extended character is not valid in an identifier
21 | } else {
| ^
a.cc: In function 'int main()':
a.cc:17:20: error: expected ';' before '}' token
17 | n = y+x+1 //B+A...
| ^
| ;
18 | } else { //-6, 5
... |
s652312246 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9
int main(){
int x,y,n;
cin>>x>>y>>n;
if (y >= x) {
if (x >= 0) {
n = y-x; //B*0
} else {
if (y >= -x) {
n = y+x+1; //B*1
} else {
n = y-x; /... | a.cc: In function 'int main()':
a.cc:23:16: error: expected ';' before '}' token
23 | n = x-y+2 //B+A+...+A+B
| ^
| ;
24 | } else {
| ~
|
s735209609 | p03838 | C++ | #include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cst... | a.cc: In function 'int main()':
a.cc:51:6: error: conflicting declaration 'll a'
51 | ll a, b;
| ^
a.cc:49:7: note: previous declaration as 'int a'
49 | int a, b;
| ^
a.cc:51:9: error: conflicting declaration 'll b'
51 | ll a, b;
| ^
a.cc:49:10: note: previous declara... |
s727891076 | p03838 | C | #include <stdio.h>
#include <math.h>
int main(void)
{
int x,y,i=0;
scanf("%d",&x);
scanf("%d",&y);
if((x=>0&&y<0)||(x<0&&y=>0)){
i=1;
}else if(x<0&&y<0){
i=2;
}
int value;
x=abs(x);
y=abs(y);
if(x==y){
printf("%d\n",i);
}else if(x>y){
value=x-y;
printf("%d\n",value+i);
}else{... | main.c: In function 'main':
main.c:8:9: error: expected expression before '>' token
8 | if((x=>0&&y<0)||(x<0&&y=>0)){
| ^
main.c:8:27: error: expected expression before '>' token
8 | if((x=>0&&y<0)||(x<0&&y=>0)){
| ^
main.c:14:5: error: implicit declaration of f... |
s545890796 | p03838 | C++ | #include<bits/stdc++.h>
using namespace std;
int main()
{
int X,Y;
cin>>X>>Y;
if(X==Y)
{
cout<<"0";
return 0;
}
if(X==0)
{
if(Y<0)
cout<<-Y+1;
else cout<<Y;
return 0;
}
if(Y==0)
{
if(x<0)
cout<<abs(x);
else cout<<x+1;
return 0;
}
if((X<0 && Y<0) || (X>0 && Y>0) )
{
if(X>Y)... | a.cc: In function 'int main()':
a.cc:25:20: error: 'x' was not declared in this scope
25 | if(x<0)
| ^
|
s753802957 | p03838 | C++ | asd | a.cc:1:2: error: 'asd' does not name a type
1 | asd
| ^~~
|
s438322517 | p03838 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s203101400 | p03838 | C++ | #include <iostream>
using namespace std;
long long solve(long long x, long long y){
if(a <= b) return b - a;
return 1e15;
}
int main(){
long long x, y;
cin >> x >> y;
long long ans = 1e15;
ans = min(ans, solve(x, y));
ans = min(ans, solve(-x, y) + 1);
ans = min(ans, solve(x, -y) + 1);
ans = min(ans, solve(-x... | a.cc: In function 'long long int solve(long long int, long long int)':
a.cc:5:12: error: 'a' was not declared in this scope
5 | if(a <= b) return b - a;
| ^
a.cc:5:17: error: 'b' was not declared in this scope
5 | if(a <= b) return b - a;
| ^
|
s065416219 | p03838 | Java | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.NoSuchElementException;
public class A {
public static void main(String[] args) {
FS r = new FS();
long x = r.nextLong();
long y = r.nextLong();
long tmpx = x;
long tmpy = y;
long minCount = 1000000500;
... | Main.java:6: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s724687185 | p03838 | Java | import java.util.Scanner;
class Main{
public static void main(String args[]){
Scanner inp=new Scanner(System.in);
int x=inp.nextInt();
int y=inp.nextInt();
int c=0;
y-x=c;
System.out.println(c);
}
} | Main.java:9: error: unexpected type
y-x=c;
^
required: variable
found: value
1 error
|
s386067320 | p03838 | C++ | #include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a)... | a.cc: In function 'int main()':
a.cc:32:34: error: expected ';' before '}' token
32 | ret = min(ret, y+x+1)
| ^
| ;
33 | }
| ~
|
s935514684 | p03838 | Java | import java.util.Scanner;
public class renshu{
public static void main(String[] args){
Scanner kbs=new Scanner(System.in);
int x=kbs.nextInt();
int y=kbs.nextInt();
int a=0,b=0;
if(y<0&&x>0){
y*=-1;
a++;
}else if(y>0&&x<0){
x*=-1;
a++;
}
else if(y<0&&x<0){
a+=2;
x*=-1;
y*=-1;
}
b=x-y;... | Main.java:2: error: class renshu is public, should be declared in a file named renshu.java
public class renshu{
^
1 error
|
s113910338 | p03838 | C++ | #include <iostream>
using namespace std;
int main()
{
int32_t x, y;
cin >> x >> y;
int32_t d{ y - x };
if( d < 0) {
cout << 2 - d << end;
}
else {
cout << d << endl;
}
}
| a.cc: In function 'int main()':
a.cc:12:23: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
12 | cout << 2 - d << end;
| ~~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/iostream:41,
from ... |
s196965830 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),_b=(b);i<(_b);++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>(_b);--i)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define present(c,x) ((c).find(x) != ... | a.cc:44:11: error: expected unqualified-id before 'else'
44 | } else { // x > y
| ^~~~
a.cc:56:9: error: expected unqualified-id before 'return'
56 | return 0;
| ^~~~~~
a.cc:57:5: error: expected declaration before '}' token
57 | }
| ^
|
s563554336 | p03838 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
long long x,y;
cin>>x>>y;
if(x==y)
{
cout<<0<<endl;
return 0;
}
if(abs(x)==abs(y))
{
cout<<1<<endl;
return 0;
}
if((x==0)||(y==0))
{
if(x>0)
{
cout<<x<<endl;
return 0;
}
if(x<0)... | a.cc: In function 'int main()':
a.cc:27:21: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>')
27 | cout<<abs(x)+1<endl;
| ~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/... |
s845704544 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int64_t;
int main() {
int64_t x, y;
cin >> x >> y;
vector<int64_t> p = { x, y, -x, -y };
int64_t g[4][4];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
g[i][j] = 1e15;
if (i == j) {
g[i][j] = 0;
}
if (p[i] == -p[j])... | a.cc:4:19: error: conflicting declaration 'typedef long long int int64_t'
4 | typedef long long int64_t;
| ^~~~~~~
In file included from /usr/include/x86_64-linux-gnu/sys/types.h:155,
from /usr/include/stdlib.h:514,
from /usr/include/c++/14/cstdlib:79,
... |
s274022707 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int64_t x, y;
cin >> x >> y;
vector<int64_t> p = { x, y, -x, -y };
int64_t g[4][4];
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
g[i][j] = 1e9;
if (i == j) {
g[i][j] = 0;
}
if (p[i] == -p[j]) {
g[i][j] = min(g[i][j],... | a.cc: In function 'int main()':
a.cc:18:46: error: no matching function for call to 'min(int64_t&, long long int)'
18 | g[i][j] = min(g[i][j], 1LL);
| ~~~^~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s740523123 | p03838 | C++ | import java.util.*;
class Main {
public static void main(String args[]) {
try (Scanner sc = new Scanner(System.in)) {
int A = sc.nextInt(), B = sc.nextInt();
if (B > A) {
System.out.println(Math.min(B - A, B + A + ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:15: error: expected ':' before 'static'
4 | public static void main(String args[]) {
| ^~~~~~~
| :
a.cc:4... |
s772732292 | p03838 | C++ | #include <iostream>
#include <vector>
#include <cstdio>
#include <algorithm>
#include <cassert>
#include <utility>
#include <string>
#include <cmath>
#include <set>
#include <functional>
#include <map>
#include <queue>
#include <stack>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; ++i)
... | a.cc: In function 'int main()':
a.cc:23:14: error: 'LONG_LONG_MAX' was not declared in this scope
23 | ll ans = LONG_LONG_MAX;
| ^~~~~~~~~~~~~
|
s053825120 | p03838 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;
int N,K;
int A[SIZE];
int main(){
REP(i,7){
cin >> A[i];
}
int ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
if((A[0] && A[3] && A[4] )){
ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3)... | a.cc:6:7: error: 'SIZE' was not declared in this scope
6 | int A[SIZE];
| ^~~~
a.cc: In function 'int main()':
a.cc:9:24: error: 'A' was not declared in this scope
9 | cin >> A[i];
| ^
a.cc:11:17: error: 'A' was not declared in this scope
11 | ... |
s340996477 | p03838 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;
LL N,K;
LL A[SIZE];
int main(){
REP(i,7){
cin >> A[i];
}
LL ans=A[1]+A[0]/2*2+A[3]/2*2+A[4]/2*2;
if((A[0] && A[3] && A[4] )){
ans=max(ans,A[1]+(A[0]-1)/2*2+(A[3]-1)/2*2+(A[4]-1)/2*2+3);
... | a.cc:5:1: error: 'LL' does not name a type
5 | LL N,K;
| ^~
a.cc:6:1: error: 'LL' does not name a type
6 | LL A[SIZE];
| ^~
a.cc: In function 'int main()':
a.cc:9:24: error: 'A' was not declared in this scope
9 | cin >> A[i];
| ^
a.cc:11:9: error: 'LL... |
s058597065 | p03838 | C++ | #include <iostream>
#include <cmath>
#include <algorithm>
long long y;
long long dfs(long long n, bool is_prev_reversed) {
int ans = 1e9;
if(n == y) {
return 0;
}
if(y >= n) {
ans = std::min(ans, y - n);
}
if(-y >= n) {
ans = std::min(ans, -y - n + 1);
}
if(!is... | a.cc: In function 'long long int dfs(long long int, bool)':
a.cc:14:23: error: no matching function for call to 'min(int&, long long int)'
14 | ans = std::min(ans, y - n);
| ~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14... |
s608739188 | p03838 | C++ | #include <iosteram>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
if(x<=y)
cout<<y-x<<endl;
else if(x==-y)
cout<<1<<endl;
else
cout<<2+x-y<<endl;
return 0;
} | a.cc:1:10: fatal error: iosteram: No such file or directory
1 | #include <iosteram>
| ^~~~~~~~~~
compilation terminated.
|
s844100209 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int main()
{
ll x,y;
while(cin>>x>>y)
{
ans=(ll)1e18;
//x<=y才能用op:A
if(x<=y)
ans=min(ans,y-x);
if(-x<=y)
ans=min(ans,1+y-(-x));//先变号BA
if(x<=-y)
ans=min(ans,1+(-y-x));//加完后变号AB
if(-x<=-y)
ans=min(ans,1+1+(-y... | a.cc: In function 'int main()':
a.cc:10:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
10 | ans=(ll)1e18;
| ^~~
| abs
|
s584216969 | p03838 | C++ | #include <iostream>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
if(x == y * (-1)){
cout << 1 << endl;
return 0;
}
if(x >= 0 && y >= 0){
if(x < y){
cout << y - x << endl;
} else {
cout << x - y + 2 << endl;
}
}
else if(x < 0 && y < 0){
if(x < y)... | a.cc: In function 'int main()':
a.cc:41:37: error: 'enld' was not declared in this scope
41 | cout << (x + y) * (-1) + 1 << enld;
| ^~~~
|
s352640623 | p03838 | Java | import java.util.Scanner;
public class agc008_a {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long x = sc.nextLong();
long y = sc.nextLong();
sc.close();
long ax = Math.abs(x);
long ay = Math.abs(y);
long clickCnt = 0;
... | Main.java:3: error: class agc008_a is public, should be declared in a file named agc008_a.java
public class agc008_a {
^
1 error
|
s545856295 | p03838 | Java | import java.util.Scanner;
public class {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long x = sc.nextLong();
long y = sc.nextLong();
sc.close();
long ax = Math.abs(x);
long ay = Math.abs(y);
long clickCnt;
if (x >= 0 ... | Main.java:3: error: <identifier> expected
public class {
^
1 error
|
s612486104 | p03838 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <i... | a.cc: In function 'int main()':
a.cc:39:29: error: expected ';' before ':' token
39 | cout << abs(a+b)+1 <<endl:
| ^
| ;
|
s461756067 | p03838 | C++ | #include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
ll a,b,c,d;
while(cin>>a>>b)
{
c=0;
if(a<0&&b<0)
{
a=a*(-1);
b=b*(-1);
if(a<b)c=abs(a-b)+2;
else
c=abs(a-b);
}
else if(a... | a.cc: In function 'int main()':
a.cc:23:12: error: expected '}' before 'else'
23 | else if(a<b)
| ^~~~
a.cc:20:9: note: to match this '{'
20 | {
| ^
a.cc:27:9: error: 'else' without a previous 'if'
27 | else if(a>=0&&b<0)
| ^~~~
a.cc: At g... |
s680121028 | p03838 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <i... | a.cc: In function 'int main()':
a.cc:38:29: error: expected ';' before ':' token
38 | cout << abs(a+b)+1 <<endl:
| ^
| ;
|
s128868024 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int x,y,cnt;
cin>>x>>y;
if(y>x){
if(x*y>=0){
cnt=y-x;
}
else if(x<0&&y>0){
cnt=1+x+y;
}
}
if(x>y){
if(x*y>0){
cnt=2+x-y;
}
else if(x==0){
cnt=-y+1;
}
else if(y==0){
cnt=x+1;
}
... | a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before '}' token
25 | cnt=1+x+y
| ^
| ;
26 | }
| ~
a.cc:28:10: error: expected ';' before '}' token
28 | cout<<cnt
| ^
| ;
29 | }
| ~ ... |
s529510669 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int x,y,cnt;
cin>>x>>y;
if(y>x){
if(x*y>=0){
cnt=y-x;
}
else if(x<0&&y>0){
cnt=1+x+y;
}
}
if(x>y){
if(x*y>0){
cnt=2+x-y;
}
else if(x==0){
cnt=-y+1;
}
else if(y==0){
cnt=x+1;
}
... | a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' before '}' token
25 | cnt=1+x+y
| ^
| ;
26 | }
| ~
|
s027956074 | p03838 | C++ |
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
int main() {
int a, b;
cin >> a >> b;
long long x = 1LL << 55;
x *= 2;
long long y = 1LL << 55;
y *= 2;
if(b >= a) x = b - a;
else if(b < a && b < 0 && -b >= a) x = min(x , -b - a + 1);
a *=... | a.cc: In function 'int main()':
a.cc:18:51: error: no matching function for call to 'min(long long int&, int)'
18 | else if(b < a && b < 0 && -b >= a) x = min(x , -b - a + 1);
| ~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s527637747 | p03838 | C++ | #include<bits/stdc++.h>
using namepsace std;
int main(){
int a,b;
cin>>a>>b;
int ans = 0;
if(a<0&&b>0||a>0&&b<0)
ans++;
if(a>b&&a<0&&b<0)
ans+=2;
a=abs(a);
b=abs(b);
ans+=abs(a-b);
}
| a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
2 | using namepsace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b;
| ^~~
| std::cin
In file included from /usr/i... |
s115272180 | p03838 | C++ | #include<bits/stdc++.h>
using namepsace std;
int main(){
int a,b;
cin>>a>>b;
int ans = 0;
if(a<0&&b>0||a>0&&b<0)
ans++;
if(a>b&&a<0&&b<0);
ans+=2;
a=abs(a);
b=abs(b);
ans+=abs(a-b);
}
| a.cc:2:7: error: expected nested-name-specifier before 'namepsace'
2 | using namepsace std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b;
| ^~~
| std::cin
In file included from /usr/i... |
s710916675 | p03838 | C++ | #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int main() {
int a, b, ans = 0;
cin >> a >> b;
if((a >= 0 && b < 0) || (a < 0 && b >= 0)) {
if(b != 0)) {
ans++;
}
}else {
if(a > b) ans += 2;
}
if(a < 0) a = -a;
if(b < 0) b = -b;
ans += max(a, b) - min(a, b);
... | a.cc: In function 'int main()':
a.cc:10:15: error: expected primary-expression before ')' token
10 | if(b != 0)) {
| ^
|
s074116528 | p03838 | Java | import java.util.Scanner;
2.public class Main {
3.
4. public static void main(String[] args) {
5. // TODO 自動生成されたメソッド・スタブ
6. Scanner stdIn = new Scanner(System.in);
7. int x = stdIn.nextInt();
8. int y = stdIn.nextInt();
9. if (x == y)
10. System.out.println(0);
11. if (x < y) {
12. if (x >= 0 || y <= 0)
13.... | Main.java:2: error: class, interface, enum, or record expected
2.public class Main {
^
Main.java:3: error: illegal start of type
3.
^
Main.java:5: error: not a statement
5. // TODO ???????????????
^
Main.java:5: error: ';' expected
5. // TODO ???????????????
^
Main.java:7: error: not a statement
7. int x = stdIn.... |
s130442324 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
void test1(){
int x,y;
cin>>x>>y;
if(abs(x)==abs(y)&&a/b==-1){
cout<<-1<<endl;
return;
}
if(x<=y){
if(x<0&&y>=0) cout<<abs(abs(y)-(abs(x)))+1<<endl;
else cout<<y-x<<endl;
return;
}else{
if(abs(x)>abs(y... | a.cc: In function 'void test1()':
a.cc:7:24: error: 'a' was not declared in this scope
7 | if(abs(x)==abs(y)&&a/b==-1){
| ^
a.cc:7:26: error: 'b' was not declared in this scope
7 | if(abs(x)==abs(y)&&a/b==-1){
| ^
|
s167604301 | p03838 | C | #include <stdio.h>
int main(void) {
int x, y;
int button = 0;
scanf("%d %d", &x, &y);
if (y == x*-1) button = 1;
if (x < y){
if (x > 0) button = y - x;
else button = y - x*-1 + 1;
else {
if ((x > 0 && y > 0) || (x < 0 && y < 0)) button = x - y + 2;
else if (x == 0) button = y*-1 + 1;
else if (y =... | main.c: In function 'main':
main.c:14:9: error: expected '}' before 'else'
14 | else {
| ^~~~
|
s933390124 | p03838 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
long long int x, y;
long long int anscnt;
int main(){
scanf("%lld %lld", &x, &y);
if (y < x){
if (y > 0){
anscnt = (x - y) + 2;
}
else if (x < 0){
anscnt = (x - y) + 2;
}
else{
if (x > (y * -1)){
anscnt = (y - x * -1) + 1;
}
e... | a.cc: In function 'int main()':
a.cc:46:34: error: expected '}' at end of input
46 | printf("%lld\n", anscnt);
| ^
a.cc:9:11: note: to match this '{'
9 | int main(){
| ^
|
s584106349 | p03838 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
long long int x, y;
long long int anscnt;
int main(){
scanf("%lld %lld", &x, &y);
if (y < x){
if (y > 0){
anscnt = (x - y) + 2;
}
else if (x < 0){
anscnt = (x - y) + 2;
}
else{
if (x > (y * -1)){
anscnt = (y - x * -1) + 1;
}
e... | a.cc: In function 'int main()':
a.cc:34:29: error: expected primary-expression before '<' token
34 | else if (y =< 0){
| ^
|
s811481198 | p03838 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <uno... | a.cc: In function 'int main()':
a.cc:73:28: error: expected primary-expression before ')' token
73 | ans = min(ans, )
| ^
|
s944786204 | p03838 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int x = scn.nextInt();
int y = scn.nextInt();
int cnt = 0;
if(Math.abs(x) > Math.abs(y) && x > 0 && y >= 0) {
x = -x;
cnt++;
} else if(Math.abs(x) > Math.abs(y) && x > 0 && ... | Main.java:29: error: ')' expected
if(x == -y && (x > 0 || x < 0) cnt++;
^
1 error
|
s652897541 | p03838 | C++ | int main(){
int x, y;
cin >> x >> y;
if ((x >= 0) && (y >= x)){
cout << (y-x);
}else if ((x >= 0) && (y < x)){
if (y >= 0){
cout << (y-(-x)+1);
}else if (y >= (-x)){
cout << (y-(-x)+1);
}else{
cout << (-y-x+1);
}
}else if ((x < 0) && (y >= x)){
if (y <= 0){
cout... | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> x >> y;
| ^~~
a.cc:5:5: error: 'cout' was not declared in this scope
5 | cout << (y-x);
| ^~~~
a.cc:8:7: error: 'cout' was not declared in this scope
8 | cout << (y-(-x)+1);
|... |
s137629346 | p03838 | Java | import java.io.*;
import java.util.StringTokenizer;
public class TaskA {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStrea... | Main.java:4: error: class TaskA is public, should be declared in a file named TaskA.java
public class TaskA {
^
1 error
|
s767018647 | p03838 | C++ | #include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define rep(i,n) for(ll i=0;i<(n);i++)
using namespace std;
int main(){
ll x, y;
cin >> x >> y;
if(x < y){
cout << y-x << endl;
}
else if(x > y){
else if(0 < x && y < 0){
cout << ... | a.cc: In function 'int main()':
a.cc:19:9: error: expected '}' before 'else'
19 | else if(0 < x && y < 0){
| ^~~~
a.cc:18:19: note: to match this '{'
18 | else if(x > y){
| ^
a.cc: At global scope:
a.cc:28:5: error: expected unqualified-id before 'return'
28 | ... |
s423873746 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ios ios_base::sync_with_stdio(false);cin.tie(0);
#define setnow clock_t tStart=clock();
#define time (double)(clock() - tStart)/CLOCKS_PER_SEC;
typedef long long ll;
typedef long long int lli;
typedef pair < int, int> dbl;
const int maxInt = 1e9*2;
const lli maxLong... | a.cc:11:23: error: '::main' must return 'int'
11 | #define int long long int
| ^~~
a.cc:14:1: note: in expansion of macro 'int'
14 | int main(){
| ^~~
|
s385477685 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define X first
#define Y second
#define REP(i,a) for(int i=0;i<a;++i)
#define REPP(i,a,b) for(int i=a;i<b;++i)
#define FILL(a,x) memset(a,x,sizeof(a))
#define foreach( g... | a.cc: In function 'int main()':
a.cc:45:39: error: overloaded function with no contextual type information
45 | else abs=min(ans,2+abs(x)-abs(y));
| ^
|
s982220005 | p03838 | C++ | #include <iostream>
#include <vector>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cstdio>
#include <queue>
#include <set>
#include <map>
#include <fstream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
#include <numeric>
using namespace std;
#define fast ios::sync_with... | a.cc: In function 'int main()':
a.cc:37:20: error: 'LLONG_MAX' was not declared in this scope
37 | ll x,y,ans=LLONG_MAX;
| ^~~~~~~~~
a.cc:16:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
15 | #include <numeric>
+++... |
s116169405 | p03838 | C++ | CE test | a.cc:1:1: error: 'CE' does not name a type
1 | CE test
| ^~
|
s305212880 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define INF 999999999
#define MOD 1000000007
int main()
{
int x,y;
cin >> x;
cin >> y;
if((x < y) && (x >= 0 || y <= 0)){
cout << y-x;
}else if((y < x) && (x < 0 || y > 0)){
cout << x-y+2;
}else if((y < x) && (x == 0 || y == 0){
cout << x... | a.cc: In function 'int main()':
a.cc:18:47: error: expected ')' before '{' token
18 | }else if((y < x) && (x == 0 || y == 0){
| ~ ^
| )
a.cc:23:1: error: expected primary-expression before '}' token
23 | ... |
s412016149 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#defi... | a.cc: In function 'int main()':
a.cc:39:22: error: expected initializer before '++' token
39 | int p++;
| ^~
a.cc:41:25: error: 'p' was not declared in this scope
41 | p++;
| ^
|
s767168274 | p03838 | C++ | import java.util.Arrays;
import java.util.Scanner;
public class Main {
MyScanner sc = new MyScanner();
Scanner sc2 = new Scanner(System.in);
long start = System.currentTimeMillis();
long fin = System.currentTimeMillis();
final int MOD = 1000000007;
int[] dx = { 1, 0,... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Arrays;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Scanner;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s899659505 | p03838 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#define INT long long
#define MOD 1000000007
#define oo 987654321
#define OO 999999987654321ll
using namespace std;
INT x, y, ans;
queue<int> q;
int main()
{
cin>>x>>y;
... | a.cc: In function 'int main()':
a.cc:23:44: error: expected ';' before 'cout'
23 | ans = min(ans, (-y+x)+2>=0?(-y+x)+2:OO)
| ^
| ;
24 | cout<<ans<<endl;
| ~~~~
|
s030027440 | p03838 | C++ | #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;
long long abs(long long a){
return (a>0)?a:-a;
}
int main(){
long long x,y,cnt=0;
cin>>x>>y;
if((y<0 && x>0)||(y>0 && x<0)){x*=-1;cnt++;}
cout<<cnt+((y<x)?2:0)+abs(y-x)<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:14:34: error: call of overloaded 'abs(long long int)' is ambiguous
14 | cout<<cnt+((y<x)?2:0)+abs(y-x)<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_conversi... |
s381396732 | p03838 | C++ | #include<iostream>
using namespace std;
int main(){
int x,y;
cin>>x>>y;
if(x>=0^y>=0){
cout<<fabs(x-y)+1<<endl;
}else{
cout<<fabs(x-y)<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:8:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
8 | cout<<fabs(x-y)+1<<endl;
| ^~~~
| labs
a.cc:10:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
10 | cout<<fabs(x-y)<<end... |
s006700522 | p03839 | C++ | #include <vector>
#include <iostream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
template<typename T, typename S>
istream& operator >> (istream& is, pair<T, S>& p) {
is >> p.first >> p.second;
return is;
}
template<typename T... | a.cc: In function 'int main()':
a.cc:50:32: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&, long long int)'
50 | pp[i] = pp[i - 1] + max(a[i - 1], 0ll);
| ~~~^~~~~~~~~~~~~~~
In file included from /usr/i... |
s547131514 | p03839 | C++ | /**
* author: nok0
* created: 2020.09.13 22:45:14
**/
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#include<atcoder/all>
using namespace atcoder;
#pragma region Macros
#define ll long long
#define ld long double
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define REP(i,n) FO... | a.cc:10:9: fatal error: atcoder/all: No such file or directory
10 | #include<atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s866591854 | p03839 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second
const int mxn = 100002;
int n, k;
ll a[mxn];
ll s[2][mxn];
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
for(int i... | a.cc: In function 'int main()':
a.cc:26:38: error: no matching function for call to 'max(int, long long int&)'
26 | s[t][i] = max(0, a[i]) + s[t][i - 1];
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/incl... |
s552921828 | p03839 | C++ | # include <iostream>
using namespace std;
long long N;
long long K;
long long a[100005];
long long prefixsum[100005];
long long pprefixsum[100005];
long long tempsum;
long long ans=0;
long long totalsum;
long long psum(long long left, long long right) //sum from left to right indexes//
{
return prefixsum[right]-p... | cc1plus: error: '::main' must return 'int'
|
s624686655 | p03839 | C++ | /**
* @FileName a.cpp
* @Author kanpurin
* @Created 2020.08.20 03:41:51
**/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
int n;cin >> n;
int k;cin >> k;
vector<ll> sum(n+1,0),best(n+1,0);
for (int i = 0; i < n; i++) {
int a;cin >> a;
sum[i... | a.cc: In function 'int main()':
a.cc:21:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>')
21 | cerr << sum << endl;
| ~~~~ ^~ ~~~
| | |
| | std::vector<long long int>
| std:... |
s329500490 | p03839 | C++ | /**
* @FileName a.cpp
* @Author kanpurin
* @Created 2020.08.20 03:41:51
**/
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
int n;cin >> n;
int k;cin >> k;
vector<ll> sum(n+1,0),best(n+1,0);
for (int i = 0; i < n; i++) {
int a;cin >> a;
sum[i... | a.cc: In function 'int main()':
a.cc:21:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<long long int>')
21 | cerr << sum << endl;
| ~~~~ ^~ ~~~
| | |
| | std::vector<long long int>
| std:... |
s552002680 | p03839 | C++ | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vect... | a.cc: In function 'int main()':
a.cc:40:56: error: no matching function for call to 'max(long long int, ll)'
40 | ll l = sum[i], r = sum[n] - sum[i+k], mid = max(0LL, ll(ss[i+k]-ss[i]));
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include... |
s084275559 | p03839 | C++ | //#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vect... | a.cc: In function 'int main()':
a.cc:40:56: error: no matching function for call to 'max(long long int, __gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type)'
40 | ll l = sum[i], r = sum[n] - sum[i+k], mid = max(0LL, ss[i+k]-ss[i]);
| ... |
s532076109 | p03839 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef zxc
#include <sys/resource.h>
#include "debug.h"
#include "profile.h"
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define profile(X) LOG_DURATION(X)
#else
#define debug(...) 42
#define profile(...) 42
#endif
using ll = int64_t... | a.cc: In function 'int main()':
a.cc:130:5: error: 'pFunction' was not declared in this scope
130 | pFunction solve = [](int _) {
| ^~~~~~~~~
a.cc:172:5: error: 'solve' was not declared in this scope
172 | solve(1);
| ^~~~~
|
s624789911 | p03839 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <fstream>
#include <set>
#include <cmath>
#include <array>
#include <iomanip>
#include <cassert>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k... | a.cc: In function 'int main()':
a.cc:29:21: error: no matching function for call to 'max(int64_t&, long long int)'
29 | pos[i] = max(x, 0LL) + (i > 0 ? pos[i - 1]: 0LL);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/lo... |
s908408268 | p03839 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <fstream>
#include <set>
#include <cmath>
#include <array>
#include <iomanip>
#include <cassert>
using namespace std;
int main(void) {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, k;
cin >> n >> k... | a.cc: In function 'int main()':
a.cc:29:21: error: no matching function for call to 'max(int64_t&, long long int)'
29 | pos[i] = max(x, 0LL) + (i > 0 ? pos[i - 1]: 0LL);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/lo... |
s780008110 | p03839 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<long long> csum_a(n + 1,0), csum_b(n + 1,0);
for (int i = 1; i <= n; ++i) {
long long tmp;
cin >> tmp;
csum_a[i] = csum_a[i - 1] + tmp;
csum_b[i] = csum_b[i - 1] + max(tmp, 0LL);... | a.cc: In function 'int main()':
a.cc:22:18: error: no matching function for call to 'max(long int&, long long int)'
22 | ans = max(ans, left + center + right);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s432061221 | p03839 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<long long> csum_a(n + 1), csum_b(n + 1);
for (int i = 1; i <= n; ++i) {
long long tmp;
cin >> tmp;
csum_a[i] = csum_a[i - 1] + tmp;
csum_b[i] = csum_b[i - 1] + max(tmp, 0LL);
... | a.cc: In function 'int main()':
a.cc:22:18: error: no matching function for call to 'max(long int&, long long int)'
22 | ans = max(ans, left + center + right);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s761589059 | p03839 | C++ | eval"N,K,*A="+`dd`.split*?,
*r=(*q=b=c=i=0)
p A.flat_map{|a|q<<c+=a*-1[a];r<<b+=a;q[K]?[q[~K]-c+[b-r[~K],0].max]:[]}.max+c | a.cc:1:15: error: stray '`' in program
1 | eval"N,K,*A="+`dd`.split*?,
| ^
a.cc:1:18: error: stray '`' in program
1 | eval"N,K,*A="+`dd`.split*?,
| ^
a.cc:1:1: error: 'eval' does not name a type
1 | eval"N,K,*A="+`dd`.split*?,
| ^~~~
a.cc:3:73: error: expecte... |
s876974988 | p03839 | C++ | #include<bits/stdc++.h>
using namespace std;
long long N, K, a[100000], parsum1[100001], parsum2[100001];
long long ans = -(1LL<<60);;
int main(){
cin >> N >> K;
for(int i = 0; i < N; ++i) cin >> a[i];
long long sum1 = 0, sum2 = 0;
for(long long i = 1; i <= N; ++i){
sum1 += a[i-1]; parsum1[i] = sum1;
if... | a.cc: In function 'int main()':
a.cc:21:27: error: no matching function for call to 'max(int, long long int)'
21 | csum = max(0, parsum1[i+K] - parsum1[i+1]);
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
fr... |
s347218027 | p03839 | C++ | package main
import (
"fmt"
"math"
)
func max(a, b int) int {
if a < b {
return b
}
return a
}
func max64(a, b int64) int64 {
if a < b {
return b
}
return a
}
func main() {
var n, k int
fmt.Scan(&n, &k)
a := make([]int, n)
for i := 0; i < n; i++ {
fmt.Scan(&a[i])
}
s := make([]int64, n+1)
w := ... | a.cc:1:1: error: 'package' does not name a type
1 | package main
| ^~~~~~~
a.cc:15:1: error: 'func' does not name a type
15 | func max64(a, b int64) int64 {
| ^~~~
a.cc:22:1: error: 'func' does not name a type
22 | func main() {
| ^~~~
|
s092341231 | p03839 | C++ | #include <algorithm>
#include <cstdint>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int64_t> s(n + 1);
vector<int64_t> w(n + 1);
for (int i = 0; i < n; i++) ... | a.cc: In function 'int main()':
a.cc:25:15: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type, long long int)'
25 | sum += max(s[i + k] - s[i], 0LL);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorit... |
s256268153 | p03839 | C++ | #include <cstdint>
#include <iostream>
#include <limits>
#include <vector>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> a(n);
for (int i = 0; i < n; i++) {
cin >> a[i];
}
vector<int64_t> s(n + 1);
vector<int64_t> w(n + 1);
for (int i = 0; i < n; i++) {
s[i + 1] = s[i]... | a.cc: In function 'int main()':
a.cc:24:15: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type, long long int)'
24 | sum += max(s[i + k] - s[i], 0LL);
| ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:... |
s436517914 | p03839 | C++ | #include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
const double PI = acos(-1);
const double EPS = 1e-15;
long long INF=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
long lon... | a.cc: In function 'int main()':
a.cc:58:18: error: no matching function for call to 'max(int, long long int&)'
58 | ps[i] = max(0,a[i]);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s713091583 | p03839 | C++ | #include <iostream>
#include <vector>
int main()
{
// input
int N, K;
std::cin >> N >> K;
std::vector<long long> a(N);
for(int i=0; i<N; i++) scanf(" %lld", &a[i]);
std::vector<long long> sum_l(N), sum_r(N);
sum_l[0] = a[0] > 0 ? a[0] : 0;
sum_r[N-1] = a[N-1] > 0 ? a[N-1] : 0;
for(... | a.cc: In function 'int main()':
a.cc:38:35: error: expected '}' at end of input
38 | std::cout << max << std::endl;
| ^
a.cc:5:1: note: to match this '{'
5 | {
| ^
|
s678916490 | p03839 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#defi... | a.cc: In function 'int main()':
a.cc:44:24: error: no matching function for call to 'max(int, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
44 | c[i+1] = c[i] + max(0, a[i]);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
... |
s390396163 | p03839 | C++ | #pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include... | a.cc: In function 'int main()':
a.cc:57:28: error: no matching function for call to 'max(__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type&, long long int)'
57 | b[i+1] = b[i] + max(a[i], 0LL);
| ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.