submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s224816126 | p03837 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;... | a.cc: In function 'int main()':
a.cc:29:24: error: array must be initialized with a brace-enclosed initializer
29 | int dist[1000][1000]=100000000;
| ^~~~~~~~~
|
s221012171 | p03837 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;... | a.cc: In function 'int main()':
a.cc:15:13: error: array must be initialized with a brace-enclosed initializer
15 | #define MAX 100000007
| ^~~~~~~~~
a.cc:29:24: note: in expansion of macro 'MAX'
29 | int dist[1000][1000]=MAX;
| ^~~
|
s448311891 | p03837 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;... | a.cc: In function 'int main()':
a.cc:58:54: error: expected primary-expression before '<=' token
58 | for(int j = 0; j < N; ++j) if(dist[j][a[i]]+c[i]=<=dist[j][b[i]]) shortest=true;
| ^~
|
s272890932 | p03837 | C++ | #include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#define MAX 100000007
using namespace std;
using ll = long long;... | a.cc: In function 'int main()':
a.cc:48:22: error: 'n' was not declared in this scope
48 | for(int k = 0; k < n; ++k){
| ^
a.cc:55:11: error: 'm' was not declared in this scope
55 | int ans=m;
| ^
a.cc:58:24: error: 'n' was not declared in this scope
58 | for(... |
s809836866 | p03837 | C++ | //#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include... | a.cc: In function 'int main()':
a.cc:75:7: error: 'i' was not declared in this scope
75 | FOr(i, 1, m+1){
| ^
a.cc:75:3: error: 'FOr' was not declared in this scope; did you mean 'FOR'?
75 | FOr(i, 1, m+1){
| ^~~
| FOR
|
s616862218 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 110;
const ll MAX_N = 100010;
const ll INF = 1e12;
vector<pair<ll, ll> > g[MAX_N]; // firstに最短距離, secondに頂点番号
ll d[MAX_N];
int n; // 頂点数
bool used[MAX_N][MAX_N];
int pr[MAX_N]; // 最短路の直前の頂点
// bellman ford法で負辺がない場合。計算量はO(|E|log|V... | /tmp/ccIoRXMM.o: in function `dijkstra(int)':
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
a.cc:(.text+0x2d6): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/ccIoRXMM.o
/tmp/ccIoRXMM.o: in fun... |
s174770094 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 110;
const ll MAX_N = 100010;
const ll INF = 1e12;
vector<pair<ll, ll> > g[MAX_N]; // firstに最短距離, secondに頂点番号
ll d[MAX_N];
int n; // 頂点数
bool used[MAX_N][MAX_N];
int pr[MAX_N]; // 最短路の直前の頂点
// bellman ford法で負辺がない場合。計算量はO(|E|log|V... | /tmp/cc4VS7b2.o: in function `dijkstra(int)':
a.cc:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
a.cc:(.text+0x2d6): relocation truncated to fit: R_X86_64_PC32 against symbol `pr' defined in .bss section in /tmp/cc4VS7b2.o
/tmp/cc4VS7b2.o: in fun... |
s204218974 | p03837 | C++ | n,m = list(map(int,input().split()))
d = []
for i in range(m):
a,b,c = list(map(int,input().split()))
d.append([a-1,b-1,c])
e = [[100000 for i in range(n)] for j in range(n)]
for i in range(n):
e[i][i] = 0
for i in d:
e[i[0]][i[1]] = i[2]
e[i[1]][i[0]] = i[2]
for k in range(n):
for i in rang... | a.cc:1:1: error: 'n' does not name a type
1 | n,m = list(map(int,input().split()))
| ^
|
s168702438 | p03837 | C++ | c++.h"
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pi pair<int,int>
#define mp make_pair
#define pb push_back
#define MOD 1e9 + 7
#define PAI 3.1415
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define pr(... | a.cc:1:6: warning: missing terminating " character
1 | c++.h"
| ^
a.cc:1:6: error: missing terminating " character
a.cc:1:1: error: 'c' does not name a type
1 | c++.h"
| ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:28:12: error: 'swap' was not declared in this sco... |
s508275188 | p03837 | C++ | // 無向グラフにしてある.
#include <bits/stdc++.h>
using namespace std;
/* define const */
const int Nmax = 100;
const int M = 10000;
/* finish defineing const */
int graph[Nmax+10][Nmax+10];
int g_tmp[Nmax+10][Nmax+10];
int a[Nmax+10];
int b[Nmax+10];
int c[Nmax+10];
int n,m;
int main()
{
for (int i = 0; i < Nmax+10; i++) {... | a.cc: In function 'int main()':
a.cc:21:7: error: 'd' was not declared in this scope
21 | d[i][j] = M;
| ^
|
s717388959 | p03837 | C++ | #include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#inc... | a.cc:84:19: error: 'int index [100][100]' redeclared as different kind of entity
84 | int index[100][100];
| ^
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from a.cc:15:
/usr/include/strings.h:50:20: note: previous dec... |
s624111897 | p03837 | C++ | #include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#inc... | a.cc:84:19: error: 'int index [100][100]' redeclared as different kind of entity
84 | int index[100][100];
| ^
In file included from /usr/include/string.h:462,
from /usr/include/c++/14/cstring:43,
from a.cc:15:
/usr/include/strings.h:50:20: note: previous dec... |
s146140194 | p03837 | C++ | 3 2
1 2 1
2 3 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3 2
| ^
|
s987148171 | p03837 | C++ | #include<bits/stdc++.h>
using namespace std;
#define INF 10000000
int main(){
int n, m; cin >> n >> m;
vector<vector<int> > dist(n, vector<int> (n, INF));
for(int i = 0; i < n; i++) dist[i][i] = 0;
vector<int> a(m);
vector<int> b(m);
vector<int> c(m);
for(int i = 0; i < m; i++){
... | a.cc:42:2: error: stray '#' in program
42 | }#include<bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:19:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = int; _Alloc = std::allocator<int>; reference = int&; size_type... |
s417122352 | p03837 | C++ | int main(void){
const int inf = 100000000;
int n,m; cin>>n>>m;
int a[1000],b[1000],c[1000],dist[100][100];
for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
}
for(inti=0;i< for(int j = 0;
m; ++i){
b[i] >> c[i];
n; ++i){ j<n;++j){
} }
if(i==j)
dist[i][j]=0;
else
dist[i][j]=inf;
for(inti=0;i<m;++i){ dist[a[i]][b[i]]=m... | a.cc: In function 'int main()':
a.cc:4:10: error: 'cin' was not declared in this scope
4 | int n,m; cin>>n>>m;
| ^~~
a.cc:6:5: error: 'inti' was not declared in this scope; did you mean 'int'?
6 | for(inti=0;i< cin >> a[i] >> a[i]--,b[i]--;
| ^~~~
| int
a.cc:6:12: error: 'i' w... |
s944542637 | p03837 | C++ |
/*#include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define __... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s266028515 | p03837 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define __int... | In file included from /usr/include/c++/14/queue:66,
from a.cc:3:
/usr/include/c++/14/bits/stl_queue.h: In instantiation of 'class std::priority_queue<std::pair<int, int>, std::vector<std::pair<int, int> >, std::greater<std::pair<int, int> >()>':
a.cc:28:42: required from here
28 | priority... |
s715973700 | p03837 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<deque>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define ll __int64
//#define __int... | a.cc:16:12: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:18:16: note: in expansion of macro 'll'
18 | #define P pair<ll,ll>
| ^~
a.cc:22:8: note: in expansion of macro 'P'
22 | vector<P>G[1000];
| ... |
s782263762 | p03837 | C++ | #include<bits/stdc++.h>
#define REP(i,n) for(int i = 0;i < (n);i++)
#define P pair<int,int>
#define pb push_back
#define mk make_pair
using namespace std;
const int INF = 1e9;
typedef long long ll;
#define MAX_V 10000
struct edge {
int to;
int cost;
};
int V;
vector<edge> G[MAX_V];
int d[MAX_V];
void dij... | a.cc: In function 'int main()':
a.cc:58:14: error: expected ';' before 'G'
58 | e = {f,c}
| ^
| ;
59 | G[t].pb(e);
| ~
|
s342693124 | p03837 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <li... | a.cc: In function 'int main()':
a.cc:45:12: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'll' {aka 'long long int'})
45 | cin>n>>m;
| ~~~^~~~~
| | |
| | ll {aka long long int}
| std::istrea... |
s165742296 | p03837 | C++ | #include <cstdio>
#define INF 10000000;
using namespace std;
int n,m;
long long dp[100][100];
int a[1000],b[1000],c[1000];
void initialize(void){
for(int lp1=0;lp1<100;lp1++){
for(int lp2=0;lp2<100;lp2++){
if(lp1==lp2){
dp[lp1][lp2]=0;
}else{
dp[lp1][lp2]=INF;
}
}
}
}
void input(void){
int edg... | a.cc: In function 'void shortestpath()':
a.cc:37:49: error: found ':' in nested-name-specifier, expected '::'
37 | dp[lp2][lp3]=std:min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
| ^
| ... |
s494817072 | p03837 | C++ | #include <cstdio>
#define INF 10000000;
using namespace std;
int n,m;
long long dp[100][100];
int a[1000],b[1000],c[1000];
void initialize(void){
for(int lp1=0;lp1<100;lp1++){
for(int lp2=0;lp2<100;lp2++){
if(lp1==lp2){
dp[lp1][lp2]=0;
}else{
dp[lp1][lp2]=INF;
}
}
}
}
void input(void){
int edg... | a.cc: In function 'void shortestpath()':
a.cc:37:46: error: 'min' was not declared in this scope
37 | dp[lp2][lp3]=min(dp[lp2][lp3],dp[lp2][lp1]+dp[lp1][lp3]);
| ^~~
|
s228290521 | p03837 | C++ | #include <iostream>
#include <tuple>
#include <queue>
#include <algorithm>
using namespace std;
typedef tuple<int, int, int> tiii;
const int INF = 1 << 29;
int N, M;
int A[100][100];
int a, b, c;
queue<tiii> q;
int main(void) {
cin >> N >> M;
fill_n(A, N * N, INF);
for (int i = 0; i < M; ++i) {
cin >> a >> b >> c;... | In file included from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/includ... |
s547992644 | p03837 | C++ | #include <iostream>
#include <tuple>
#include <queue>
#include <algorithm>
using namespace std;
typedef tuple<int, int, int> tiii;
const int INF = 1 << 29;
int N, M,
int A[100][100];
int a, b, c;
queue<tiii> q;
int main(void) {
cin >> N >> M;
fill_n(A, N * N, INF);
for (int i = 0; i < M; ++i) {
cin >> a >> b >> c;... | a.cc:9:1: error: expected unqualified-id before 'int'
9 | int A[100][100];
| ^~~
a.cc: In function 'int main()':
a.cc:14:16: error: 'A' was not declared in this scope
14 | fill_n(A, N * N, INF);
| ^
|
s346025491 | p03837 | Java | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class Main {
InputStream is;
PrintWriter out;
String INPUT = "";
void solve()
{
int n = ni()... | Main.java:58: error: array required, but int found
if(a[from[i]][to[i]] + dist[to[i][j]] == dist[from[i]][to[i]]){
^
Main.java:58: error: bad operand types for binary operator '+'
if(a[from[i]][to[i]] + dist[to[i][j]] == dist[from[i]][to[i... |
s246104209 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
/*てんぷれぞーん!*/
struct edge {int to,cost;};
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> VI;
typedef vector<edge> VE;
//static const int INF = 2147483647;
static const int INF = 1000000000;
static const long long llINF = 9223372000000000000;
static cons... | a.cc: In function 'void WF()':
a.cc:47:21: error: reference to 'prev' is ambiguous
47 | prev[i][j] = prev[k][j];
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/in... |
s201297410 | p03837 | C++ | #include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン!!!!
#d... | a.cc: In function 'int main()':
a.cc:69:52: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
69 | if (a[b[i].to] + b[i].cost == a[b[i].from][j])
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
|
s686120147 | p03837 | Java | import java.util.Scanner;
public class Main2{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int m = sc.nextInt();
int[] a = new int[m];
int[] b = new int[m];
int[] c = new int[m];
int[][] dist = new int[n][n];
for(int i = 0; i < n; i++){
for(i... | Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java
public class Main2{
^
1 error
|
s413697927 | p03837 | Java | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class <Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
int[][] edge = new int[m][3];
int[][] ... | Main.java:5: error: <identifier> expected
public class <Main {
^
Main.java:5: error: > expected
public class <Main {
^
2 errors
|
s099415624 | p03837 | C++ | // kurikazu
#include<iostream>
#include<vector>
#include<queue>
#include<set>
// #include<unordered_set>
using namespace std;
typedef pair<int, int> pii;
int main(){
int n, m;
std::cin >> n >> m;
vector<vector<pii> > g(n);
set<pii> s;
for (int i = 0; i < m; i++) {
int a, b, c;
std::cin >> a >> b >> c;... | a.cc: In function 'int main()':
a.cc:22:31: error: 'sort' was not declared in this scope; did you mean 'short'?
22 | for (int i = 0; i < n; ++i) sort(g[i].begin(), g[i].end());
| ^~~~
| short
|
s513122559 | p03837 | C++ | #include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <utility>
int main() {
int g[128][128]={};
for (size_t i=0; i<128; ++i)
for (size_t j=0; j<128; ++j)
g[i][j] = 5e8;
size_t N;
int M;
scanf("%zu %d", &N, &M);
std::map<std::pair<size_t, size_t... | a.cc: In function 'int main()':
a.cc:48:66: error: expected ']' before ')' token
48 | if (!edges[e] && !edges[std::make_pair(e.second, e.first)) ++cnt;
| ^
| ]
|
s994272087 | p03837 | Java | import java.io.*;
import java.util.*;
public class Main {
private static MyScanner scanner;
private boolean[][] path;
private int[][] distance;
public static void main (String[] args){
Main instance = new Main();
scanner = instance.new MyScanner();
instance.solve();
}
... | Main.java:28: error: cannot find symbol
for (int i = 0; i < m; i++) {
^
symbol: variable m
location: class Main
Main.java:33: error: cannot find symbol
for (int k = 0; k < n; k++) {
^
symbol: variable n
location: class M... |
s826076970 | p03837 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] a = new int[M];
int[] b = new int[M];
int[] c = new int[M];
for(int i = 0; i < M; i++) {
a[i] = sc.nextInt() - 1;
... | Main.java:20: error: array required, but int found
dp[0][i][j] = Integer.MAX_VALUE;
^
Main.java:22: error: array required, but int found
dp[0][i][j] = 0;
^
Main.java:27: error: array required, but int found
dp[0][a[i]][b[i]] = c[i];
^
Main.j... |
s961124768 | p03837 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int M = sc.nextInt();
int[] a = new int[M];
int[] b = new int[M];
int[] c = new int[M];
for(int i = 0; i < M; i++) {
a[i] = sc.nextInt() - 1;
... | Main.java:33: error: bad operand types for binary operator '+'
dp[i][j] = Math.min(dp[i][j], dp[i][k] + dp[k][j]);
^
first type: int[]
second type: int[]
1 error
|
s105341773 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
typedef long long ll;
const ll INF = 1000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;
int n, m;
int adj[200][200];
bool useE[200][200];
bool used[200];
int prev[200];
int d[200];
void dijkstra(int s){
fill(d, d + n, INF);... | a.cc: In function 'void dijkstra(int)':
a.cc:22:17: error: reference to 'prev' is ambiguous
22 | prev[i] = -1;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s628026275 | p03837 | C++ | #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=... | In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare) [with _Tp = int; _Compare = int... |
s772524144 | p03837 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
using namespace std;
int main() {
int a[1000], b[1000], c[1000];
int n, m;
cin >> n >> m;
for (int i = 0; i < m; i++) {
cin >> a[i] >> b[i] >> c[i];
}
for (int i = 0; i < m; i++) {
a[i]--;
b[i... | a.cc: In function 'int main()':
a.cc:31:13: error: 'memset' was not declared in this scope
31 | memset(v2, 0, n * sizeof *v0);
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <cstdlib>
+++ |+#... |
s957347620 | p03837 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
int g[101][101];
int es[101][101];
int main() {
int N, M; cin >> N >> M;
rep(i, N) rep(j, N) g[i][j] = 1 << 29;
rep(i, M) {
int a, b, c; cin >> a >> b >> c;
a--; b--;
es[a][b] = es[b][a] = g[a][b] = g[b][a] = c;
}
rep... | a.cc:15:34: error: macro "rep" passed 3 arguments, but takes just 2
15 | rep(i, N) rep(j, i + 1, N) if (es[i][j] == g[i][j]) M--;
| ^
a.cc:3:9: note: macro "rep" defined here
3 | #define rep(i, n) for (int i = 0; i < n; i++)
| ^~~
a.cc: In function 'in... |
s151376760 | p03837 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <map>
using namespace std;
struct Vertex;
struct Edge {
int w;
Vertex *s, *t;
};
struct Vertex {
int n;
vector<Edge*> neighbor;
int d = INT_MAX;
Vertex *pre = NULL;
int visited = 0;
};
struct comparator {
bool oper... | a.cc:18:13: error: 'INT_MAX' was not declared in this scope
18 | int d = INT_MAX;
| ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <map>
+++ |+#include <climits>
5 | using namespace std;
a.cc: In... |
s012522850 | p03837 | Java | import java.util.ArrayList;
import java.util.Scanner;
public class CandidatesOfNoShortestPaths {
static ArrayList[] gragh;
static int n, m;
static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
n = sc.nextInt();
m = sc.nextInt();
init();
for(int i = 0;i < n;i++){
... | Main.java:4: error: class CandidatesOfNoShortestPaths is public, should be declared in a file named CandidatesOfNoShortestPaths.java
public class CandidatesOfNoShortestPaths {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s828214736 | p03837 | Java | import java.util.*;
import java.io.*;
public class Dijkstra {
static final int INF = (int) Math.pow(10, 9);
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer(br.readLin... | Main.java:4: error: class Dijkstra is public, should be declared in a file named Dijkstra.java
public class Dijkstra {
^
1 error
|
s363314375 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n)... | a.cc: In function 'int main()':
a.cc:61:4: error: expected '}' at end of input
61 | }
| ^
a.cc:40:16: note: to match this '{'
40 | int main(void) {
| ^
|
s284750434 | p03837 | C++ | #include <iostream>
#include <vector>
using namespace std;
class Node{
public:
vector<int> ecost;
bool done;
int cost;
vector<int> wayid
int from;
void init(int n){ ecost.resize(n); wayid.resize(n); }
};
void find(bool *unused, Node *node, int i, int j, int n);
int main(){
int n, m;
cin >> n >> m;
int a[m], ... | a.cc:10:21: error: expected ';' at end of member declaration
10 | vector<int> wayid
| ^~~~~
| ;
a.cc: In function 'int main()':
a.cc:44:43: error: request for member 'done' in 'node', which is of non-class type 'Node [n]'
44 | for(k=... |
s993362716 | p03837 | C++ | #include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
using namespace std;
const int MAX_V = 100, INF = 999999;
static int cost[MAX_V][MAX_V];
static int edge[MAX_V][MAX_V];
static int d[MAX_V];
static int pre[MAX_V];
bool used[MAX_V];
static int V, E;
void input() {
memset(cost, INF, sizeof(cost));... | a.cc: In function 'void input()':
a.cc:15:9: error: 'memset' was not declared in this scope
15 | memset(cost, INF, sizeof(cost));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<queue>
+++ |+#include ... |
s095078622 | p03837 | C++ | #include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <queue>
#include <random>
using namespace std;
#define min(a,b) ((a)<(b) ? (a):(b))
#def... | a.cc: In function 'int kruskal()':
a.cc:270:25: error: 'v' was not declared in this scope
270 | unite(e.u,e,v);
| ^
|
s421184012 | p03837 | C++ | #include <bits/stdc++.h>
using namespace std;
int graph[101][101];
int dist[101][101];
int prev[101][101];
int V;
int cnt[101][101], mark[101][101];
void floydWarshall ()
{
int i, j, k;
for (i = 0; i < V; i++)
for (j = 0; j < V; j++) {
if(!graph[i][j]) continue;
dist[i][j] = g... | a.cc: In function 'void floydWarshall()':
a.cc:22:13: error: reference to 'prev' is ambiguous
22 | prev[i][j] = i;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-l... |
s658758767 | p03837 | C++ | #include <iostream> #include <algorithm> #include <vector> #include <map>
using namespace std;
void count(
map<pair<int, int>, bool>& edg... | a.cc:1:81: warning: extra tokens at end of #include directive
1 | #include <iostream> #include <algorithm> #include <vector> #include <... |
s313303646 | p03837 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
//頂点fromkら頂点へのtoへのコストcostの辺
struct edge { int from, to, cost;};
const int MAX_V = 100;
const int MAX_E = 10000;
const int INF = 9999;
edge es[MAX_E];
int prev[MAX_V];
int d[MAX_V]; //最短距離
int V, E; //Vは頂点数、Eは辺の数
int used[MAX_V][M... | a.cc: In function 'void shortest_path(int)':
a.cc:24:8: error: reference to 'prev' is ambiguous
24 | fill(prev, prev + V, -1);
| ^~~~
In file included from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/... |
s029430738 | p03837 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <limits>
#include <forward_list>
using namespace std;
struct edge {
int to, cost, id;
};
using graph = vector<vector<edge>>;
auto dijkstra(graph const& gr, int start) {
int const V = gr.size();
constexpr int Inf = numeric_limits<int>::max() / 2;
... | a.cc: In function 'int main()':
a.cc:57:11: error: 'count' was not declared in this scope
57 | cout << count(begin(used), end(used), false) << endl;
| ^~~~~
|
s429844162 | p03837 | C++ | def used(dp,u,v,w):
n=len(dp)
for i in range(n):
for j in range(i+1,n):
if dp[i][j]==dp[i][u]+w+dp[v][j] or dp[i][j]==dp[i][v]+w+dp[u][j]:
return True
return False
while 1:
try:
n,m=map(int,input().split())
es=[]
for _ in range(m):
... | a.cc:18:16: warning: multi-character character constant [-Wmultichar]
18 | dp=[[float('inf')]*n for _ in range(n)]
| ^~~~~
a.cc:1:1: error: 'def' does not name a type
1 | def used(dp,u,v,w):
| ^~~
|
s973997353 | p03837 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<queue>
#include<tuple>
#include<set>
#include<functional>
template<class T>using p_queue = std::priority_queue<T, std::vector<T>, std::greater<>>;
int main()
{
int N, M;
std::cin >> N >> M;
std::vector<std::map<int, int>... | In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/c++allocator.h:33,
from /usr/include/c++/14/bits/allocator.h:46,
from /usr/include/c++/14/string:43,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_ba... |
s932210964 | p03837 | C++ | #include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define o(a) cout << a << endl
#define int long long
using namespace std;
typedef pair<int, int> P;
int n, m;
int a[1010], b[1010], c[1010];
int d[110][110];
int ... | a.cc: In function 'void init(long long int)':
a.cc:21:13: error: reference to 'prev' is ambiguous
21 | prev[i][j] = i;
| ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_... |
s756761302 | p03837 | C++ | #include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <climits>
#include <cstdio>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
using namespace std;
typedef unsigned int ui... | a.cc:50:9: error: 'm_G' does not name a type
50 | m_G[a].push_back( edge{ b, cost } );
| ^~~
a.cc:50:43: error: expected unqualified-id before ')' token
50 | m_G[a].push_back( edge{ b, cost } );
| ^
a.cc: In constructor 'Dijkstra<T>::Di... |
s514918053 | p03837 | C++ | #include "bits/stdc++.h"
using namespace std;
//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<(o)<<" ";}
#define dumpl(o) if(DBG){cerr<<#o<<" "<<(o)<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep... | a.cc: In function 'int main()':
a.cc:201:39: error: use of deleted function 'std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = std::pair<int, int>; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<int, int> >]'
201 |... |
s139632670 | p03838 | C++ | #include "atcoder/all"
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>
const int M... | a.cc:1:10: fatal error: atcoder/all: No such file or directory
1 | #include "atcoder/all"
| ^~~~~~~~~~~~~
compilation terminated.
|
s647677434 | p03838 | C++ | include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i< (n); i++)
using ll = long long;
using namespace std;
int main(){
ll x, y;
cin >> x >> y;
ll ans;
if (x <= y) ans = y - x;
else {
if (x*y != 0 && x/abs(x)*y/abs(y) > 0) ans = x - y + 2;
else ans = abs(-x-y) + 1;
}
cout << ans << endl;
return 0;
}
| a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
7 | ll x, y;
| ^~
a.cc:8:9: error: 'cin' was not declared in this scope
8 | cin >> x >> y;
| ... |
s597238867 | p03838 | C | #include <bits/stdc++.h>
#include <iostream>
using namespace std;
int ghad(int a){
if(a < 0)
return a * -1;
return a;
}
int main() {
int a, b, f = 0;
cin >> a >> b;
while(a != b){
if(ghad(a) < ghad(b)){
a = ghad(a);
a++;
f++;
}
else if(ghad(a) > ghad(b)){
b = ghad(b);
b++;
f++;
}
e... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s067025506 | p03838 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long x = sc.nextLong();
long y = sc.nextLong();
long count = 0;
if(x==0){
if(y>=0){
System.out.println(y);
return;
}else{
System.out.println(y+1);... | Main.java:22: error: ';' expected
System.out.println(Math.abs(x)+1)
^
1 error
|
s571849538 | p03838 | C++ | #pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_st... | a.cc: In function 'int main()':
a.cc:35:5: error: expected '}' before 'else'
35 | else{
| ^~~~
a.cc:28:13: note: to match this '{'
28 | if(x<=y){
| ^
|
s836234854 | p03838 | C++ | #include <iostream>
using namespace std;
int main(){
int x, y;
cin >> x >> y;
if(x<y){
if(x<0 && 0<y){
if(-x<y){
cout << x+y+1 << endl;
}else if(-x>y){
cout << y-x << endl;
}else{
cout << 1 << endl;
}
}else{
cout << y-x << endl;
}
}else{
if... | a.cc: In function 'int main()':
a.cc:35:4: error: expected '}' at end of input
35 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s606921974 | p03838 | C++ | //ABC_128_B// pair型の中にpair型
/*int main() {
int n;
cin >> n;
vector<pair<pair<string,int>,int>> a(n);
for(int i=0;i<n;i++){
string s;
cin >> s;
int num;
cin >> num;
num = num * -1;
a.at(i).first.first = s;
a.at(i).first.second = num;
a.at(i).second = i;
}
sort(a.begin(), ... | a.cc: In function 'int main()':
a.cc:351:14: error: expected primary-expression before '<' token
351 | else if(x =< 0 && y >= 0){
| ^
|
s390891284 | p03838 | C++ | //ABC_128_B// pair型の中にpair型
/*int main() {
int n;
cin >> n;
vector<pair<pair<string,int>,int>> a(n);
for(int i=0;i<n;i++){
string s;
cin >> s;
int num;
cin >> num;
num = num * -1;
a.at(i).first.first = s;
a.at(i).first.second = num;
a.at(i).second = i;
}
sort(a.begin(), ... | a.cc: In function 'int main()':
a.cc:340:24: error: expected primary-expression before '<' token
340 | else if(x >= 0 && y =< 0){
| ^
a.cc:351:14: error: expected primary-expression before '<' token
351 | else if(x =< 0 && y >= 0){
| ^
|
s266274996 | p03838 | C++ | #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define codefor int test;scanf("%d",&test);while(test--)
#define yn(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YN(ans) if(ans)printf("YES\n");else printf("NO\n")
#de... | a.cc:47:11: error: redefinition of 'const int MOD'
47 | const int MOD=1000000007;
| ^~~
a.cc:12:11: note: 'const int MOD' previously defined here
12 | const int MOD=1000000007;
| ^~~
a.cc:49:6: error: redefinition of 'void scan(int&)'
49 | void scan(int& a){scanf("%d",&a);}
... |
s286782381 | p03838 | C++ | #include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<functional>
#include<string>
#include<iomanip>
#include<utility>
#include<string>
#include<map>
#include<unordered_map>
#include<queue>
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
te... | a.cc:48:1: error: expected declaration before '}' token
48 | }
| ^
|
s500124002 | p03838 | C++ | #pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<iostream>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll a,b;
cin >> ... | a.cc: In function 'int main()':
a.cc:42:21: error: expected primary-expression before '<' token
42 | else if(abs(a) =< abs(b) && b < 0){
| ^
a.cc:48:16: error: expected primary-expression before '<' token
48 | if(abs(a) =< b){
| ^
|
s121948539 | p03838 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip>
using ll = long long;
using ull = unsigned long long;
using namespa... | a.cc: In function 'int main()':
a.cc:64:3: error: expected primary-expression before '}' token
64 | }else if(x < 0 && y < 0){
| ^
|
s107803914 | p03838 | C++ | int main()
{
long int x,y,z,a;
cin>>x>>y;
if(x>=0&&y>=0)
{
if(x>y)
{
z=x-y+2;
if(y==0){cout<<x-y+1;}else{cout<<z;}
}
else{
z=y-x;
cout<<z;
}
}
else if (x>=0&&y<=0){
z=-x-y+1;
a=x+y+1;
if(x>=-y){cout<<a;}
else{co... | a.cc: In function 'int main()':
a.cc:4:3: error: 'cin' was not declared in this scope
4 | cin>>x>>y;
| ^~~
a.cc:12:19: error: 'cout' was not declared in this scope
12 | if(y==0){cout<<x-y+1;}else{cout<<z;}
| ^~~~
a.cc:12:37: error: 'cout' was not declared in this scope
... |
s115252950 | p03838 | C++ | include <iostream>
using namespace std;
int main()
{
double x,y,z,a;
cin>>x>>y;
if(x>0&&y>0)
{ if(x>y)
{
z=x+y+1;
cout<<z;
}
else{
z=y-x;
cout<<z;
}
}
else if (x>0&&y<0){
z=-x-y+1;
a=x+y+1;
if(x>-y){cout<<a;}
else{co... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
8 | cin>>x>>y;
| ^~~
a.cc:13:10: error: 'cout' was not declared in this scope
13 | cout<<z;
| ^~~~
a.c... |
s509547417 | p03838 | C++ | #include <iostream>
using namespace std;
int main()
{
double x,y,z,a,b,c;
cin>>x>>y;
if(x>0&&y>0)
{ if(x>y)
{
z=x+y+1;
cout<<z;
}
else{
z=y-x;
cout<<z;
}
}
else if (x>0&&y<0){
z=-x-y+1;
a=x+y+1;
if(x>-y){cout<<a;}
el... | a.cc: In function 'int main()':
a.cc:42:14: error: expected '}' at end of input
42 | return 0;
| ^
a.cc:6:1: note: to match this '{'
6 | {
| ^
|
s608604380 | p03838 | C++ | using System;
namespace kekW
{
internal static class Program
{
private static void Main()
{
var nbrs = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
var x = nbrs[0];
var y = nbrs[1];
int res = 0;
if(x < y)
{
... | a.cc:1:7: error: expected nested-name-specifier before 'System'
1 | using System;
| ^~~~~~
a.cc:5:5: error: 'internal' does not name a type
5 | internal static class Program
| ^~~~~~~~
|
s477434119 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
//#define _GLIBCXX_DEBUG
signed main() {
int x, y; cin >> x >> y;
if(x < y) {
... | a.cc: In function 'int main()':
a.cc:16:3: error: expected '}' before 'else'
16 | else {
| ^~~~
a.cc:13:13: note: to match this '{'
13 | if(x < y) {
| ^
|
s220325512 | p03838 | Java |
import java.util.*;
import java.io.*;
public class {
public static void main(String[] args) {
FastScanner fs = new FastScanner();
int x = fs.nextInt();
int y = fs.nextInt();
int absx = Math.abs(x);
int absy = Math.abs(y);
if(absx > absy){
if(x > 0 && y>... | Main.java:5: error: <identifier> expected
public class {
^
1 error
|
s071167148 | p03838 | Java | な | Main.java:1: error: reached end of file while parsing
?
^
1 error
|
s931945351 | p03838 | C++ | #include <iostream>
int iabs(int a)
{
if (a >= 0) return a;
else return -a;
}
int diffabs(a, b)
{
if (a >= b) return a - b;
else b - a;
}
int main()
{
int x, y;
cin >> x >> y;
int ans = diffabs(iabs(a), iabs(b));
if (((x >= 0 && y >= 0) || (x < 0 && y < 0)) && x > y)
ans += 2;
else if (x < 0 &... | a.cc:9:13: error: 'a' was not declared in this scope
9 | int diffabs(a, b)
| ^
a.cc:9:16: error: 'b' was not declared in this scope
9 | int diffabs(a, b)
| ^
a.cc:9:17: error: expression list treated as compound expression in initializer [-fpermissive]
9 | int diffabs(... |
s211186875 | p03838 | C++ | #include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 1000000007 // //100000000 998244353 //
#define inf 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463
using namespace std;
#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define s... | a.cc: In function 'long long int cal(int, int)':
a.cc:48:15: error: 'INF' was not declared in this scope
48 | else return INF;
| ^~~
|
s975092881 | p03838 | C++ | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <cassert>
using namespace std;
#define ll long long int
#... | a.cc: In function 'int main()':
a.cc:46:30: error: expected ';' before '}' token
46 | ans = min(ans, d + 2)
| ^
| ;
47 | };
| ~
|
s775076581 | p03838 | C++ | #include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <assert>
using namespace std;
#define ll long long int
#d... | a.cc:15:10: fatal error: assert: No such file or directory
15 | #include <assert>
| ^~~~~~~~
compilation terminated.
|
s746874626 | p03838 | C++ | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | a.cc: In function 'int main()':
a.cc:38:13: error: expected primary-expression before ')' token
38 | else if()
| ^
a.cc:39:5: error: expected primary-expression before 'else'
39 | else if(y >= x) cout << y - x << endl;
| ^~~~
|
s926382141 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a , b;
int main(){
migmig
ll ans = 1e18;
cin >> a >> b;
if(a <= b)ans = min(ans , b-a);
if(-a <= b)ans = min(ans ,b+a+1);
if(-a <= -b)ans = min(ans ,a-b+2);
if(a <= -b)ans = min(ans , -b-a+1);
cout << ans;
ret... | a.cc: In function 'int main()':
a.cc:10:5: error: 'migmig' was not declared in this scope
10 | migmig
| ^~~~~~
a.cc:13:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
13 | if(a <= b)ans = min(ans , b-a);
| ^~~
| abs
a.cc:14:16: error: ... |
s265492883 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int ,int > pii;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const ll maxn = 3e6;
const ll mod =1e9+7;
const ld PI = acos((ld)-1);
#define pb push_back
#define endl '\n'
#define dokme(... | a.cc: In function 'll s3()':
a.cc:41:30: error: expected ')' before 'a'
41 | return(boz +a a + 2);
| ~ ^~
| )
|
s213801910 | p03838 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <time.h>
#define ll ... | a.cc: In function 'int main()':
a.cc:51:5: error: 'ci' was not declared in this scope; did you mean 'co'?
51 | ci>>x>>y;
| ^~
| co
|
s486984299 | p03838 | C++ | #include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(... | a.cc: In function 'int main()':
a.cc:116:25: error: no matching function for call to 'min(long long int&, int)'
116 | ans=std::min(ans,abs(X-Y)+2);
| ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c... |
s009398220 | p03838 | C++ | #include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(... | a.cc: In function 'int main()':
a.cc:116:25: error: no matching function for call to 'min(long long int&, int)'
116 | ans=std::min(ans,abs(X-Y)+2);
| ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c... |
s568666287 | p03838 | C++ | #include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(... | a.cc: In function 'int main()':
a.cc:116:25: error: no matching function for call to 'min(long long int&, int)'
116 | ans=std::min(ans,abs(X-Y)+2);
| ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c... |
s329772338 | p03838 | C++ | #include<bits/stdc++.h>
//using namespace std;
#define rep(i,j,n) for(ll i=(ll)(j);i<(ll)(n);i++)
#define REP(i,j,n) for(ll i=(ll)(j);i<=(ll)(n);i++)
#define per(i,j,n) for(ll i=(ll)(j);(ll)(n)<=i;i--)
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(... | a.cc: In function 'int main()':
a.cc:116:28: error: no matching function for call to 'min(long long int&, int)'
116 | if(ans=std::min(ans,abs(X-Y)+2);
| ~~~~~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux... |
s595948751 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long H,W; cin>>H>>W;
if(H==W){
cout<<0<<endl;}
else if(W==0){
if(H>0){
cout<<1+H;}
else
cout<<abs(H);
else if(H<W){
if(0<=H){
cout<<W-H<<endl;}
else if(W<0)
cout<<abs(abs(W)-abs(H));
else
cout<<1+abs(abs(H)-W);}
else{
if(W>=0){
cout<<2+H-W<<endl;}
else if(H... | a.cc: In function 'int main()':
a.cc:12:1: error: expected '}' before 'else'
12 | else if(H<W){
| ^~~~
a.cc:7:14: note: to match this '{'
7 | else if(W==0){
| ^
|
s371725572 | p03838 | C++ |
#include <bits/stdc++.h>
using namespace std;
int _x;
int _y;
int _ans;
void CParseIn () {
cin >> _x >> _y;
}
void Core () {
if (_x / _y >= 0) {
_ans = abs(_x - _y);
return;
}
if (_x < 0 && _y > _abs(_x)) {
_ans = 1 + _y - _x;
return;
}
if (_x < 0 ... | a.cc: In function 'void Core()':
a.cc:21:24: error: '_abs' was not declared in this scope; did you mean 'labs'?
21 | if (_x < 0 && _y > _abs(_x)) {
| ^~~~
| labs
a.cc:26:25: error: '_abs' was not declared in this scope; did you mean 'labs'?
26 | if... |
s735928891 | p03838 | C++ | #include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#... | a.cc:109:1: error: 'g' does not name a type
109 | g
| ^
|
s133881319 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
ll A, B;
cin >> A >> B;
ll ans;
if (A*B < 0) ans = abs(A+B)+1;
else {
if (A < B) ans = B-A;
else {
ans = A-B+2;
if (A*B == 0) ans -= 1;
}
}
cout << ans << endl;
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'll' was not declared in this scope
5 | ll A, B;
| ^~
a.cc:6:10: error: 'A' was not declared in this scope
6 | cin >> A >> B;
| ^
a.cc:6:15: error: 'B' was not declared in this scope
6 | cin >> A >> B;
| ^
a.cc... |
s028026405 | p03838 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
int ans=abs(abs(a)-abs(b));
if(a*b>){
if(a>b)ans+=2;
}
else ans++;
cout<<ans<<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:7:10: error: expected primary-expression before ')' token
7 | if(a*b>){
| ^
|
s742005959 | p03838 | C++ | int x, y;
cin >> x >> y;
int ans = abs(abs(x) - abs(y));
if (x < 0 && y < 0)
ans += 2;
if ((x < 0 && y>0) || (x > 0 && y < 0))
ans++;
if (x > 0 && y>0 && x>y)
ans += 2;
if (x == 0 && y < 0)
ans++;
cout << ans; | a.cc:2:9: error: 'cin' does not name a type
2 | cin >> x >> y;
| ^~~
a.cc:3:23: error: 'abs' was not declared in this scope; did you mean 'ans'?
3 | int ans = abs(abs(x) - abs(y));
| ^~~
| ans
a.cc:3:32: error: 'abs' was not d... |
s758881020 | p03838 | C++ | object DS_Grid1: TDataSource
DataSet = A_
Left = 338
Top = 172
end
| a.cc:1:1: error: 'object' does not name a type
1 | object DS_Grid1: TDataSource
| ^~~~~~
|
s898599799 | p03838 | C++ | using namespace std;
int main() {
int x,y;
cin >> x >> y;
if( ( 0<=x && x<y )||( x<y && y<=0 ))
cout << y-x << endl;
else if(x*y>0)
cout << x-y+2 << endl;
else
{if(x+y>0)
cout << x+y+1 << endl;
else
cout << 1-x-y << endl;
}
} | a.cc: In function 'int main()':
a.cc:5:3: error: 'cin' was not declared in this scope
5 | cin >> x >> y;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:7:5: error: 'c... |
s101794485 | p03838 | C++ | int main() {
int x,y;
cin >> x >> y;
cout << 1-x-y << endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> x >> y;
| ^~~
a.cc:4:5: error: 'cout' was not declared in this scope
4 | cout << 1-x-y << endl;
| ^~~~
a.cc:4:22: error: 'endl' was not declared in this scope
4 | cout << 1-x-y << end... |
s914279649 | p03838 | C++ | int main() {
int x,y;
cin >> x >> y;
cout << 1-x-y << endl;
} | a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
3 | cin >> x >> y;
| ^~~
a.cc:4:5: error: 'cout' was not declared in this scope
4 | cout << 1-x-y << endl;
| ^~~~
a.cc:4:22: error: 'endl' was not declared in this scope
4 | cout << 1-x-y << end... |
s147402779 | p03838 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define re(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
vector<int> par;
Union(int a){
par=vector<int>(a,-1);
}
int find(int a){
if(par[a]<0){
return a;
... | a.cc: In function 'int main()':
a.cc:43:14: error: lvalue required as left operand of assignment
43 | else if(x>y&&y=0)cout << x+1;
| ~~~^~~
a.cc:45:14: error: lvalue required as left operand of assignment
45 | else if(x<y&&x=0)cout << y;
| ~~~^~~
|
s042666500 | p03838 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define re(i,n) for(ll i=0;i<n;++i)
#define ocut cout
#define ouct cout
#define itn int
struct Union{
vector<int> par;
Union(int a){
par=vector<int>(a,-1);
}
int find(int a){
if(par[a]<0){
return a;
... | a.cc: In function 'int main()':
a.cc:42:3: error: 'else' without a previous 'if'
42 | else if(x>y&&y>0)cout << x-y+2;
| ^~~~
|
s603531179 | p03838 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long x,y;
cin >> x >> y;
if(y >= x) cout << y-x << endl;
else if(abs(y) <= abs(x)) cout << x+y+1 << endl;;
else if(abs(y) > abs(x) && x >= 0) cout << -x-y+1 << endl;
else cout << x-y+2 << endl;
}
| a.cc: In function 'int main()':
a.cc:9:3: error: 'else' without a previous 'if'
9 | else if(abs(y) > abs(x) && x >= 0) cout << -x-y+1 << endl;
| ^~~~
|
s188512873 | p03838 | C++ | #include<stdio.h>
#include<algorithm>
using namespace std;
int s(int x,int y){
if(x<=y) return y-x;
else return x-y+2;
}
int main(){
int x,y;
scanf("%d%d",&x,&y);
printf("%d\n",min(s(x,y),min(s(-x,y)+1,min(s(x,-y)+1,s(-x,-y)+2))));
return 0;
| a.cc: In function 'int main()':
a.cc:12:14: error: expected '}' at end of input
12 | return 0;
| ^
a.cc:8:11: note: to match this '{'
8 | int main(){
| ^
|
s489329279 | p03838 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
int x, y;
cin >> x >> y;
int ans;
if (x > 0) {
if (y <= -x) ans = -y - x + 1;
if (-x <= y && y <= 0) ans = x + y + 1;
if (0 < ... | a.cc: In function 'int main()':
a.cc:25:26: error: expected ';' before '}' token
25 | else ans = -y + 1
| ^
| ;
26 | }
| ~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.