submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s428228595
p03660
C++
#include <iostream> #include <ostream> #include <istream> #include <cmath> #include <string> #include <vector> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <map> #include <vector> #include <set> #define pb pus...
a.cc:35:15: error: 'INT_MAX' was not declared in this scope 35 | const int INF=INT_MAX/2; | ^~~~~~~ a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 17 | #include <set> +++ |+#include <climits> 18 | #define pb push_back
s961715508
p03660
C++
#include <iostream> #include <ostream> #include <istream> #include <cmath> #include <string> #include <vector> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <map> #include <vector> #include <set> #define pb pus...
a.cc:35:15: error: 'INT_MAX' was not declared in this scope 35 | const int INF=INT_MAX/2; | ^~~~~~~ a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 17 | #include <set> +++ |+#include <climits> 18 | #define pb push_back
s638884563
p03660
C++
#include <iostream> #include <ostream> #include <istream> #include <cmath> #include <string> #include <vector> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <map> #include <vector> #include <set> #define pb pus...
a.cc:35:15: error: 'INT_MAX' was not declared in this scope 35 | const int INF=INT_MAX/2; | ^~~~~~~ a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 17 | #include <set> +++ |+#include <climits> 18 | #define pb push_back
s354001475
p03660
C++
#include <iostream> #include <string> #include <cstdio> #include <vector> #include <queue> #include <list> #include <cstdlib> #include <algorithm> #include <set> #include <map> #include <deque> #include <cstring> #include <cmath> //#include<bits/stdc++.h> using namespace std; const int INF=0x3f3f3f3f; const int SIZE=1...
a.cc: In function 'int main()': a.cc:42:36: error: expected ';' before 'a' 42 | scanf("%d%d",&a,&b) | ^ | ; 43 | a--; | ~
s933697954
p03660
C++
#include <assert.h> #include <ctype.h> #include <errno.h> #include <error.h> #include <float.h> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <locale> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <wchar.h> #include <wctype...
a.cc:55:10: fatal error: conio.h: No such file or directory 55 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s274882045
p03660
C++
#include <iostream> #include <ostream> #include <istream> #include <cmath> #include <string> #include <vector> #include <sstream> #include <cstring> #include <cstdio> #include <cstdlib> #include <algorithm> #include <queue> #include <deque> #include <stack> #include <map> #include <vector> #include <set> #define pb pus...
a.cc: In function 'int bfs(int)': a.cc:44:24: error: 'o' was not declared in this scope 44 | return o; | ^ a.cc:47:53: error: 'o' was not declared in this scope 47 | if(absd[i][t]==1&&!b[i])f=0,at[v]=++o; | ...
s353324767
p03660
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:60:13: error: 'a' was not declared in this scope 60 | dfs(a); | ^ a.cc:61:18: error: 'b' was not declared in this scope 61 | cout<<(d[b]%2?"Snuke":"Fennec")<<endl; | ^
s945355783
p03660
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<cstring> #include<cmath> #define reg register #define LL long long #define cmin(a,b) ((a)<(b)?(a):(b)) #define cmax(a,b) ((a)>(b)?(a):(b)) const int MaxN = 100010; struct Data{ int Next, To; }Tree[MaxN*2]; int Last[MaxN], T, N, ...
a.cc: In function 'int Read()': a.cc:24:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 24 | reg int aa;reg char ch;while(ch=getchar(),ch<'0'||ch>'9'); aa=ch-'0'; | ^~ a.cc:24:29: warning: ISO C++17 does not allow 'register' storage class specifier ...
s366364745
p03660
C++
#include <vector> #include <queue> #include <algorithm> #include <iostream> #include <string> #include <ctime> #include <map> #include <stack> #include <sstream> #include <set> #include <cmath> #include <functional> #include <numeric> using namespace std; int n; int color[100001]; vector <int> adj[100001]; int depth[...
a.cc: In function 'void bfs()': a.cc:27:9: error: 'memset' was not declared in this scope 27 | memset(depth, INF, sizeof(depth)); | ^~~~~~ a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 13 | #include <numeric> +++ |+#incl...
s001075297
p03660
C++
#include<iostream> #include<vector> #include<queue> using namespace std; #define REP(i, n) for(int i=0; i<n; i++) typedef pair<int, int> pii; const int max_n = 10e5; int INF = 10e8; struct edge{ int to, cost; }; int d[max_n]; int n; vector<edge> g[max_n]; vector<int> spath; int pre[max_n]; void dijkstra(int ...
a.cc: In function 'std::vector<int> get_path(int)': a.cc:54:5: error: 'reverse' was not declared in this scope 54 | reverse(path.begin(), path.end()); | ^~~~~~~
s455707476
p03660
C++
#include<bits/stdc++.h> using namespace std; typedef pair <int, int> pii; int N; vector <pii> ab; int res; bool flag[100100]={0}; int F=0, S=0, SF=0; int graph[100100]={0}; void rec(int n, int m, int gl){ if(gl==n){ return; } flag[n]=true; graph[n]+=m; for(int...
a.cc: In function 'int main()': a.cc:70:18: error: expected '}' at end of input 70 | return 0; | ^ a.cc:30:11: note: to match this '{' 30 | int main(){ | ^
s111848465
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <stack> #include <cstdlib> using namespace std; typedef long long ll; const int MAXN = (int)1e5+10; struct edge { int to, next; }ed[MAXN << 1]; int head[MAXN], cnt; void addedge(int u, int v) { ed[cnt].to = v; ed[cnt].next = head[u]; he...
a.cc: In function 'int main()': a.cc:37:5: error: 'memset' was not declared in this scope 37 | memset(head, -1, sizeof(head)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <cstdlib> +++ |+#include <cstring...
s606907753
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <stack> #include <cstdlib> using namespace std; typedef long long ll; const int MAXN = (int)1e5+10; struct edge { int to, next; }ed[MAXN << 1]; int head[MAXN], cnt; void addedge(int u, int v) { ed[cnt].to = v; ed[cnt].next = head[u]; he...
a.cc: In function 'int main()': a.cc:37:5: error: 'memset' was not declared in this scope 37 | memset(head, -1, sizeof(head)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <cstdlib> +++ |+#include <cstring...
s321065945
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <stack> using namespace std; typedef long long ll; const int MAXN = (int)1e5+10; struct edge { int to, next; }ed[MAXN << 1]; int head[MAXN], cnt; void addedge(int u, int v) { ed[cnt].to = v; ed[cnt].next = head[u]; head[u] = cnt++; } i...
a.cc: In function 'int main()': a.cc:36:5: error: 'memset' was not declared in this scope 36 | memset(head, -1, sizeof(head)); | ^~~~~~ a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 4 | #include <stack> +++ |+#include <cstring> ...
s228776207
p03660
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Map<Integer, Set<Integer>> graph = new HashMap<>(n); for (int i = 1; i <= n; i++) { graph.put(i, new HashSet<>()); } ...
Main.java:21: error: Deque is abstract; cannot be instantiated Deque<List<Integer>> queue = new Deque<>(); ^ 1 error
s180586551
p03660
C++
#include <iostream> #include <vector> #include <cstring> using namespace std; typedef long long ll; int n, m; vector<int> graph[100001]; int fennec, snuke; bool visited[100001]; void dfsSnuke(int node, int prev){ if(node == 0)return; visited[node] = true; snuke ++; for(int i =0 ; i < graph[node].size();...
a.cc: In function 'int main(int, const char**)': a.cc:47:8: error: 'fenec' was not declared in this scope; did you mean 'fennec'? 47 | if(fenec == snuke){ | ^~~~~ | fennec
s600797973
p03660
C++
int d[2][100000]; vector <int> v[100000]; void dfs(int x, int y, int z, int w) { int i; d[w][x] = z; for (i = 0; i < v[x].size(); i++) { if (v[x][i] == y) continue; dfs(v[x][i], x, z + 1, w); } } int main() { int n, c1 = 0, c2 = 0, i; scanf("%d", &n); ...
a.cc:2:1: error: 'vector' does not name a type 2 | vector <int> v[100000]; | ^~~~~~ a.cc: In function 'void dfs(int, int, int, int)': a.cc:9:21: error: 'v' was not declared in this scope 9 | for (i = 0; i < v[x].size(); i++) { | ^ a.cc: In function 'int main()': a.cc:19:5: er...
s379497204
p03660
C++
#include <sstream> #include <string> #include <vector> #include <map> #include <algorithm> #include <iostream> #include <utility> #include <set> #include <cctype> #include <queue> #include <stack> #include <cstdio> #include <cstdlib> #include <cmath> using namespace std; int N; vector<int> *g; vector<int> bfn(int spoi...
a.cc: In function 'std::vector<int> bfn(int)': a.cc:46:8: error: 'spoint' was not declared in this scope; did you mean 'spoit'? 46 | dist[spoint] = 0; | ^~~~~~ | spoit
s832354004
p03660
C++
} int main(void) { int n; vector<vector<int>> v; cin >> n; for (int i = 0; i < n; ++i) { int a, b; cin >> a >> b; v[a - 1].push_back(b - 1); v[b - 1].push_back(a - 1); } if (isFirst(n, v)...
a.cc:3:1: error: expected declaration before '}' token 3 | } | ^ a.cc: In function 'int main()': a.cc:8:5: error: 'vector' was not declared in this scope 8 | vector<vector<int>> v; | ^~~~~~ a.cc:8:19: error: expected primary-expression before 'int' 8 | vector<vector<int>> v; | ...
s939676215
p03660
C++
#include <iostream> #include <iterator> #include <algorithm> #include <vector> using namespace std; class Node{ public: vector<int> next_node; void set_node(int _a){ next_node.push_back(_a); } }; int count_tree(int size, vector<int> route, vector<Node> all_node){ int now_pos=route[route.size()...
a.cc:131:1: error: 'Yoshito' does not name a type 131 | Yoshito-MacBook:cpp yoshitoi$ fg | ^~~~~~~ a.cc:142:7: error: redefinition of 'class Node' 142 | class Node{ | ^~~~ a.cc:7:7: note: previous definition of 'class Node' 7 | class Node{ | ^~~~ a.cc:197:5: error: redefinition of ...
s029683710
p03660
C++
#include <iostream> #include <vector> #include <set> using namespace std; int main() { int N; cin >> N; vector<vector<int>> nvec; int check[100000]; for (int i = 0; i < N; i++) { vector<int> temp; nvec.push_back(temp); check[i] = 0; } check[0] = check[N-1] = 1; for (int i = 0; i < N-1; i+...
a.cc: In function 'int main()': a.cc:51:14: error: 'class std::set<int>' has no member named 'push_back' 51 | vB.push_back(y); | ^~~~~~~~~ a.cc:65:14: error: 'class std::set<int>' has no member named 'push_back' 65 | vW.push_back(y); | ^~~~~~~~~
s858639553
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 30000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/ccFLtrni.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o a.cc:(.text+0...
s163280496
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 40000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/cc54CBue.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o a.cc:(.text+0...
s553970515
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 50000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/ccqnUHFE.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o a.cc:(.text+0...
s333131575
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 60000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/ccB9QZHS.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o a.cc:(.text+0...
s209731313
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 70000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/cc6590ff.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc6590ff.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc6590ff.o a.cc:(.text+0...
s188232461
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 80000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/cc4CTopm.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc4CTopm.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc4CTopm.o a.cc:(.text+0...
s130404416
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 90000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int...
/tmp/cc5CHQfy.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc5CHQfy.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc5CHQfy.o a.cc:(.text+0...
s828791945
p03660
C++
#include <iostream> #include <vector> #include <queue> #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; int n; int M[N][N]; int color[N]; void bfs(int s1, int s2){ queue<int> q1,q2; q1.push(s1); q2.push(s2); for(int i = 0; i < n; i++) color[i]=NO...
/tmp/ccZMScZF.o: in function `bfs(int, int)': a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccZMScZF.o a.cc:(.text+0x97): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccZMScZF.o a.cc:(.text+0xb5):...
s314708563
p03660
C++
#include <iostream> #include <vector> #include <queue> #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; int n; int M[N][N]; int color[N]; void bfs(int s1, int s2){ queue<int> q1,q2; q1.push(s1); q2.push(s2); for(int i = 0; i < n; i++) color[i]=NO...
/tmp/ccjxOhm6.o: in function `bfs(int, int)': a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccjxOhm6.o a.cc:(.text+0x97): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccjxOhm6.o a.cc:(.text+0xb5):...
s034873826
p03660
C++
#include <iostream> #include <vector> #include <queue> #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; int n; int M[N][N]; int color[N]; void bfs(int s1, int s2){ queue<int> q1,q2;q1.push(s1);q2.push(s2);for(int i = 0; i < n; i++) color[i]=NOCOLOR; colo...
/tmp/ccjzx3sl.o: in function `bfs(int, int)': a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccjzx3sl.o a.cc:(.text+0x97): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccjzx3sl.o a.cc:(.text+0xb5):...
s514491276
p03660
C++
#include <iostream> #include <vector> #include <queue> #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; int n; int M[N][N]; int color[N]; void bfs(int s1, int s2){ queue<int> q1,q2; q1.push(s1); //init state(fennec) q2.push(s2); //init state(snuke) ...
/tmp/ccNgF4MF.o: in function `bfs(int, int)': a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccNgF4MF.o a.cc:(.text+0x97): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccNgF4MF.o a.cc:(.text+0xb5):...
s730920338
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int M[N][N] = {}; int color[N] = {}; void bfs(int n, int s1, i...
/tmp/ccx5ay0n.o: in function `bfs(int, int, int, int)': a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccx5ay0n.o a.cc:(.text+0xa3): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccx5ay0n.o a.cc:(.t...
s152879596
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int n=0; int M[N][N]={}; int color[N]={}; void bfs(int s1, int...
/tmp/ccQqsmcz.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccQqsmcz.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccQqsmcz.o a.cc:(.text+0...
s371582261
p03660
C++
//前向星+SPFA /* edeg[]: 邻接表 dis[]: 最短路数组 vis[]: 出入队标记数组 cnt[]: 入队次数统计 head[u]:表示起点为u的最后一条边的标号,如果是-1表示没有以u为起点的边 init::初始化边 add::(u起点, v终点, w权值) spfa::(s起点,n点数)[-1存在负环,反之为到点n最短路权值] */ #include<iostream> #include<queue> #include<algorithm> #define N 100005 #define INF 0x3f3f3f3f using namespace std; struct Edge { int to; ...
a.cc: In function 'void init()': a.cc:36:9: error: 'memset' was not declared in this scope 36 | memset(vis,0,sizeof(vis)); | ^~~~~~ a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 15 | #include<algorithm> +++ |+#include <c...
s782101641
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int M[N][N]; int color[N]; void bfs(int n, int s1, int s2, int...
/tmp/cczyPtE5.o: in function `bfs(int, int, int, int)': a.cc:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cczyPtE5.o a.cc:(.text+0xa3): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cczyPtE5.o a.cc:(.t...
s145523536
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int tur...
/tmp/ccUNn4SX.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccUNn4SX.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccUNn4SX.o a.cc:(.text+0...
s947063421
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int main(void){ cin.sync_with_stdio(false); int a,b; ...
a.cc: In function 'int main()': a.cc:45:12: error: 'turn' was not declared in this scope 45 | if(turn==0){ | ^~~~
s110375801
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int n=0, M[N][N]; int color[N]; void bfs(int s1, int s2, int t...
/tmp/ccP07S0Q.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccP07S0Q.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccP07S0Q.o a.cc:(.text+0...
s943636836
p03660
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int tur...
/tmp/ccpGigl4.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccpGigl4.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccpGigl4.o a.cc:(.text+0...
s090791718
p03660
C++
#include <iostream> #include <vector> #include <algorithm> #include <queue> #include <list> //color #define NOCOLOR 0 #define BLACK 1 //Fennec #define WHITE 2 //Snuke #define N 100000 using namespace std; static const int INFTY = 1000; int n, M[N][N]; int color[N]; void bfs(int s1, int s2, int turn){ queue<int>...
/tmp/ccZcEfc1.o: in function `bfs(int, int, int)': a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccZcEfc1.o a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccZcEfc1.o a.cc:(.text+0...
s011677370
p03660
C++
#include<bits/stdc++.h> using namespace std; #define nmax 100000 #define ll long long int n; int a,b; int s[nmax][nmax]; int d[nmax]={0}; ll Calc(int depth,int pl,int *f){ ll re; int fs[nmax]; for(int i=0;i<n;i++) fs[i]=f[i]; if(fs[pl]!=0) return depth%2?1:-1; if(depth%2){ //maxCalc...
a.cc: In function 'long long int Calc(int, int, int*)': a.cc:27:1: warning: control reaches end of non-void function [-Wreturn-type] 27 | } | ^ /tmp/ccCCuWUq.o: in function `Calc(int, int, int*)': a.cc:(.text+0x12b): relocation truncated to fit: R_X86_64_PC32 against symbol `d' defined in .bss section in /tmp/...
s858615366
p03660
C
#include<stdio.h> int main() { int N; scanf("%d",&N); int st[N][N]; int leng[N];//STの配列の長さcount for(int i=0;i<=N;i++){ leng[i]=1;//初期化 } for(int i=0;i<=N;i++){ int a,b; scanf("%d %d",&a,&b); st[a][leng[a]]=b; st[b][leng[b]]=a; leng[a]++; leng[b]++; } st[0][0]=1;//1=black st[N][0]=2;//2=white for(int i...
main.c: In function 'main': main.c:22:9: error: implicit declaration of function 'check' [-Wimplicit-function-declaration] 22 | int ch=check(1,N,st); | ^~~~~ main.c: At top level: main.c:34:27: error: array type has incomplete element type 'int[]' 34 | int check(int x,int N,int st[][]){ | ...
s188485780
p03660
C++
#include<bits/stdc++.h> using namespace std; #define nmax 100000 #define ll long long int n; int a,b; int s[nmax][nmax]; int d[nmax]={0}; ll Calc(int depth,int pl,int *f){ ll re; int fs[nmax]; for(int i=0;i<n;i++) fs[i]=f[i] if(fs[pl]!=0) return depth%2?1:-1; if(depth%2){ //maxCalc ...
a.cc: In function 'long long int Calc(int, int, int*)': a.cc:13:19: error: expected ';' before 'if' 13 | fs[i]=f[i] | ^ | ; 14 | if(fs[pl]!=0) | ~~ a.cc:27:1: warning: no return statement in function returning non-void [-Wreturn-ty...
s244577311
p03660
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back const int N = 1e5 + 5; int n; vector <int> G[N]; bool visited[N]; int dist1[N], dist2[N]; char color[N]; void dfs1(int x, int d) { if(x == n) return; visited[x] = 1; color[x] = 'B'; dist1[x] = d; for(int y: G[x]) { ...
a.cc: In function 'void dfs2(int, int)': a.cc:41:13: error: 'dfs' was not declared in this scope; did you mean 'ffs'? 41 | dfs(y, d + 1); | ^~~ | ffs
s948812315
p03660
C++
//D /*==========================================================*/ /* Template ver 2017-0401 | Created by AVM.Martin */ /* DOMINUS pascit me, et nihil mihi deerit (Psalmorum 23:1) */ /*==========================================================*/ #include<cstdio> #include<iostream> #include<cstdlib> #include<c...
a.cc: In function 'int main()': a.cc:73:36: error: expected ':' before ')' token 73 | puts(n%2==0?"Snuke""Fennec"); | ^ | : a.cc:73:36: error: expected primary-expression before ')' token
s042550145
p03660
C++
#include <bits/stdc++.h> #include <memory> using namespace std; #define INF 0x3f3f3f3f typedef long long ll; const int N = 100005; #define FI first #define SE second typedef pair<int, int>pii; int mod = 1000000007; vector<int> tr[N]; int dep, n; int next[N]; bool vis[N]; void dfs(int u, int pre, int d) { ...
a.cc: In function 'void dfs(int, int, int)': a.cc:21:7: error: reference to 'next' is ambiguous 21 | next[pre] = u; | ^~~~ 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-linux-gnu/c+...
s928005687
p03660
C++
#include <bits/stdc++.h> #define ll long long #define mp make_pair #define pb push_back #define f first #define vi vector<int> #define vl vector<long long> #define sz size() #define x first #define y second #define pii pair<int, int> #define pll pair<ll, ll> #define ld long double using namespace std; vi g[100100]; ...
a.cc: In function 'int main()': a.cc:52:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 52 | ans += s[par[cur]] - s[cur]; | ^~~ | abs
s703151362
p03661
C++
#include <algorithm> #include <bitset> #include <tuple> #include <cstdint> #include <cstdio> #include <cctype> #include <assert.h> #include <stdlib.h> #include <stdio.h> #include <cassert> #include <cfloat> #include <climits> #include <cmath> #include <complex> #include <ctime> #include <deque> #include <fstream> #incl...
a.cc: In function 'int main()': a.cc:142:2: error: expected '}' at end of input 142 | } | ^ a.cc:133:26: note: to match this '{' 133 | /*signed*/int main(void) { | ^
s339212282
p03661
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin>>N; vector<int>A(N); vector<int>B(N); for(int i=0;i<N;i++){cin>>A[i];B[i]=A[i]+(i!=0? B[i-1]:0);} long long ans=100000000000000; for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1])); cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:9:32: error: no matching function for call to 'min(long long int&, int)' 9 | for(int i=0;i<N-1;i++)ans=min(ans,abs(B[i]*2-B[N-1])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /us...
s412929715
p03661
C++
#include <bits/stdc++.h> using namespace std; #define ll int64_t int main() { ios_base::sync_with_stdio(0);cin.tie(0); int n; cin>>n; vector<ll> a(n); for(ll& x:a) cin>>x; ll sum=accumulate(a.begin(),a.end(),0),pf=0; ll res=1e18; for(int i=0;i<n-1;++i){ pf+=a[i]; res=min(res,abs(2ll*pf-sum)); } cout<<res...
a.cc: In function 'int main()': a.cc:15:24: error: no matching function for call to 'min(int64_t&, long long int)' 15 | res=min(res,abs(2ll*pf-sum)); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-...
s822846588
p03661
C++
#include <bits/stdc++.h> using namespace std; #define ll int64_t int main() { ios_base::sync_with_stdio(0);cin.tie(0); int n; cin>>n; vector<ll> a(n); for(ll& x:a) cin>>x; ll sum=accumulate(a.begin(),a.end(),0),pf=0; ll res=1e18; for(int i=0;i<n-1;++i){ pf+=a[i]; res=min(res,abs(2LL*pf-sum)); } cout<<res...
a.cc: In function 'int main()': a.cc:15:24: error: no matching function for call to 'min(int64_t&, long long int)' 15 | res=min(res,abs(2LL*pf-sum)); | ~~~^~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-...
s788281034
p03661
C++
#include <bits/stdc++.h> using namespace std; #define all(x) (x).begin(),(x).end() #define int long long #define ll long long #define vi vector<int> #define pii pair<int,int> #define F first #define S second #define pb push_back #define forn(b) for(int i = 0; i < b; i++) #define rforn(b) for(int i = b - 1 ;i >= 0; i--)...
cc1plus: error: '::main' must return 'int'
s326134423
p03661
C++
#include<iostream> #include<algorithm> #include<string> #include<map>//int dx[4]={0,0,-1,1};int dy[4]={-1,1,0,0}; #include<queue>//int gcd(int a,int b){return b?gcd(b,a%b):a;} #include<vector> #include<cmath> #include<stack> #include<string.h> #include<stdlib.h> #include<cstdio> #define ll long long #define maxn 100005...
a.cc:110:1: error: 'details' does not name a type 110 | details/81333376 | ^~~~~~~
s156007895
p03661
C++
#include <iostream> #include <stack> #include <climits> using namespace std; int abs(int a) {return (a < 0) ? -a : a;} int main(){ int N; cin >> N; int a[N]; long long s[N], t[N], x=0, y=0; for (int i = 0; i < N; i++) cin >> a[i]; for (int i = 0; i < N; i++) s[N-i-1] = (x+=a[i]), t[i] = (y+=a[...
a.cc: In function 'int main()': a.cc:17:18: error: no matching function for call to 'min(int&, long long int)' 17 | MIN = min(MIN, abs(t[i-1]-s[i])); | ~~~^~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_cla...
s988418169
p03661
C++
#include<bits/stdc++.h> #include <iostream> #include <string> #include <vector> using namespace std; #define ll long long #define rep(i, n) for (ll i = 0; i < (n); i++) #define FOR(i,a,b) for(ll i=(a);i<(b);i++) #define FORR(i,a,b)for(ll i=(a);i<=(b);i++) #define repR(i,n) for(ll i=n-1;i>=0;i--) #define all(v)(v).begin...
a.cc: In function 'int main()': a.cc:55:12: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)' 55 | ans=min(b[i]); | ~~~^~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/...
s973380835
p03661
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a; int b[256],d=0; cin>>a; for(int i=0;i<a;i++){ cin>>b[i]; } sort(b,b+n); if(a==2){ d=a/2; } else{ d=a/2+1; } c+=(b.begin(),b[d]); cout<<c<<'\n'; return 0; }
a.cc: In function 'int main()': a.cc:10:12: error: 'n' was not declared in this scope 10 | sort(b,b+n); | ^ a.cc:17:3: error: 'c' was not declared in this scope 17 | c+=(b.begin(),b[d]); | ^ a.cc:17:9: error: request for member 'begin' in 'b', which is of non-class type 'int [256]' ...
s752807685
p03661
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,c=0,d=0,x=1; int q,w; int b[1000000]; int z[1000000]; cin>>a; for(int i=0;i<1000000;i++){ z[i]=10000000; } for(int i=0;i<a;i++){ cin>>b[i]; d+=b[i]; } sort(b,b+a); c=b[0]; d+=b[a-1]; } z[0]=abs(c-d); for(int i=1;...
a.cc:20:3: error: 'z' does not name a type 20 | z[0]=abs(c-d); | ^ a.cc:21:3: error: expected unqualified-id before 'for' 21 | for(int i=1;i<a-1;i++){ | ^~~ a.cc:21:15: error: 'i' does not name a type 21 | for(int i=1;i<a-1;i++){ | ^ a.cc:21:21: error: 'i' does not nam...
s810795850
p03661
C++
#include <iostream> #include <bits/stdc++.h> using namespace std; const int maxn=1<<18; int n; vector<int> e[maxn]; int cnt[maxn]; vector <int> vct; int frst; void dfs(int v,int pr){ cnt[v]=1; vct.push_back(v); if(v==n-1){ frst=vct[((int)vct.size()+1)/2]; } for(int j=0;j<e[v].size();j++){ if(e[v][j]==pr) conti...
a.cc: In function 'int mian()': a.cc:26:30: error: 'clear' was not declared in this scope 26 | e[i]=clear(); | ^~~~~ a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type] 41 | } | ^
s907402596
p03661
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int ...
a.cc: In function 'int main()': a.cc:71:3: error: 'rev' was not declared in this scope 71 | rev(d); | ^~~
s385327415
p03661
C++
#include<bits/stdc++.h> using namespace std; #define int long long #define fo(a,b) for(int a=0;a<b;a++) #define Sort(a) sort(a.begin(),a.end()) int wari(int a,int b) { if(a%b==0) return a/b; else return a/b+1; } int keta(int a){ double b=a; b=log10(b); int c=b; return c+1; } int souwa(int ...
a.cc: In function 'int main()': a.cc:65:16: error: no match for 'operator<' (operand types are 'long long int' and 'std::vector<long long int>') 65 | for(int i=1;i<b;i++) | ~^~ | | | | | std::vector<long long int> | long long int In fi...
s538551350
p03661
C++
#include <iostream> #include <bits/stdc++.h> #include <vector> #include <algorithm> using namespace std; #define REP(i,n) FOR(i,0,n) #define FOR(i,a,b) for(long long i=(a),i##Len_=(b);i<i##Len_;i++) typedef long long ll; static const ll MOD = 1000000007; int main() { ll N; cin >> N; ll a[N]; ll x ...
a.cc: In function 'int main()': a.cc:25:15: error: 'INF' was not declared in this scope 25 | ll iMin = INF; | ^~~
s138829349
p03661
C++
#include <bits/stdc++.h> #define for(i, l, r) for (register int i = (l), i##end = (int)(r); i <= i##end; ++i) #define fordown(i, r, l) for (register int i = (r), i##end = (int)(l); i >= i##end; --i) #define rep(i, r) for (register int i = (0), i##end = (int)(r); i < i##end; ++i) #define set(a, v) memset(a, v, sizeof(a...
a.cc:17:44: error: macro "for" requires 3 arguments, but only 1 given 17 | for (; !isdigit(ch); ch = getchar()) if (ch == '-') sgn = -1; | ^ a.cc:3:9: note: macro "for" defined here 3 | #define for(i, l, r) for (register int i = (l), i##end = (int)(r); i <...
s378086498
p03661
C++
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<long long> A(N); for(int i=0; i<N; ++i) { cin >> A[i]; if(i > 0) A[i] += A[i-1]; } int res = 1001001001001001; for(int i=0; i+1<N; ++i) { res = min(res, abs(A[N-1] - A[i] - A[i])); ...
a.cc: In function 'int main()': a.cc:13:15: warning: overflow in conversion from 'long int' to 'int' changes value from '1001001001001001' to '-1256873943' [-Woverflow] 13 | int res = 1001001001001001; | ^~~~~~~~~~~~~~~~ a.cc:15:18: error: no matching function for call to 'min(int&, long long...
s807284048
p03661
C++
#include <bits/stdc++.h> typedef long long LL; const int MAXN = 2e5 + 5; int main() { int N; scanf("%d", &N); static LL a[MAXN]; LL sum = 0; for (int i = 1; i <= N; i++) { scanf("%d", &a[i]); sum += a[i]; } LL pre = a[1], mDif = abs(sum - 2 * a[1]); for (int i = 2; i <= N; i++) { pre += a[i]; mDif ...
a.cc: In function 'int main()': a.cc:21:32: error: no matching function for call to 'min(LL&, int)' 21 | mDif = std::min(mDif, abs(sum - 2 * pre)); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/incl...
s909908570
p03661
C++
#include<vector> #include<algorithm> #include<cmath> #include<numeric> using namespace std; using ll = long long; int main(){ ll n; cin>>n; vector<int>a(n); for(auto &e:a)cin>>e; ll sum=accumulate(a.begin(),a.end(),0); ll tmp=0; int i=0; for(;i<n-1;++i){ tmp+=a[i]; ...
a.cc: In function 'int main()': a.cc:10:5: error: 'cin' was not declared in this scope 10 | cin>>n; | ^~~ a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 4 | #include<numeric> +++ |+#include <iostream> 5 | a.cc:22:13: err...
s378225727
p03661
C++
#include<iosteam> #include <string.h> #include <algorithm> #include<cstdlib> typedef long long ll; using namespace std; int main() { ll n,a[200000],x = 0,y = 0,lim= 9223372036854775807,ans=0; memset(a,0,sizeof(a)); cin >> n; for(int i = 0; i < n; i++) { cin >> a[i]; ans += a[i]; ...
a.cc:1:9: fatal error: iosteam: No such file or directory 1 | #include<iosteam> | ^~~~~~~~~ compilation terminated.
s341365234
p03661
C++
#include <string.h> #include <algorithm> #include<cstdlib> typedef long long ll; using namespace std; int main() { ll n,a[200000],x = 0,y = 0,lim= 9223372036854775807,ans=0; memset(a,0,sizeof(a)); cin >> n; for(int i = 0; i < n; i++) { cin >> a[i]; ans += a[i]; } for(int i...
a.cc: In function 'int main()': a.cc:11:5: error: 'cin' was not declared in this scope 11 | cin >> n; | ^~~ a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 3 | #include<cstdlib> +++ |+#include <iostream> 4 | typedef long l...
s430607779
p03661
C++
#include "pch.h" #include <iostream> #include <math.h> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> a(N); for (int i = 0;i < N;i++) { cin >> a[i]; } int x = 0;int y = N - x; int Max = 1000000000; for (int i = 1;i < N;i++) { int xC = 0; int yC = 0; x = i; for...
a.cc:3:10: fatal error: pch.h: No such file or directory 3 | #include "pch.h" | ^~~~~~~ compilation terminated.
s463481543
p03661
C
#include<iostream> #include<vector> #include<string.h> using namespace std; #define N 110 vector<int>g[N]; int dis1[N], parent[N]; int n, num; //work out the distance between each point and first point with dfs void dfs_dis(int cur, int par){ int next; dis1[cur] = dis1[par] + 1; for(int i = 0; i < g[cur].si...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s263605898
p03661
C++
Select Code #include<stdio.h> int n; int list[200001]; long long int abs(long long int x) { return x<0 ? -x : x; } int main() { while (scanf("%d", &n) != EOF) { long long int sum = 0; for (int i = 0; i<n; i++) { scanf("%d", &list[i]); sum += list[i]; } long long int sumi = 0; long long int ans =1e18; ...
a.cc:1:1: error: 'Select' does not name a type 1 | Select Code | ^~~~~~ a.cc: In function 'int main()': a.cc:7:16: error: 'scanf' was not declared in this scope 7 | while (scanf("%d", &n) != EOF) { | ^~~~~ a.cc:20:17: error: 'printf' was not declared in this scope 20 | ...
s219884807
p03661
C++
#include<iostream> #include<cstdlib> using namespace std; int main() { long long N; long long Sum_t[200000]={0}; cin>>N; cin>>Sum_t[0]; for(int i=1;i<N;i++) { cin>>Sum_t[i]; Sum_t[i]=Sum_t[i-1]+Sum_t[i]; } long long min=abs(Sum[N-1]-2...
a.cc: In function 'int main()': a.cc:18:26: error: 'Sum' was not declared in this scope; did you mean 'Sum_t'? 18 | long long min=abs(Sum[N-1]-2*Sum[0]); | ^~~ | Sum_t
s544348568
p03661
C
#include<stdio.h> #include<math.h> int main() { long long int s1,s2=0,min,x; int N,i,p=1; scanf("%d",&N); long long int a[N]; for(i=0;i<N;i++) { scanf("%lld",&a[i]); } s1=a[0]; for(i=1;i<N;i++) { s2=s2+a[i]; } min=llabs(s2-s1); for(p=1;p<N-1;p++){ ...
main.c: In function 'main': main.c:18:9: error: implicit declaration of function 'llabs' [-Wimplicit-function-declaration] 18 | min=llabs(s2-s1); | ^~~~~ main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'llabs' 2 | #include<math.h> +++ |+#include <stdlib.h> 3 | int main(...
s820056671
p03661
C++
#include<iostream> #include<cmath> using namespace std; const long long size=2e+5; long long a[size],b[size]; long long n,s,min=2e+10,result; int main() { cin>>n>>a[0]; b[0]=a[0]; s=a[0]; for(int i=1;i<n;i++) { cin>>a[i]; b[i]=b[i-1]+a[i]; s+=a[i]; } for(int i=0;i<n-1;i++) { result=abs(2*...
a.cc:5:21: error: reference to 'size' is ambiguous 5 | long long a[size],b[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, ...
s096174768
p03661
C++
#include<iostream> #include<cmath> using namespace std; const long long size=2e+5; long long a[size],x[size]; long long n,s; int main() { cin>>n>>a[0]; x[0]=a[0]; s=a[0]; for(int i=1;i<n;i++) { cin>>a[i]; x[i]=x[i-1]+a[i]; s+=a[i]; } long long min=2e+10,result; for(int i=0;i<n-1;i++) { re...
a.cc:5:21: error: reference to 'size' is ambiguous 5 | long long a[size],x[size]; | ^~~~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, ...
s884319088
p03661
C++
#include <iostream> #include<cmath> using namespace std ; int sum(int a , int t[] ,int e) {int sum=0,j; for(j=a;j<e;++j) sum+=t[j]; return sum; } int main() { int N,i,b; cin>>N; int *a= new int g [N]; for(i=0;i<N;++i) cin>>a[i]; for(i=0;i<N-1;++i) if(b>abs(sum(0,a,i+1)-sum(i+1,a,N))||i==0) b=abs(sum(0,a,i+1)-sum(i+1...
a.cc: In function 'int main()': a.cc:14:17: error: expected ',' or ';' before 'g' 14 | int *a= new int g [N]; | ^
s165318800
p03661
C++
#include<stdio.h> #include<stdlib.h> #include<windows.h> #include<windef.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i =...
a.cc:3:9: fatal error: windows.h: No such file or directory 3 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s764111970
p03661
C
#include<stdio.h> #include<stdlib.h> #include<windows.h> #include<windef.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i =...
main.c:3:9: fatal error: windows.h: No such file or directory 3 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.
s361949148
p03661
C
#include<stdio.h> #include<stdlib.h> #include<Windows.h> #include<windef.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i =...
main.c:3:9: fatal error: Windows.h: No such file or directory 3 | #include<Windows.h> | ^~~~~~~~~~~ compilation terminated.
s407215300
p03661
C
#include<bits/stdc++.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i = 1; i <= n - 1; i++) { Min = min(abs(sum[i] - (sum...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s655731727
p03661
C
#include<stdio.h> #include<stdlib.h> #include<math.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i = 1; i <= n - 1; i++) {...
main.c: In function 'main': main.c:17:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 17 | Min = min(abs(sum[i] - (sum[n] - sum[i])), Min); | ^~~ | main
s320029786
p03661
C
#include<stdio.h> #include<stdlib.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min =1e9; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i = 1; i <= n - 1; i++) { Min = min(abs(...
main.c: In function 'main': main.c:16:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 16 | Min = min(abs(sum[i] - (sum[n] - sum[i])), Min); | ^~~ | main
s839620071
p03661
C
#include<stdio.h> #include<stdlib.h> #define N 2*100000 long long a[N]; long long sum[N + 200]; long long Min = _INTEGRAL_MAX_BITS; int main() { long long n, m; scanf("%lld", &n); sum[0] = 0; for (int i = 1; i <= n; i++) { scanf("%lld", &a[i]); sum[i] = sum[i - 1] + a[i]; } for (int i = 1; i <= n - 1; i++) { ...
main.c:6:17: error: '_INTEGRAL_MAX_BITS' undeclared here (not in a function) 6 | long long Min = _INTEGRAL_MAX_BITS; | ^~~~~~~~~~~~~~~~~~ main.c: In function 'main': main.c:16:23: error: implicit declaration of function 'min'; did you mean 'main'? [-Wimplicit-function-declaration] 16 | ...
s874113965
p03661
C++
#include "iostream" #include "cmath.h" #define MAX 100000; using namespace std; int main() { long int n;int idx=0; long long int _sum[MAX]; long long int a[MAX]; long long int sum=0; long long int min=MAX; cin>>n; for(idx=1;idx<=n;idx++){ cin>>a[idx]; _sum[idx]=_sum[idx-1]+a...
a.cc:2:10: fatal error: cmath.h: No such file or directory 2 | #include "cmath.h" | ^~~~~~~~~ compilation terminated.
s466964621
p03661
C
#include "stdio.h" #include "math.h" #define MAX 1000000000 int main(){ long int n; long long int min=0; long long int a[MAX]; long long int _sum[MAX]; long long int sum=0; int idx=0; scanf("%ld",&n); for(idx=1;idx<=n;idx++){ scanf("%lld",&a[idx]); sum+=a[idx]; _sum[idx]=_sum[idx-1]+a[idx]; } for(idx=...
main.c: In function 'main': main.c:18:21: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 18 | min=abs(2*_sum[idx]-sum); | ^~~ main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs' 2 | #include "math.h" +++ |+#include ...
s579612810
p03661
C++
#include<stdio.h> #include<malloc.h> int sum(long int *a, int n, int m) { long int sum = 0; for (int i = n; i <= m; i++) sum += a[i]; return sum; } int min(long long int *a, int n) { int flag,min=0; for (int i = 0; i < n-1; i++) { if (a[i] > a[i + 1]) min = i + 1; } return a[min]; } int main() { int n; lo...
a.cc: In function 'int main()': a.cc:29:26: error: invalid conversion from 'long long int*' to 'long int*' [-fpermissive] 29 | sumx=sum(a, 0, i); | ^ | | | long long int* a.cc:3:19: note: initializing argum...
s399508099
p03661
C++
int main() { long size,s,i; s=i=0; cin>>size; long* a=new long[size]; long* b=new long[size]; for(i=0;i<size;i++) { cin>>a[i]; s+=a[i]; b[i]=s; } long k=abs(s-b[0]*2); for(i=0;i<size-1;i++) { if(abs(s-b[i]*2)<k) { k=abs(s-b[i]*2); } } cout<<k; delete [] a; delete [] b; return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin>>size; | ^~~ a.cc:14:16: error: 'abs' was not declared in this scope 14 | long k=abs(s-b[0]*2); | ^~~ a.cc:22:9: error: 'cout' was not declared in this scope 22 | ...
s432387722
p03661
C++
#include<cmath> using namespace std; int main() { int N; cin >> N; int* a = new int[N],sum = 0,sum1 = 0,r1,r; for(int i=0;i < N;i++) { cin >> a[i]; sum = sum + a[i]; } r = abs(sum - 2 * a[1]); for(int k = 0;k < N - 1;k++) { for(int i = 0;i < k + 1;i++) sum1 = sum1 + a[i]; r1 = abs(sum - 2 ...
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> N; | ^~~ a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include<cmath> +++ |+#include <iostream> 2 | using nam...
s379017104
p03661
C++
#include<iostream> #include<cmath> #include<algorithm> using namespace std; int main() { int N; cin >> N; int* a = new int(N),sum = 0,sum1 = 0; int* r = new int(N-1); for(int i=0;i < N;i++) { cin >> a[i]; sum = sum + a[i]; } for(int k = 0;k < N - 1;k++) { for(int i = 0;i < k + 1;i++) sum1 = ...
a.cc: In function 'int main()': a.cc:25:19: error: expected ';' before 'return' 25 | delete []a | ^ | ; 26 | return 0; | ~~~~~~
s311938035
p03661
C
#include <stdio.h> #include <stdlib.h> #include <math.h> const int MOD=1e9+7; const int qq=2e5+10; long long sum[qq]; long long min(long long a, long long b) { return a<b?a:b; } int main() { int num; scanf("%d",&num); sum[0]=0; for(int i=1;i<=num;i++) { scanf("%lld",sum+i); sum[i]+=sum[i-1]; } long long mi...
main.c:6:11: error: variably modified 'sum' at file scope 6 | long long sum[qq]; | ^~~
s334891435
p03661
C++
#include<iostream> #include<math.h> using namespace std; #define MLimit 1000000000 char Result[50]; void Add(int a,int a_,int b,int b_,int &Re,int &Re_) { int temp; if (a > 0) { if (b > 0) { temp = 1000000000 - b - a; if (temp < 0)//向上越界 { Re_=1+a_+b_; Re = -temp; } else { Re_=a_+...
a.cc: In function 'void ToStr(int&, int&, char*)': a.cc:95:17: error: 'itoa' was not declared in this scope 95 | itoa(a_, Re, 10); | ^~~~ a.cc:97:17: error: 'strcat' was not declared in this scope 97 | strcat(Re, str); | ^~~~~~ a.cc:4:1: ...
s019500121
p03661
C++
#include<iostream> using namespace std; int main() { const int size=2e+5; int a[size]; int n,s=0; cin>>n; if(n<2||n>size) return -1; for(int i=0;i<n;i++) { cin>>a[i]; s+=a[i]; } int min=size,x,y,sum; for(int i=0;i<n-1;i++) { x=0; y=0; sum=0; for(int j=0;j<=i;j++) { ...
a.cc: In function 'int main()': a.cc:22:16: error: unable to find numeric literal operator 'operator""\U0000ff1b' 22 | x=0; | ^~~
s850621954
p03661
C++
#include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; const int MAXN=2e5+5; const int MOD=1000000000; const LL INF=(2e5)*(1e9)+5; long long a[MAXN]; long long sum[MAXN]; int main() { int n; while(cin>>n) { long long tot=0; for(int i=1...
a.cc:9:7: error: 'LL' does not name a type 9 | const LL INF=(2e5)*(1e9)+5; | ^~ a.cc: In function 'int main()': a.cc:25:23: error: 'INF' was not declared in this scope 25 | long long Min=INF; | ^~~
s293881783
p03661
C++
#include<iostream> #include<cmath> using namespace std; long long a[200000]={0}; long long min[200000] = {0}; int main() { int num, counts; while (cin >> num) { for (int i = 0; i < num; i++) cin >> a[i];//input comlete int sum, latersum, frontsum, Min; counts = sum = latersum = frontsum = Min = 0; for...
a.cc: In function 'int main()': a.cc:28:25: error: reference to 'min' is ambiguous 28 | min[j] = abs(latersum - frontsum); | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s867373745
p03661
C++
#include<iostream> #include<cmath> using namespace std; long long a[200000]; long long min[200000]; int main() { int num, counts; while (cin >> num) { for (int i = 0; i < num; i++) cin >> a[i];//input comlete int sum, latersum, frontsum, Min; counts = sum = latersum = frontsum = Min = 0; for (int i = ...
a.cc: In function 'int main()': a.cc:28:25: error: reference to 'min' is ambiguous 28 | min[j] = abs(latersum - frontsum); | ^~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s259296045
p03661
C
#include <stdio.h> #include <math.h> int main() { int n=0; scanf("%d",&n); int sum[n]={0,0}; int tem; for(int i=1;i<=n;i++) { scanf("%d",&tem); sum[i]=sum[i-1]+tem; } int min=2147483647; for (int i=1;i<n;i++) { if(min>abs(sum[n]-2*sum[i])) { min=abs(sum[n]-2*sum[i]); } } printf("%d",min)...
main.c: In function 'main': main.c:8:20: error: variable-sized object may not be initialized except with an empty initializer 8 | int sum[n]={0,0}; | ^ main.c:18:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 18 | if(min>abs(su...
s569059528
p03661
C
#include <stdio.h> #include <math.h> int main() { int n=0; scanf("%d",&n); int sum[n]={0,0}; int tem; for(int i=1;i<=n;i++) { scanf("%d",&tem); sum[i]=sum[i-1]+tem; } int min=2147483647; for (int i=1;i<n;i++) { if(min>abs(sum[n]-2*sum[i])) { min=abs(sum[n]-2*sum[i]); } } printf("%d",min)...
main.c: In function 'main': main.c:8:20: error: variable-sized object may not be initialized except with an empty initializer 8 | int sum[n]={0,0}; | ^ main.c:18:24: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration] 18 | if(min>abs(su...
s152855476
p03661
C
#include<stdio.h> #include<stdlib.h> #include<math.h> int main() { int n; while(scanf_s("%d", &n)&&2<=n<=2*pow(10,5)) break; int *a=NULL; a = (int *)malloc(sizeof(int)*n); int i = 0; while (scanf_s("%d", &a[i]) && i < n-1&&-pow(10,9)<=a[i]<=pow(10,9)) i++; int sum = 0; int j=0; for ( j = 0; j<n; j++)...
main.c: In function 'main': main.c:8:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 8 | while(scanf_s("%d", &n)&&2<=n<=2*pow(10,5)) | ^~~~~~~ | scanf
s282117141
p03661
C++
#include<stdio.h> long int abs_1(long int i){ if(i<0) return -i; else return i; } int main() { int N,i,j; long long int sum1=0,sum2=0; scanf_s("%d",&N); long int a[200000]={0},x,min=2e+9; for(i=0;i<N;i++) { scanf_s("%ld",&a[i]); } for(i=0;i<N-1;i++) { sum1=0,sum2=0; for(j=i;j>=0;j--) { sum1+=a[...
a.cc: In function 'int main()': a.cc:11:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 11 | scanf_s("%d",&N); | ^~~~~~~ | scanf
s890782970
p03661
C++
#include <stdio.h> int main(){ int length; int arr[200000]; int res[200000]={0}; int temp = 0; int m = 2e5; scanf("%d",&length); for(int i=0;i<length;++i){ scanf("%d",&arr[i]); } res[0] = arr[0]; for(int i=1;i<length;++i){ res[i] += res[i-1] + arr[i]; } for(i...
a.cc: In function 'int main()': a.cc:19:16: error: 'abs' was not declared in this scope 19 | temp = abs(res[length-1]-res[i-1]*2); | ^~~ a.cc:20:13: error: 'min' was not declared in this scope; did you mean 'main'? 20 | m = min(temp,m); | ^~~ | ...