submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s507657969
p03845
C++
#include<iostream> using namespace std; int main(){ int N,M,T[100],P,X; int sum=0; cin>>N; for(int i=0;i<N;++i){ cin>>T[i]; sum+=T[i]; ] cin>>M; for(int i=0;i<M;++i){ cin>>P>>X; sum+=P-T[X-1]; cout<<sum<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: expected primary-expression before ']' token 11 | ] | ^ a.cc:19:2: error: expected '}' at end of input 19 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s231229883
p03845
C++
#include <iostream> using namespace std; int main() { int N; int T[100] = {0}; int M; int P[100] = {0}; int X[100] = {0}; int sum = 0; cin >> N; for (int i = 0; i <= N; i++) { cin >> T[i]: sum += T[i]; } cin >> M; for (int i = 0; i <= M; i++) { cin >> P[i] >> X[i]; } for (int ...
a.cc: In function 'int main()': a.cc:15:16: error: expected ';' before ':' token 15 | cin >> T[i]: | ^ | ;
s290593228
p03845
C++
#include <iostream> using namespace std; int main() { int N; int T[100] = {0}; int M; int P[100] = {0}; int X[100] = {0}; int sum = 0; cin >> N; for (int i == 0; i <= N; i++) { cin >> T[i]: sum += T[i]; } cin >> M; for (int i == 0; i <= M; i++) { cin >> P[i] >> X[i]; } for (in...
a.cc: In function 'int main()': a.cc:14:13: error: expected ';' before '==' token 14 | for (int i == 0; i <= N; i++) { | ^~~ | ; a.cc:14:14: error: expected primary-expression before '==' token 14 | for (int i == 0; i <= N; i++) { | ^~ a.cc:14:26: error: ...
s811683325
p03845
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, m, sum = 0; cin >> n; vector<int> t(n); for (int i = 0; i < n; i++) { cin >> t[i]; sum += t[i]; } cin >> m; vector<int> p(m), x(m); for (i = 0; i < m; ++i) cin >> p[i] >> x[i]; for (i = 0; ...
a.cc: In function 'int main()': a.cc:16:10: error: 'i' was not declared in this scope 16 | for (i = 0; i < m; ++i) | ^ a.cc:18:10: error: 'i' was not declared in this scope 18 | for (i = 0; i < m; ++i) | ^ a.cc:20:9: error: 'j' was not declared in this scope 20 | j...
s759207239
p03845
C++
#include <iostream> using namespace std; int main(){ int N, M, ans; cin >> N; int T[N]; for(int i=0; i<N, i++){ cin >> T[i]; } cin >> M; int P[M], X[M]; for(int j=0; j<M; j++){ cin >> P[j] >> X[j]; } for(int i=0; i<M; i++){ ans = 0; for(int j=0; j<N; j++){ ans += i==j ? X[j]...
a.cc: In function 'int main()': a.cc:9:24: error: expected ';' before ')' token 9 | for(int i=0; i<N, i++){ | ^ | ;
s162397169
p03845
C++
#include <iostream> #include <vector> using namespace std; int main() { int n, m; cin >> n; vector<int> t(n); for (int a = 0; a < n; a++) { cin >> t[a]; } cin >> m; for (int a = 0; a < m; a++) { int p, x; cin >> p >> x; cout << accumulate(t.begin(), t.end(), 0) + x - t[p-1] << endl; } }
a.cc: In function 'int main()': a.cc:18:25: error: 'accumulate' was not declared in this scope 18 | cout << accumulate(t.begin(), t.end(), 0) + x - t[p-1] << endl; | ^~~~~~~~~~
s527012052
p03845
C++
#include <iostream> #include <algorithm> #include <string> #include <map> using namespace std; #define rep(i, n) for(int i=0; i<n; ++i) int t[110]; int p[110]; int x[110]; int n, m, time; int main() { cin >> n; rep(i, n) cin >> t[i]; cin >> m; rep(i, m) cin >> p[i] >> x[i]; rep(i, m) { time = 0; re...
a.cc:11:11: error: 'int time' redeclared as different kind of entity 11 | int n, m, time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:1...
s589486552
p03845
Java
import java.util.* class Main{ public static void main (String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t[] = new int[n]; int sum = 0; for(int i=0;i<n;i++){ t[i] = sc.nextInt(); sum += t[i]; } int m = sc.nextInt...
Main.java:1: error: ';' expected import java.util.* ^ 1 error
s503864458
p03845
Java
class Main{ public static void main (String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int t[] = new int[n]; int sum = 0; for(int i=0;i<n;i++){ t[i] = sc.nextInt(); sum += t[i]; } int m = sc.nextInt(); int sum...
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s603141273
p03845
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using lli = long long int; ll MM = 1000000000; ll mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) int main(){ int n; cin >> n; ll t[n]; ll all_time = 0; for(int i = 0; i < n; i++){ cin >> t[i]; all_time += t[i];...
a.cc: In function 'int main()': a.cc:26:20: error: expected ';' before 'cout' 26 | ans += x[i] | ^ | ; 27 | cout << ans << endl; | ~~~~
s175716467
p03845
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using lli = long long int; ll MM = 1000000000; ll mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) int main(){ int n; cin >> n; ll t[n]; ll all_time = 0; for(int i = 0; i < n; i++){ cin >> t[i]; all_time += t[i];...
a.cc: In function 'int main()': a.cc:26:20: error: expected ';' before 'cout' 26 | ans += x[i] | ^ | ; 27 | cout << ans << endl; | ~~~~
s540798195
p03845
C
#include<stdio.h> int N, M, T[100], P, X, sum, max, i, j; int main(){ scanf("%d\n", &N); for(i=0; i<N; i++){ scanf("%d", &T[i]); sum+=T[i]; } scanf("%d\n", &M); for(i=0; i<M; i++){ scanf("%d%d", &P, &X); if(T[P]>max+X){max=T[P]-X} } printf("%d\n", sum-max;); }
main.c: In function 'main': main.c:12:30: error: expected ';' before '}' token 12 | if(T[P]>max+X){max=T[P]-X} | ^ | ; main.c:14:25: error: expected ')' before ';' token 14 | printf("%d\n", sum-max;); | ~ ^ ...
s408107609
p03845
C++
#include <iostream> using namespace std; int main(){ int n, m, sum = 0; int t[101] = {0}, p[101] = {0}, x[101] = {0}; cin >> n; for ( int i = 1; i <= n; i++ ){ cin >> t[i]; sum += t[i]; } cin >> m; for ( int i = 0; i < m, i++ ){ cin >> p[i] >> x[i]; } for( int i = 0; i < m; i++ ){ ...
a.cc: In function 'int main()': a.cc:14:30: error: expected ';' before ')' token 14 | for ( int i = 0; i < m, i++ ){ | ^~ | ;
s322844410
p03845
C++
#include <pch.h> #include <cstdio> #include <iostream> #include <vector> #include <algorithm> using namespace std; int A, B; char op; int N, M; int main(){ cin >> N; vector <int> T(N); for (int i = 0; i < N; i++) { cin >> T[i]; } cin >> M; vector <int> PX[100]; vector <int> P(N),X(N); //int P, X; for (...
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include <pch.h> | ^~~~~~~ compilation terminated.
s061848992
p03845
C++
#include <iostream> #include <numeric> using namespace std; int main() { int n, m; cin >> n; int t[n]; for (int i = 0; i < n; i++) { cin >> t[i]; } cin >> m; int p[m][m]; for (int i = 0; i < m; i++) { cin >> p[i][i]; } int sum = accumulate(t[0],t[n-1], 0); for (int i = 0; i < m; i++) { sum += ...
a.cc: In function 'int main()': a.cc:16:23: error: invalid types 'int[int]' for array subscript 16 | sum += p[i][1] - m[i]; | ^ a.cc:17:13: error: 'res' was not declared in this scope 17 | cout << res << endl; | ^~~ In file included from /usr/include/c++/14/nu...
s017413403
p03845
C++
#include<bits/stdc++.h> using namespace std, int main(){ int n;cin>>n; int sum=0; int t[n];for(int i=0;i<n;i++){ cin>>t[i]; sum+=t[i]; } int m;cin>>m; int p[m],x[m]; for(int i=0;i<m;i++)cin>>p[i]>>x[i]; int ans[m]; for(int i=0;i<m;i++){ cout<<sum-t[p[i]]+x[i]<<endl; } }
a.cc:2:20: error: expected ';' before ',' token 2 | using namespace std, | ^ | ; a.cc:2:20: error: expected unqualified-id before ',' token a.cc:3:1: error: expected unqualified-id before 'int' 3 | int main(){ | ^~~
s965613385
p03845
C++
#include<bots/stdc++.h> using namespace std, int main(){ int n;cin>>n; int sum=0; int t[n];for(int i=0;i<n;i++){ cin>>t[i]; sum+=t[i]; } int m;cin>>m; int p[m],x[m]; for(int i=0;i<m;i++)cin>>p[i]>>x[i]; int ans[m]; for(int i=0;i<m;i++){ cout<<sum-t[p[i]]+x[i]<<endl; } }
a.cc:1:9: fatal error: bots/stdc++.h: No such file or directory 1 | #include<bots/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s046266650
p03845
C++
#include<bit/stdc++.h> using namespace std; int main() { int N; cin >> N; int T[N]; for(int i=0;i<N;i++){ cin >> T[i]; } int M; cin >> M; int P[M], X[M]; for (int i = 0; i < M; i++) { cin >> P[i] >> X[i]; } int sum = 0; for(int i = 0; i < N; i++) { sum += T[i]; } for (int i = 0; i < M; i++) { int...
a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory 1 | #include<bit/stdc++.h> | ^~~~~~~~~~~~~~ compilation terminated.
s728598027
p03845
C++
Last login: Thu Oct 18 20:56:45 on console cd co asanomasakinoMacBook-Pro:~ asanomaki$ cd co -bash: cd: co: No such file or directory asanomasakinoMacBook-Pro:~ asanomaki$ cd atcoder/ asanomasakinoMacBook-Pro:atcoder asanomaki$ ls abc asanomasakinoMacBook-Pro:atcoder asanomaki$ cd abc/ asanomasakinoMacBook-Pro:abc as...
a.cc:1:1: error: 'Last' does not name a type 1 | Last login: Thu Oct 18 20:56:45 on console | ^~~~ a.cc:19:21: error: expected unqualified-id before '^' token 19 | ^ | ^ a.cc:22:17: error: expected unqualified-id before '^' token 22 | ^ ...
s572419716
p03845
C++
#include <bits/stdc++.h> using namespace std; int sum(vector<int> n){ int l = n.size(); int s = 0; for(int i = 0;i<l;i++){ s += n[i]; } return s; } int main() { int N; cin >> N; vector<int> t(N); for(int i=0;i<N;i++){ cin >> t[i]; } int M; cin >> M; for(int i=0;i<M;i++){ int p...
a.cc: In function 'int main()': a.cc:27:17: error: 's' was not declared in this scope 27 | cout << sum(s) << endl; | ^
s520271068
p03845
Java
import java.util.Scanner; public class Mani { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int mondaisuu = sc.nextInt(); int[]mondai = new int [mondaisuu]; for (int i = 0; i < mondaisuu;i ++){ mondai[i] = sc.nextInt(); } int nomimonosuu = sc.nextInt(); for(int i = 0; i...
Main.java:3: error: class Mani is public, should be declared in a file named Mani.java public class Mani { ^ 1 error
s203896075
p03845
C++
#include <iostream> #include <vector> int main() { int N; std::cin >> N; std::vector<int> T(N); for (int i = 0; i < N; ++i) { std::cin >> T[i]; } int M; std::cin << M; std::vector<int> P(M); std::vector<int> X(M); for (int i = 0; i < N; ++i) { std::cin >> P[i] >> X[i]; } for (int i = 0...
a.cc: In function 'int main()': a.cc:12:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | std::cin << M; | ~~~~~~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12...
s127350573
p03845
C++
#include <iostream> #include <vector> int main() { int N; std::cin >> N; std::vector<int> T(N); for (int i = 0; i < N; ++i) { std::cin >> T[i]; } int M; std::cin << M; std::vector<int> P(M); std::vector<int> X(M); for (int i = 0; i < N; ++i) { std::cin >> P[i] >> X[i]; } for (int i = 0...
a.cc: In function 'int main()': a.cc:12:12: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 12 | std::cin << M; | ~~~~~~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:12...
s046284789
p03845
C++
#include <bits/stdc++.h> using namespace std; int main(){ int i,N,array[101],M,array2[101],array3[101],array4[101]={},array5[101],j; cin>>N; for(i=0;i<N;i++){ cin>>array[i]; array5[i]=array[i]; } cin>>M; for(i=0;i<M;i++){ cin>>array2[i]>>array3[i]; } for(i=0;i<M;i++){ array[array2[i]-1]...
a.cc: In function 'int main()': a.cc:21:24: error: 'arrayarray' was not declared in this scope 21 | array[array2[i]-1]=arrayarray[array2[i]-1]; | ^~~~~~~~~~
s061147276
p03845
C
#include<stdio.h> #dfine MAX 100000 int main(void) { int i,j; int N,M; int res[M]={}; int T[MAX],P[N],X[MAX]; printf("N : "); scanf("%d",&N); printf("Time : \n"); for(i=0;i<N;i++){ scanf("%d",&T[i]); } printf("M : "); scacnf("%d",&M); printf("P_i , X_i :"); for(i=0;i<M;i++){ scanf...
main.c:2:2: error: invalid preprocessing directive #dfine; did you mean #define? 2 | #dfine MAX 100000 | ^~~~~ | define main.c: In function 'main': main.c:9:9: error: 'MAX' undeclared (first use in this function) 9 | int T[MAX],P[N],X[MAX]; | ^~~ main.c:9:9: note: each undeclared i...
s804968422
p03845
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; int for(int i=0;i<N;i++)cin>>PP[i]; int M; for(int y=0;y<M;y++)cin>>M[y]; for(int p=0;p<N;p++)cin>>pp[p]; y=p; int x; cin>>x; pp[p]=x; for(int g=0;g<N;g++){ int z; z=z+pp[g]; cout<<z<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:8:1: error: expected unqualified-id before 'for' 8 | for(int i=0;i<N;i++)cin>>PP[i]; | ^~~ a.cc:8:13: error: 'i' was not declared in this scope 8 | for(int i=0;i<N;i++)cin>>PP[i]; | ^ a.cc:10:27: error: invalid types 'int[int]' for array subscript ...
s322673605
p03845
C++
#include <bits/stdc++h> using namespace std; int main() { int n,m,a,b=0; cin>>n; int t[n]; for(int i=0;i<n;i++) cin>>t[i]; cin>>m; int p[m],x[m]; for(int i=0;i<m;i++) { cin>>p[i]; cin>>x[i];} for(int i=0;i<m;i++) { a=t[p[i]]; for(int j=0;j<n;j++){ b+=t[j]; ...
a.cc:1:10: fatal error: bits/stdc++h: No such file or directory 1 | #include <bits/stdc++h> | ^~~~~~~~~~~~~~ compilation terminated.
s998606421
p03845
C++
#include <iostream> #include <string> #include <algorithm> #include <cmath> using namespace std; int main(){ int n/*quiz*/; cin>>n; int c=0; int t[100]; for(int i=0;i<n;i++)cin>>t[i];c+=t[i]; int m/*drink*/; cin>>m; int p[100],x[100]; for(int i=0;i<m;i++)cin>>p[i]>>x[i]; for(int i=0;i<m;i++){ cout<<c-t[p[i]...
a.cc: In function 'int main()': a.cc:11:44: error: 'i' was not declared in this scope 11 | for(int i=0;i<n;i++)cin>>t[i];c+=t[i]; | ^
s339879813
p03845
C++
#include <bits/stdc++.h> #include <iostream> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <complex> #include <vector> #include <list> #include <set> #include <queue> #include <stack> #include <map> #include <string> #include <algorithm> #if __cplusplus >= 201103 #include <numeric> #...
a.cc: In function 'int main()': a.cc:34:26: error: no match for call to '(std::vector<int>) (int&)' 34 | sum += xs(j); | ~~^~~
s523967915
p03845
C
int n; int a[100]; scanf("%d", &n); for (int i = 0;i<n;i++) { scanf("%d", &a[i]); } int m; int p[100]; int x[100]; scanf("%d", &m); for (int i = 0;i<m;i++) { scanf("%d %d", &p[i], &x[i]); } int sum; for (int k = 0;k < m;k++) { sum = 0; for (int j = 0;j < n;j++) { sum += a[j]; } sum -= a[p[...
main.c:3:15: error: expected declaration specifiers or '...' before string constant 3 | scanf("%d", &n); | ^~~~ main.c:3:21: error: expected declaration specifiers or '...' before '&' token 3 | scanf("%d", &n); | ^ main.c:4:9: error: expected identif...
s408954224
p03845
C
#include<iostream> using namespace std; int main(){ cout<<"hello"; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s579493969
p03845
C
#include <stdio.h> #include<string.h> #define ll long long int main() { ll a[100010]; ll n , m ,p,q,i; scanf("%lld",&n); for ( i = 1; i <=n; i++) { scanf("%lld",&a[i]); } scanf("%lld",&m); for ( i = 1; i <=m; i++) { scanf("%lld%lld",&p,&q); ll temp=a[p]; a[...
main.c: In function 'main': main.c:26:5: error: expected declaration or statement at end of input 26 | } | ^
s702294186
p03845
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; int data[N]; for (int i=0;i<N;++i){ cin>>data[i]; } int M=0; cin>>M; int P[M]; int sum[M]; int P_time[M]; for (int i=0;i<M;++i){ cin>>P[i]; sum[i]=0; cin>>P_time[i]; } int a=sizeof(P_time)/sizeof(*P_time); for (int i=0;i<M;i++){ for (...
a.cc: In function 'int main()': a.cc:50:2: error: expected '}' at end of input 50 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s717991040
p03845
C++
int main() { int N, M, i, a,b,c; int ans = 0; int *T; cin >> N; T = new int[N]; for (i = 0; i < N; i++) cin >> T[i]; cin >> M; for (i = 0; i < M; i++) { cin >> a >> b; c = T[a - 1]; T[a - 1] = b; for (int n = 0; n < N; n++) ans += T[n]; cout << ans << endl; ans = 0; T[a - 1] = c; } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: 'cin' was not declared in this scope 5 | cin >> N; | ^~~ a.cc:14:17: error: 'cout' was not declared in this scope 14 | cout << ans << endl; | ^~~~ a.cc:14:32: error: 'endl' was not declared in this scope ...
s444605691
p03845
C++
#include <iostream> #include <array> using namespace std; int main() { int N; int M; cin >> N; std::array<int, 100> arrayT; for_each(arrayT.begin(), arrayT.end(), [](int x) { std::cin >> x; }); cin >> M; std::array<int, 100> arrayP; std::array<int, 100> arrayX; for...
a.cc: In function 'int main()': a.cc:13:5: error: 'for_each' was not declared in this scope 13 | for_each(arrayT.begin(), arrayT.end(), [](int x) { | ^~~~~~~~
s338550904
p03845
C++
#include <iostream> #include <array> using namespace std; int main() { int N; int M; cin >> N; std::array<int, 100> arrayT; std::for_each(arrayT.begin(), arrayT.end(), [](int x) { std::cin >> x; }); cin >> M; std::array<int, 100> arrayP; std::array<int, 100> arrayX; ...
a.cc: In function 'int main()': a.cc:13:10: error: 'for_each' is not a member of 'std' 13 | std::for_each(arrayT.begin(), arrayT.end(), [](int x) { | ^~~~~~~~
s734737385
p03845
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s576999235
p03845
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s175262546
p03845
C
#include <iostream> using namespace std; int main() { int n, tn[10^5], sumt=0, m, pm, xm ,result[10^5]; cin>>n; for (int i=0 ; i<n; i++){cin >>tn[i];sumt+=tn[i];} cin >>m; for (int i=0 ; i<m; i++){ cin>>pm >>xm; result [i]= sumt -tn[pm-1]+xm; } for (int i=0 ; i<m; i++)cout <<result[i]<<endl; return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s437753473
p03845
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nectInt(); int[] t = new int[N]; int sum = 0; for(int i = 0;i , n;i++){ t[i] = sc.nextInt(); sum += t[i]; } int[] p = new int[2*M]; for(int i = 0;i < 2*M;i += 2){ p[...
Main.java:8: error: ';' expected for(int i = 0;i , n;i++){ ^ Main.java:8: error: illegal start of expression for(int i = 0;i , n;i++){ ^ Main.java:8: error: not a statement for(int i = 0;i , n;i++){ ^ Main.java:8: error: ')' expected for(int i = 0;i , n;i++...
s959756285
p03845
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int [] t = new int[n]; for(int i = 0;i < n;i++)t[i] = sc.nextInt(); int m = sc.nextInt(); int[] sum = new int[m]; int[] p = new int[m]; int[] x = new int[m]; for(int i = 0;i < m;...
Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:5: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s725182519
p03845
Java
public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int [] t = new int[n]; for(int i = 0;i < n;i++)t[i] = sc.nextInt(); int m = sc.nextInt(); int[] sum = new int[m]; int[] p = new int[m]; int[] x = new int[m]; for(int i = 0;i < m;i+...
Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:4: error: cannot find symbol Scanner sc = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s400004116
p03845
C++
#include <cstdio> int a[110]; int b[110]; int main() { int n , m; scanf("%d",&n); for(int i = 1; i <= n; i++) { scanf("%d",&a[i]); b[i] = a[i]; } scanf("%d",&m); while(m--) { int k , b; scanf("%d %d",&k,&b); a[k] = b; int sum = 0; for(int i = 1; i...
a.cc: In function 'int main()': a.cc:23:41: error: invalid types 'int[int]' for array subscript 23 | a[k] = b[k]; | ^
s258173147
p03845
C++
#include<cstdio> #include<iostream> using namespace std; int time[105]; int num1[105]; int main() { int N,M,n,m,ans,sum=0; cin>>N; for(int i =1;i<=N;i++) { cin>>time[i]; sum+=time[i]; } cin>>M; for(int i =1;i<=M;i++) { cin>>m>>n; num1[i] = sum-time[i]+n; } for(int i =1;i<=M;i++) cout<<num1[...
a.cc:4:13: error: 'int time [105]' redeclared as different kind of entity 4 | int time[105]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr....
s563538328
p03845
C++
#include <iostream> using namespace std; int main(){ int N, i , j, ans=0; cin >> N; int T[N]; for(i=0; i<N; i++){ cin >> T[i]; } cin >> M; int P[M], X[M]; for(i=0; i<M; i++){ cin >> P[i] >> X[i]; } for(i=0; i<M; i++){ int temp = T[P[i]-1]; T[P[i]-1] = X[i]; for(j=0; j<N; j++){ ans += T[j]; } ...
a.cc: In function 'int main()': a.cc:11:16: error: 'M' was not declared in this scope 11 | cin >> M; | ^ a.cc:14:24: error: 'P' was not declared in this scope 14 | cin >> P[i] >> X[i]; | ^ a.cc:14:32: error: 'X' was not declared in this sco...
s830717944
p03845
C++
#include <iostream> using namespace std; int ans(int i, int N, int T[], int P[], int X[]){ int ans=0; T[P[i]-1]=X[i]; for(int j=0;j<N;i++) ans += T[j] return ans; } int main(){ int N, T[N], M, P[M], X[M], i; cin >> N; for(i=0;i<N;i++) cin >> T[i]; cin >> M; for(i=0;i<M;i++) cin >> P[i] >> X[i]; for(i=0;i...
a.cc: In function 'int ans(int, int, int*, int*, int*)': a.cc:7:41: error: expected ';' before 'return' 7 | for(int j=0;j<N;i++) ans += T[j] | ^ | ; 8 | return ans; | ~~~~~~ ...
s893856967
p03845
C++
#include <iostream> using namespace std; int N, T[N], M, P[M], X[M], i; int ans(i,N,T[],P[],X[]){ int ans=0; T[P[i]-1]=X[i]; for(int j=0;j<N;i++) ans += T[j] return ans; } int main(){ cin >> N; for(i=0;i<N;i++) cin >> T[i]; cin >> M; for(i=0;i<M;i++) cin >> P[i] >> X[i]; for(i=0;i<M;i++) cout << ans(i,N,T...
a.cc:4:10: error: size of array 'T' is not an integral constant-expression 4 | int N, T[N], M, P[M], X[M], i; | ^ a.cc:4:19: error: size of array 'P' is not an integral constant-expression 4 | int N, T[N], M, P[M], X[M], i; | ^ a.cc:4:25: error: size of array 'X' is not an...
s592320626
p03845
C++
#include <iostream> using namespace std; int ans(i,N,T[],P[],X[]){ int ans=0; T[P[i]-1]=X[i]; for(int j=0;j<N;i++) ans += T[j] return ans; } int main(){ int N, T[N], M, P[M], X[M], i; cin >> N; for(i=0;i<N;i++) cin >> T[i]; cin >> M; for(i=0;i<M;i++) cin >> P[i] >> X[i]; for(i=0;i<M;i++) cout << ans(i,N,...
a.cc:4:9: error: 'i' was not declared in this scope 4 | int ans(i,N,T[],P[],X[]){ | ^ a.cc:4:11: error: 'N' was not declared in this scope 4 | int ans(i,N,T[],P[],X[]){ | ^ a.cc:4:13: error: 'T' was not declared in this scope 4 | int ans(i,N,T[],P[],X[]){ | ^ ...
s987989694
p03845
C++
Select Code #include<bits/stdc++.h> #define LL long long using namespace std; int main() { LL n; cin>>n; LL a[n],i,j,k=0,l,m; for(i=0;i<n;i++) { cin>>a[i]; k+=a[i]; } cin>>m; LL x,y; for(i=0;i<m;i++) { cin>>x>>y; j=k-a[x-1]; j+=y; cout<<j<<endl; } return 0; }
a.cc:1:1: error: 'Select' does not name a type 1 | Select Code | ^~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, 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/incl...
s396055656
p03845
C++
#include<iostream> #include<vector> using namespace std; int main(){ int M,N,i; long long int P,X,sum[110],total; cin>>N; vector<int> T(N); for(i=0;i<N;i++){ cin>>T[i]; } total = accumulate(T.begin(),T.end(),0); cin>>M; for(i=0;i<M;i++){ cin>>P>>X; sum[i] = total -T[P-1] + X; } for(i=0;i<M;i++){ cout<<sum[i]<<endl; ...
a.cc: In function 'int main()': a.cc:12:9: error: 'accumulate' was not declared in this scope 12 | total = accumulate(T.begin(),T.end(),0); | ^~~~~~~~~~
s434831392
p03845
C++
#include<iostream> #include<numeric> using namespace std; int main(){ int M,N,i; long long int T[110],P,X,sum[110],total; cin>>N; for(i=0;i<N;i++){ cin>>T[i]; } total = accumulate(T.begin(),T.end(),0); cin>>M; for(i=0;i<M;i++){ cin>>P>>X; sum[i] = total -T[P-1] + X; } for(i=0;i<M;i++){ cout<<sum[i]<<endl; } return ...
a.cc: In function 'int main()': a.cc:11:23: error: request for member 'begin' in 'T', which is of non-class type 'long long int [110]' 11 | total = accumulate(T.begin(),T.end(),0); | ^~~~~ a.cc:11:33: error: request for member 'end' in 'T', which is of non-class type 'long long int [110]...
s732466914
p03845
C++
#include<iostream> using namespace std; int main(){ int M,N,i; long long int T[N],P,X,sum[M],total=0; cin>>N; for(i=0;i<N;i++){ cin>>T[i]; total += T[i]; } cin>>M; for(i=0;i<M;i++){ cin>>P>>X; ...
a.cc: In function 'int main()': a.cc:20:19: error: expected '}' at end of input 20 | return 0; | ^ a.cc:3:19: note: to match this '{' 3 | int main(){ | ^
s323137087
p03845
C++
#include<iostream> #include<cstdio> #include<cstdlib> #include<algorithm> #include<vector> #include<string> #include<sstream> #include<iomanip> #include<utility> #include<cmath> #include<set> #include<list> #include<queue> #include<stack> #include<deque> #include<map> #include<set> #include<cstring> #include<iterator> ...
a.cc: In function 'int main()': a.cc:70:38: error: 's' was not declared in this scope 70 | REP(i,n) {scanf("%d",&t[i]);sum+=s[i];} | ^ a.cc:75:23: error: 'sm' was not declared in this scope; did you mean 'sum'? 75 | printf("%d\n",sm+tmp-t[p]); | ...
s910333627
p03845
C++
#include <iostream> using namespace std; int main() { int n,m; cin>>n; int a[n]; for(int i=0;i<n;i++) cin>>a[i]; int s=0; for(int h=0;h<n;h++) s+=a[h]; int m; cin>>m; while(m--){ int f,g; cin>>f>>g; cout<<s-a[f-1]+g<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:9: error: redeclaration of 'int m' 12 | int m; | ^ a.cc:4:11: note: 'int m' previously declared here 4 | int n,m; | ^
s120296169
p03845
C++
#include<iostream> #include<vector> using namespace std; int main(){ int N, M, tmp=0,sum; cin >>N; vector<int> T(N); for(int i=0;i<N;i++){ cin >>T[i]; } cin >>M; vector<int> P(M), X(M); for(int i=0;i<M;i++){ cin >>P[i]; cin >>X[i]; } for(int i=0;...
a.cc: In function 'int main()': a.cc:34:22: error: 'temp' was not declared in this scope; did you mean 'tmp'? 34 | T[j]=temp; | ^~~~ | tmp
s048587204
p03845
C++
#include <iostream> using namespace std; #define PrintLn(X) cout << X << endl #define Rep(i, n) for(int i = 0; i < (int)(n); ++i) int T[100]; int P[100]; int X[100]; int main(void) { int N, M; cin >> N >> M; int ans = 0; Rep(i, N){ cin >> T[i]; ans += T[i]; } Rep(i, M){ int p, x; cin >> p >> x; p--; ...
a.cc: In function 'int main()': a.cc:23:32: error: invalid types 'int[int]' for array subscript 23 | PrintLn(ans + x[p] - T[p]); | ^ a.cc:4:28: note: in definition of macro 'PrintLn' 4 | #define PrintLn(X) cout << X << endl | ^...
s878692051
p03845
C++
int main(){ int N, M,sumT=0; int T[1000], P[1000], X[1000],ans[1000]; cin >> N; for (int i = 0; i < N; i++){ cin >> T[i]; sumT = sumT + T[i]; } cin >> M; for (int j = 0; j < M; j++){ cin >> P[j]>> X[j]; ans[j] = sumT - T[P[j] - 1] + X[j]; } for (int j = 0; j < M; j++){ cout << ans[j] << endl; } ret...
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> N; | ^~~ a.cc:15:17: error: 'cout' was not declared in this scope 15 | cout << ans[j] << endl; | ^~~~ a.cc:15:35: error: 'endl' was not declared in this sco...
s459187384
p03845
C++
5 7 2 3 8 5 3 4 2 1 7 4 13
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s580276372
p03845
C++
#include <iostream> #include <string> using namespace std; int main(){ int N,T[100],M,P[100],X[100]; int r; cin>>N; for(int i=0;i<N;i++){ cin>>T[i]; } cin>>M; for(int i=0;i<M;i++){ cin>>P[i]>>X[i]; } for(int i=0;i<M;i++){ r=r+T[i] } for(int i=0;i<M;i++){ cout<<r-T[ P[i]-1 ]+X[i]<...
a.cc: In function 'int main()': a.cc:18:33: error: expected ';' before '}' token 18 | r=r+T[i] | ^ | ; 19 | } | ~
s759738650
p03845
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #define NMAX 103 #define MMAX 103 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; tem...
a.cc: In function 'void answer()': a.cc:40:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 40 | cout << ans << "\n"; | ^~~ | abs
s473563072
p03845
C++
#include <cstdio> #include <iostream> #include <cstdlib> #include <algorithm> #include <vector> #include <cstring> #include <queue> #include <stack> #include <functional> #include <set> #include <map> #include <deque> #define NMAX 103 #define MMAX 103 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; templ...
a.cc:28:23: error: 'int P [103]' redeclared as different kind of entity 28 | int N,T[NMAX],M,P[MMAX],X[MMAX],sum = 0; | ^ a.cc:25:25: note: previous declaration 'typedef struct std::pair<int, int> P' 25 | typedef pair<int ,int > P; | ^ a.cc: In function 'v...
s494287200
p03845
Java
public static void main(String[] args) { int N = 6; int P = 3; int [] time = {1,4,10,2,6,3}; int [] drinktime = {4,2,5,4,3,9}; int sum = 0; for(int i = 0; i < N; i++){ sum = sum + time[i]; } for(P = 0; P < drinktime.length; P++){ sum = sum + drinktime[P] - time[P]; System.out.println(sum); } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s202954292
p03845
Java
import java.util.*; public Main { public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int[] t=new int[n]; for(int i=1;i<n;i++){ t[i]=sc.nextInt(); } int m=sc.nextInt(); int[] p=new int[m],x=new int[m]; for(int i=1;i<m;i++){ p[i]=sc.nextInt(); x[i]=sc....
Main.java:2: error: class, interface, enum, or record expected public Main { ^ Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) Main.java:25: error: class, interface,...
s489245762
p03845
Java
import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int [] t = new int [n]; int sumTime = 0; for (int i = 0 ; i < n ; i++) { t [i] = scanner.nextInt(); sumTime += t[i]; } int m = scanner.nextIn...
Main.java:15: error: cannot find symbol int p = scanner.Int() - 1; ^ symbol: method Int() location: variable scanner of type Scanner 1 error
s248127387
p03845
C++
package main import ( "fmt" ) func main() { var M, N int fmt.Scan(&N) var sum int t := make([]int, N) for i := 0; i < N; i++ { fmt.Scan(&t[i]) sum += t[i] } fmt.Scan(&M) for i := 0; i < M; i++ { var p, x int fmt.Scan(&p, &x) fmt.Println(sum + x - t[p-1]) } }
a.cc:1:1: error: 'package' does not name a type 1 | package main | ^~~~~~~
s888226989
p03845
C++
S#include <string> #include <queue> #include <stack> #include <vector> #include <sstream> #include <algorithm> #include <deque> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <list> #include <cstdio> #include <iostream> #include <cmath> #include <climits> #include <bitset> #inc...
a.cc:1:2: error: stray '#' in program 1 | S#include <string> | ^ a.cc:1:1: error: 'S' does not name a type 1 | S#include <string> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/deque:62, from /usr/include/c++/14/queue...
s477242624
p03845
C++
#include<iostream> using namespace std; int main(){ int N; int T[101]; int sum=0; cin>>N; for(int i=1;i<=N;i++){ cin>>T[i] sum+=T[i]; } int M; cin>>M; for(int i=0;i<M;i++){ int p,x; cin>>p>>x; cout<<sum-T[p]+x<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:10: error: expected ';' before 'sum' 10 | cin>>T[i] | ^ | ; 11 | sum+=T[i]; | ~~~
s992395374
p03845
C
#include<stdio.h> int main(void) { int temp,goukei[110] = { 0 },mondai, time[110], drink, siyou[110], siyoutime[110], i, n, t; scanf("%d", &mondai); for (i = 0; i < mondai; i++) { scanf("%d", &time[i]); } scanf("%d", &drink); for (i = 0; i < drink; i++) { scanf("%d%d", &siyou[i], &siyoutime[i]); siyou[i]-...
main.c: In function 'main': main.c:28:9: error: 'return0' undeclared (first use in this function) 28 | return0; | ^~~~~~~ main.c:28:9: note: each undeclared identifier is reported only once for each function it appears in
s374872194
p03845
C
#include <stdio.h> int main(){ int N,M; int T[N],P[M],X[M]; int sum; scanf("%d",&N); for(int i=0;i++;i<<N){ scanf("%d",*T[i]); sum=sum+T[i]; } scanf("%d",&M); for(int j=0;j++;j<<M){ scanf("%d%d",*P[j],*X[j]); printf("%d",sum+X[j]-T[P[j]]); } return 0; }
main.c: In function 'main': main.c:9:28: error: invalid type argument of unary '*' (have 'int') 9 | scanf("%d",*T[i]); | ^~~~~ main.c:14:30: error: invalid type argument of unary '*' (have 'int') 14 | scanf("%d%d",*P[j],*X[j]); | ...
s509994173
p03845
C++
#include <iostream> using namespace std; int main(){ int N = 0, temp = 0, result = 0, M = 0, P = 0, X = 0; cin >> N; int *T = new int[N]; for(int i = 0; i < N; i++){ cin >> T[i]; } cin >> M; for(int i = 0; i < M; i++){ cin >> P; cin >> X; temp = T[i]; T[P] = X; for(int i = 0;...
a.cc: In function 'int main()': a.cc:24:5: error: 'resutl' was not declared in this scope; did you mean 'result'? 24 | resutl = 0; | ^~~~~~ | result
s393675994
p03845
C++
#include <iostream> using namespace std; int main(){ int N = 0, temp = 0, result = 0; cin >> N; int *T = new int[N]; for(int i = 0; i < N; i++){ cin >> T[i]; } cin >> M; for(int i = 0; i < M; i++){ cin >> P; cin >> X; temp = T[i]; T[P] = X; for(int i = 0; i < N; i++){ re...
a.cc: In function 'int main()': a.cc:12:10: error: 'M' was not declared in this scope 12 | cin >> M; | ^ a.cc:14:12: error: 'P' was not declared in this scope 14 | cin >> P; | ^ a.cc:15:12: error: 'X' was not declared in this scope 15 | cin >> X; | ^ a...
s594515041
p03845
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; static const int R = 10000; int main(){ int n[R],t,m; int sum = 0; int k = 0; int number = 0; int sec = 0; cin >> t; for( int i = 0; i < n; i++) { cin >> n[i]; } cin >> m; for( int i = 0; i < m; i++) { cin >> number >> sec;...
a.cc: In function 'int main()': a.cc:14:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | for( int i = 0; i < n; i++) | ~~^~~
s974549500
p03845
C++
#include <iostream> #include<algorithm> #include<math.h> using namespace std; static const int R = 10000; int main(){ int n[R],t,m; int sum = 0; int k = 0; int number = 0; int sec = 0; cin >> t; for( int i = 0; i < n; i++) { cin >> n[i]; } cin >> m; for( int i = 0; i < m; i++) { cin >> number >> sec; ...
a.cc: In function 'int main()': a.cc:14:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | for( int i = 0; i < n; i++) { | ~~^~~ a.cc:27:10: error: expected '}' at end of input 27 | } | ^ a.cc:7:11: note: to match this...
s162761430
p03846
Java
import java.util.*; public class bz { public static void main(String[] args) { Scanner no=new Scanner(System.in); int n=no.nextInt(); int arr[]=new int[1000000]; int max=0; boolean t=true; for(int i=0;i<n;i++){ int r=no.nextInt(); if(r>n||(n%2==0&&r%2==0)||(n%2==1&&r%2==1)){ System.out.print...
Main.java:2: error: class bz is public, should be declared in a file named bz.java public class bz { ^ 1 error
s679575068
p03846
C++
#include<iostream> #include<algorithm> using namespace std; int N_MAX = 100000; int p=1000000007; typedef long long ll; int main() { int n,t,i; int c[N_MAX]; ll res=1; cin >> n; fill(c,c+n-1,0) for(i=0;i<n;i++){ cin >> t; if((n+t)%2!=1||(t==0&&c[t]>=1)||c[t]>=2){ cout << "0" << endl; ret...
a.cc: In function 'int main()': a.cc:13:18: error: expected ';' before 'for' 13 | fill(c,c+n-1,0) | ^ | ; 14 | for(i=0;i<n;i++){ | ~~~ a.cc:14:18: error: expected ';' before ')' token 14 | for(i=0;i<n;i++){ | ^ ...
s860468448
p03846
C++
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> #define ll long long ll MOD=1e9+7; ll a[100005]; using namespace std; int main(){ ll n; cin>>n; ll flag=1;//flag ll ans=1; if(n%2==0){ // even number for(ll i=0;i<n;i++){ ll x; cin>>x; a[x]++;//a[...
a.cc: In function 'int main()': a.cc:46:25: error: expected primary-expression before '/' token 46 | / / give data x error | ^ a.cc:46:27: error: expected primary-expression before '/' token 46 | / / give data x error | ...
s481575232
p03846
C++
#include <bits/stdc++.h> using namespace std; #define ll long long ll MOD=1e9+7; ll a[100005]; using namespace std; int main(){ ll n; cin>>n; ll flag=1;//flag ll ans=1; if(n%2==0){ // even number for(ll i=0;i<n;i++){ ll x; cin>>x; a[x]++;//a[7]++ / / give data x error if(x>=n || x...
a.cc: In function 'int main()': a.cc:23:25: error: expected primary-expression before '/' token 23 | / / give data x error | ^ a.cc:23:27: error: expected primary-expression before '/' token 23 | / / give data x error | ...
s477217846
p03846
C++
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> #define ll long long ll MOD=1e9+7; ll a[100005]; using namespace std; int main(){ ll n; cin>>n; ll flag=1;//flag ll ans=1; if(n%2==0){ // even number for(ll i=0;i<n;i++){ ll x; cin>>x; a[x]++;//a[7]...
a.cc: In function 'int main()': a.cc:26:25: error: expected primary-expression before '/' token 26 | / / give data x error | ^ a.cc:26:27: error: expected primary-expression before '/' token 26 | / / give data x error | ...
s814595985
p03846
C
#include <stdio.h> #include <math.h> int main(){ int n; scanf("%d", &n); int a[100000 + 5] = {0}, b, c; //aの要素を0。それとb、cを定義 for(int i = 0; i < n; i++){ scanf("%d", &b); a[b]++; } for(int i = n - 1; i >= 0; i -= 2){ if(i == 0){ if(a[i] != 1){ printf("0\n")...
main.c: In function 'main': main.c:25:37: error: expected ')' before ';' token 25 | printf("%d\n", c%((1000000000+7)); | ~ ^ | ) main.c:26:13: error: expected ';' before '}' token 26 | return 0; | ^ | ...
s738404973
p03846
Java
import java.util.*; import java.math.BigInteger; import java.text.DecimalFormat; // warm-up public class LiningUp { static Set<Integer> a = new HashSet<Integer>(); static Set<Integer> b = new HashSet<Integer>(); static void solve() { Scanner sc = new Scanner(System.in); double mod = 1000000007; int n=sc.next...
Main.java:5: error: class LiningUp is public, should be declared in a file named LiningUp.java public class LiningUp { ^ 1 error
s611002699
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main (){ int N; cin >> N; int arr[N]; for (int i = 0; i < N; i ++){ cin >> arr[i]; } void combine(int arr[], int len, int start, int end){ int tempLen = end - start + 1; int arr3[tempLen]; int mid = (start + end) / 2; int po...
a.cc: In function 'int main()': a.cc:15:55: error: a function-definition is not allowed here before '{' token 15 | void combine(int arr[], int len, int start, int end){ | ^ a.cc:100:2: error: expected '}' at end of input 100 | } | ^ a.cc:5:12: no...
s116920831
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main (){ cout << pow(2, N/2) << '\n'; }
a.cc: In function 'int main()': a.cc:6:18: error: 'N' was not declared in this scope 6 | cout << pow(2, N/2) << '\n'; | ^
s243071944
p03846
C++
#include<bits/stdc++.h> using namespace std; #define Bye return 0 void solve(){ int n, res = 1; cin>>n; int a[n+1]; memset(a, 0, sizeof a); bool no_solution = false; for (int i=1; i<=n; i++){ int e; cin>>e; a[e]++;} int counter = (n%2^0) ? (n-1)/2 : n/2; for (int i=1; i<=counter; i...
a.cc: In function 'void solve()': a.cc:15:50: error: 'MAX' was not declared in this scope 15 | for (int i=1; i<=counter; i++) res = (res*2)%MAX; | ^~~
s887632608
p03846
C++
#include<bits/stdc++.h> using namespace std; #define Bye return 0 #define ll long long const int MAX = 1e9+7; const int SIZE = 1e5+1; void solve(){ int n; cin>>n; int a[n+1]; memset(a, 0, sizeof a); bool no_solution = false; for (int i=1; i<=n; i++){ int e; cin>>e; a[e]++; ...
a.cc: In function 'void solve()': a.cc:26:42: error: expected ';' before ')' token 26 | cout<<(a[0]>=2 && a[n-1]<=1) ? 0: res)<<endl; | ^ | ;
s055419734
p03846
C
#include<bits/stdc++.h> #define ll long long using namespace std; bool sortbysec(const pair<int,int> &a, const pair<int,int> &b) { return (a.second < b.second&&a.first<b.first); } void solve(){ int n,val; cin>>n; map<int,int>mp; for(int i=0;i<n;i++){ cin>>val; if(mp.fi...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s196883527
p03846
C++
#include<iostream> #include<algorithm> #include<vector> #include<numeric> #include<string> #include<cmath> #include<map> #include<set> using namespace std; //c++で整数処理 //mod計算用のクラス // ModInt a = {1,1000000007}みたいな定義もできる. //modがデフォルト(1000000007)じゃない場合は(ModInt)a+(int)xみたいなものに注意.左のmodが使われる。デフォルトを書き換えれば大丈夫. //「各メンバーに対して、コピ...
/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
s088341716
p03846
C++
#include <iostream> #include <vector> #include <set> #include <math.h> using namespace std; int main() { __int64 n,a,k,p,m = 1000000007; bool haveZero = false; vector<long> arr; cin >> n; while (n--) { cin >> a; if (a == 0 && haveZero) { cout << 0; return 0; } if (a == 0) hav...
a.cc: In function 'int main()': a.cc:7:3: error: '__int64' was not declared in this scope; did you mean '__ynf64'? 7 | __int64 n,a,k,p,m = 1000000007; | ^~~~~~~ | __ynf64 a.cc:10:10: error: 'n' was not declared in this scope; did you mean 'yn'? 10 | cin >> n; | ^ | ...
s038509374
p03846
C++
#include<iostream> using namespace std; int main() { }#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<string> vs; typedef vector<pi> vpi; typedef vector<vi> vii; typedef map<int, int> mp; typedef multiset<int> mset; typedef long int int32; typedef unsigne...
a.cc:5:2: error: stray '#' in program 5 | }#include<bits/stdc++.h> | ^ a.cc:5:3: error: 'include' does not name a type 5 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:8:9: error: 'vector' does not name a type 8 | typedef vector<int> vi; | ^~~~~~ a.cc:9:9: error: 'vector' does not na...
s490906228
p03846
C++
#include<iostream> using namespace std; int main() { }#include<bits/stdc++.h> using namespace std; typedef pair<int, int> pi; typedef vector<int> vi; typedef vector<string> vs; typedef vector<pi> vpi; typedef vector<vi> vii; typedef map<int, int> mp; typedef multiset<int> mset; typedef long int int32; typedef unsigne...
a.cc:5:2: error: stray '#' in program 5 | }#include<bits/stdc++.h> | ^ a.cc:5:3: error: 'include' does not name a type 5 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:8:9: error: 'vector' does not name a type 8 | typedef vector<int> vi; | ^~~~~~ a.cc:9:9: error: 'vector' does not na...
s023371723
p03846
C++
#include <bits/stdc++.h> #define arep(a,i,n) for(ll i=(a);i<(n);i++) #define rep(i,n) for(ll i=0;i<(n);i++) #define cinf(x,n) for(ll i=0;i<(n);i++)cin>>x[i]; #define coutf(x,n) for(ll i=0;i<(n);i++)cout<<x[i]<<endl; typedef long long ll; typedef unsigned long long ull; typedef long double ld; using namespace std; ll ...
a.cc: In function 'll fact(ll)': a.cc:20:27: error: 'mod' was not declared in this scope; did you mean 'modf'? 20 | tmp*=(num%mod); | ^~~ | modf a.cc:24:20: error: 'mod' was not declared in this scope; did you mean 'modf'? 24 | ...
s168464706
p03846
C++
#include<iostream> #include<map> #include<math.h> using namespace std; int main(){ int N; map<int, int> cnt; cin >> N; int require = 1; if (N & 1 == 1) require--; for (int i=0; i<N; i++){ int A; cin >> A; if (A%2 != require){ cout << 0 << endl; return 0; ...
a.cc: In function 'int main()': a.cc:33:15: error: no match for 'operator!=' (operand types are 'std::pair<const int, int>' and 'int') 33 | if (x != 2){ | ~ ^~ ~ | | | | | int | std::pair<const int, int> In file included from /usr/...
s372493750
p03846
C++
#include<bits/stdc++.h> using namespace std; #define debug(n) cerr << #n << ':' << n << endl; #define dline cerr << __LINE__ << endl; using ll = long long; using ull = unsigned long long; template<class T, class U> using P = pair<T,U>; template<class T> using Heap = priority_queue<T>; template<class T> using hea...
a.cc: In function 'int main()': a.cc:129:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 129 | cout << 0 << end; | ~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/istream:41, from /usr/include...
s276721710
p03846
C++
#include <bits/stdc++.h> #include <string> #include <algorithm> using namespace std; //std::の省略のため using ll = long long; const int MOD = 1000000007; int main() { ll n; cin >> n; ll a[n]; ll cnt[n] = {}; bool judge = true; for(int i=0; i<n; i++) cin >> a[i]; if(n%2 == 0){ ...
a.cc: In function 'int main()': a.cc:51:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const int' to binary 'operator%' 51 | cout << pow(2, n/2)%MOD << endl; | ~~~~~~~~~~~^~~~ | | | | ...
s362170733
p03846
C++
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> A(n); for (int i = 0; i < n; i++) { cin >> A.at(i); } map<int, int> cnt; for (int x : A) { if (cnt.count(x)) { cnt.at(x)++; } else { cnt[x] = 1; } } bool ans = true; ...
a.cc: In function 'int main()': a.cc:27:32: error: expected primary-expression before '!=' token 27 | if(x == 0 && cnt.at(x) > != 0){ | ^~
s787248843
p03846
C++
#include <bits/stdc++.h> using namespace std; #define pb push_back #define in insert #define PI 3.1415926535897932384626433832795 #define MOD = 1e9 + 7; #define F first #define S second #define aLL(str) (str).begin(), (str).end() #define IOS \ ios::sync_with_stdio(0); \ cin.tie(0); ...
a.cc: In function 'int main()': a.cc:6:13: error: expected primary-expression before '=' token 6 | #define MOD = 1e9 + 7; | ^ a.cc:86:25: note: in expansion of macro 'MOD' 86 | f=(f*2)%MOD; | ^~~
s517069967
p03846
C++
//题意:n个人编号1-n站成一排,每个人左边的人数和右边的人数的差的绝对值为Ai,求可能的站的方案数的个数;n范围1e5 //方案数要取模1e9+7,没有这样的方案就输出0 //思路: 看了一下样例,感觉找到了规律啊。如果n是奇数的话,那么一定有一个0(也就是站在中间),2,2,4,4...,(n-1); //满足的话方案数为(n-1) //如果n是偶数的话,那么一定有1,1,3,3,5,5,n-1,n-1,满足的话方案数为2*n ;不满足以上条件则为0; #include <iostream> #include <cmath> using namespace std; const int mod=1e9+7; typede...
a.cc: In function 'int main()': a.cc:47:38: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const int' to binary 'operator%' 47 | else cout<<pow(2,n/2)%mod; | ~~~~~~~~~~^~~~ | | | ...
s974734437
p03846
C++
//题意:n个人编号1-n站成一排,每个人左边的人数和右边的人数的差的绝对值为Ai,求可能的站的方案数的个数;n范围1e5 //方案数要取模1e9+7,没有这样的方案就输出0 //思路: 看了一下样例,感觉找到了规律啊。如果n是奇数的话,那么一定有一个0(也就是站在中间),2,2,4,4...,(n-1); //满足的话方案数为(n-1) //如果n是偶数的话,那么一定有1,1,3,3,5,5,n-1,n-1,满足的话方案数为2*n ;不满足以上条件则为0; #include <iostream> using namespace std; const int mod=1e9+7; typedef long long LL; c...
a.cc: In function 'int main()': a.cc:46:28: error: 'pow' was not declared in this scope 46 | else cout<<pow(2,n/2)%mod; | ^~~
s708002744
p03846
C++
#include <iostream> #include <algorithm> #include <cstring> #include <string> #include <cmath> #define ll long long ll MOD=1e9+7; ll a[100005]; using namespace std; int main(){ ll n; cin>>n; ll flag=1;//flag ll ans=1; if(n%2==0){ // even number for(ll i=0;i<n;i++){ ll x; cin>>x; a[x]++;//a[7]...
a.cc: In function 'int main()': a.cc:26:25: error: expected primary-expression before '/' token 26 | / / give data x error | ^ a.cc:26:27: error: expected primary-expression before '/' token 26 | / / give data x error | ...
s481511114
p03846
C
import java.util.*; import java.io.*; public class Main{ // taking inputs static BufferedReader s1; static BufferedWriter out; static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;} static int int_v (String s1){return Integer.parseInt(s1);} static lon...
main.c:1:1: error: unknown type name 'import' 1 | import java.util.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.*; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.io.*; | ^~~~~~ main.c:2:...
s324828701
p03846
C++
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<string> #include<cmath> #include<vector> #define lowbit(x) ((x)&(-x)) #define sc scanf #define debug1(x) cout<<x<<" " #define debug2(x) cout<<x<<"\n" #define MAX(a,b) ((a)>(b)?(a):(b)) #define MIN(a,b) ((a)<(b)?(a):(b)) typedef long long...
a.cc:65:23: error: extended character “ is not valid in an identifier 65 | cout<<“0”<<"\n"; | ^ a.cc:65:23: error: extended character ” is not valid in an identifier a.cc: In function 'int main()': a.cc:65:23: error: '\U0000201c0\U0000201d' was not declared in this scope ...