submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s217141074
p03674
C++
#include <iostream> #include <fstream> #include <cstdio> #include <cassert> #include <complex> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <sstream> #include <ctime> #include <cctype> #include <set> #inclu...
a.cc:37:1: error: extended character   is not valid in an identifier 37 |   | ^ a.cc:61:1: error: extended character   is not valid in an identifier 61 |   | ^ a.cc:37:1: error: '\U000000a0' does not name a type 37 |   | ^
s702892496
p03674
C++
#include <iostream> #include <fstream> #include <cstdio> #include <cassert> #include <complex> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <sstream> #include <ctime> #include <cctype> #include <set> #inclu...
a.cc:37:1: error: extended character   is not valid in an identifier 37 |   | ^ a.cc:61:1: error: extended character   is not valid in an identifier 61 |   | ^ a.cc:37:1: error: '\U000000a0' does not name a type 37 |   | ^
s524355593
p03674
C++
#include <iostream> #include <fstream> #include <cstdio> #include <cassert> #include <complex> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <cstdlib> #include <cstring> #include <iomanip> #include <numeric> #include <sstream> #include <ctime> #include <cctype> #include <set> #inclu...
a.cc:37:1: error: extended character   is not valid in an identifier 37 |   | ^ a.cc:61:1: error: extended character   is not valid in an identifier 61 |   | ^ a.cc:37:1: error: '\U000000a0' does not name a type 37 |   | ^
s970757609
p03674
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> #include<map> using namespace std; typedef long long LL; class Combination { public: Combination(LL sz, LL m) : size(sz+1), mod(m), param(size, 1) { for(LL i=2; i<size; i++) { param[i] = param[i-1] * i; param[i] %= mod; } }...
a.cc: In function 'int main()': a.cc:77:36: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, const int&)' 77 | left = find(a.begin(), a.end(), it->first) - a.begin(); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
s887018027
p03674
C++
#include <iostream> #include <cstring> #include <algorithm> #define MOD 1000000007 using namespace std; typedef __int128 ll; ll *FACT, *IFACT; ll extgcd(ll a, ll b, ll &x, ll &y) { ll g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } ll invMod(ll a, ll m) { ll x, y; if (ex...
a.cc: In function 'int main()': a.cc:46:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'll' {aka '__int128'}) 46 | cin >> n; | ~~~ ^~ ~ | | | | | ll {aka __int128} | std::istream {ak...
s695399975
p03674
C++
#include <iostream> #include <cstring> #include <algorithm> #define MOD 1000000007 using namespace std; typedef __int128 ll; ll *FACT, *IFACT; ll extgcd(ll a, ll b, ll &x, ll &y) { ll g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } ll invMod(ll a, ll m) { ll x, y; if (ex...
a.cc: In function 'int main()': a.cc:46:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'll' {aka '__int128'}) 46 | cin >> n; | ~~~ ^~ ~ | | | | | ll {aka __int128} | std::istream {ak...
s813546219
p03674
C++
#include <iostream> #include <cstring> #include <algorithm> #define MOD 1000000007 using namespace std; typedef _int128 ll; ll *FACT, *IFACT; ll extgcd(ll a, ll b, ll &x, ll &y) { ll g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } ll invMod(ll a, ll m) { ll x, y; if (ext...
a.cc:6:9: error: '_int128' does not name a type; did you mean '__int128'? 6 | typedef _int128 ll; | ^~~~~~~ | __int128 a.cc:8:1: error: 'll' does not name a type 8 | ll *FACT, *IFACT; | ^~ a.cc:9:1: error: 'll' does not name a type 9 | ll extgcd(ll a, ll b, ll &x, ll &y) { ...
s513785786
p03674
C++
#include <iostream> #include <cstring> #include <algorithm> #define MOD 1000000007 using namespace std; typedef long long int ll; ll *FACT, *IFACT; ll extgcd(ll a, ll b, ll &x, ll &y) { ll g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; } ll invMod(ll a, ll m) { ll x, y; i...
a.cc:37:1: error: '::main' must return 'int' 37 | ll main() | ^~
s968631906
p03674
C++
def comb(n,k): if k == 0: return 1 if n < k: return 0 ret = 1 for i in xrange(k): ret *= n-i for i in xrange(1,k+1): ret /= i return ret % 1000000007 n = int(raw_input()) a = map(int,raw_input().split()) b = sorted(a) t = -1 for i in xrange(len(b)-1): if b[i] == b[i+1]: t = b[i] L ...
a.cc:54:7: error: invalid preprocessing directive #print 54 | # print i,K-i," ",lc[i],rc[K-i],lc[i] * rc[K-i] | ^~~~~ a.cc:1:1: error: 'def' does not name a type 1 | def comb(n,k): | ^~~ a.cc:38:1: error: 'rc' does not name a type 38 | rc = {} | ^~ a.cc:39:1: error: expected unqual...
s861375841
p03674
Java
import java.util.Scanner; import java.util.Arrays; public class Main { private static final long MOD = 1_000_000_000 + 7; // 反復二乗法を用いる public static long myPow(long a) { long ans = 1L; long x = a; long b = 1_000_000_000 + 5L; for(int i = 0; i < 64; i++) { if((b & (1L << i)) != 0L) { ans = (ans * x)...
Main.java:31: error: cannot find symbol new Main().run(); ^ symbol: method run() location: class Main Main.java:66: error: method nck in class Main cannot be applied to given types; long comb1 = nck(n + 1, k, fact); ^ required: int,int,long[],long[] found: int,int,long[] ...
s726571120
p03674
Java
import java.util.Scanner; import java.util.Arrays; public class Main { private static final long MOD = 1_000_000_000 + 7; // 反復二乗法を用いる public static long myPow(long a) { long ans = 1L; long x = a; long b = (1_000_000_000 + 5)L; for(int i = 0; i < 32; i++) { if((b & (1L << i)) != 0L) { ans = (ans * ...
Main.java:11: error: ';' expected long b = (1_000_000_000 + 5)L; ^ 1 error
s968910380
p03674
C++
#include <iostream> #include <sstream> #include <stdio.h> #include <stdlib.h> #include <string> #include <vector> #include <map> #include <queue> #include <stack> #include <algorithm> #include <utility> #include <functional> #include <cmath> #define REP(i,x,y) for(int i=(int)(x);i<(int)(y);i++) #define RREP(i,x,y) for...
a.cc:26:18: error: declaration does not declare anything [-fpermissive] 26 | typedef int long long; | ^~~~
s654104601
p03674
C++
#include<iostream> #include<cstdio> using namespace std; #define p 1000000007 int N,d1,d2; //cmb(n,k)の実装nCk%p int fact(int x){ if(x==0) return 1; if(x>0) return x*fact(x-1); }; int cmb(int x,int r){ if(x<r) return 0; if(x==r) return 1; if(r==0 && x!=0) return 1; if(r>x/2) r=x-r; return (...
a.cc: In function 'long long int ans(int)': a.cc:26:12: error: 'n' was not declared in this scope 26 | if(n-d2+1>=k)rt-=cmb(N-d2,k-1); | ^ a.cc: In function 'int fact(int)': a.cc:12:1: warning: control reaches end of non-void function [-Wreturn-type] 12 | }; | ^
s059192245
p03674
C++
#include<iostream> #include<cstdio> using namespace std; #define p 1000000007 int N,d1,d2; //cmb(n,k)の実装nCk%p int fact(int n){ if(x==0) {return 1;} if(x>0) {return n*fact(n-1);} }; int cmb(int x,int r){ if(x==r) return 1; if (r==0 && x!=0) return 1; else return (x*fact(x-1))/fact(x-1)*fact(x-r);...
a.cc: In function 'int fact(int)': a.cc:10:8: error: 'x' was not declared in this scope 10 | if(x==0) {return 1;} | ^ a.cc:11:8: error: 'x' was not declared in this scope 11 | if(x>0) {return n*fact(n-1);} | ^ a.cc:12:1: warning: control reaches end of non-void function [-Wreturn...
s953830646
p03674
C++
#include<iostream> #include<cstdio> using namespace std; #define p 1000000007 int N,d1,d2; //cmb(n,k)の実装nCk%p int fact(int x){ if(x==0) {return 1;} if(x>0) {return x*fact(n-1);} }; int cmb(int x,int r){ if(x==r) return 1; if (r==0 && x!=0) return 1; else return (x*fact(x-1))/fact(x-1)*fact(x-r);...
a.cc: In function 'int fact(int)': a.cc:11:28: error: 'n' was not declared in this scope 11 | if(x>0) {return x*fact(n-1);} | ^
s723645039
p03674
C++
#include<iostream> #include<cstdio> using namespace std; #define p 1000000007 int N,d1,d2; //cmb(n,k)の実装nCk%p int fact(int x){ if(x==0) return 1; if (x>0) return x*fact(n-1); }; int cmb(int x,int r){ if(x==r) return 1; if (r==0 && x!=0) return 1; else return (x*fact(x-1))/fact(x-1)*fact(x-r); };...
a.cc: In function 'int fact(int)': a.cc:11:28: error: 'n' was not declared in this scope 11 | if (x>0) return x*fact(n-1); | ^
s045002747
p03674
C
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define NUM 100010 #define TEISUU 1000000007 unsigned long long expo(unsigned long long x, unsigned long long n) { unsigned long long res = 1; while (n) { if (n & 1ULL) { res = (res * x) % TEISUU; } x = (x * x) % TEISUU...
main.c: In function 'main': main.c:78:7: error: 'combination' undeclared (first use in this function); did you mean 'combinarion'? 78 | combination[i] = combination[n + 1 - i]; | ^~~~~~~~~~~ | combinarion main.c:78:7: note: each undeclared identifier is reported only once for each funct...
s488732897
p03674
C++
n = int(input()) a = list(map(int, input().split())) M = 10**9 + 7 def calc_index(a): t = sorted(a) for i, x in enumerate(t[1:]): if t[i] == x: break result = [] for i, v in enumerate(a): if v == x: result.append(i) return result f, e = calc_index(a) out = n...
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s748136643
p03674
C++
n = int(input()) a = list(map(int, input().split())) M = 10**9 + 7 def calc_index(a): t = sorted(a) for i, x in enumerate(t[1:]): if t[i] == x: break result = [] for i, v in enumerate(a): if v == x: result.append(i) return result f, e = calc_index(a) out = n...
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s228561981
p03674
C
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define NUM 100010 #define TEISUU 1000000007 unsigned long long expo(unsigned long long x, unsigned long long n){ unsigned long long res = 1; while (n){ if (n & 1ULL){ res = (res * x) % TEISUU; } x...
main.c: In function 'main': main.c:84:39: error: too few arguments to function 'calc_combi' 84 | answer = calc_combi(n + 1, i) - calc_combi(n + 1 - between); | ^~~~~~~~~~ main.c:22:20: note: declared here 22 | unsigned long long calc_combi(int n, int r) { | ...
s004535764
p03674
C++
#include <bits/stdc++.h>> using namespace std; typedef long long ll; const int N = 1e5 + 2, MOD = 1e9 + 7; ll fpm(ll x, ll n) { ll y = 1; for (; n; (x *= x) %= MOD, n >>= 1) if (n & 1) (y *= x) %= MOD; return y; } ll fac[N], ifac[N]; int pos[N]; inline ll C(int n, int k) { if (k > n) return 0; return fa...
a.cc:1:25: warning: extra tokens at end of #include directive 1 | #include <bits/stdc++.h>> | ^ a.cc: In function 'int main()': a.cc:35:14: error: 'i' was not declared in this scope 35 | per (i, n, 1) ifac[i-1] = ifac[i] * i % MOD; | ^ a.cc:35:9: error: 'p...
s516149623
p03674
Java
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] a = new int[n + 1]; boolean[] hasOne = new boolean[n + 1]; boolean[] hasTwo = new boolean[n + 1]; for(int i = 0; i < n + 1; i++){ a[i] = sc.nextInt(); h...
Main.java:39: error: incompatible types: long[] cannot be converted to long[][] long[] comb[] = new long[n + 2]; ^ Main.java:40: error: incompatible types: int cannot be converted to long[] comb[0] = 1; ^ Main.java:55: error: incompatible types: int cannot be converted to long[] com...
s179982079
p03674
C
#include <ctype.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #define MOD 1000000007 #define ll long long long long expo(long long x, long long n){ long long res = 1; while (n){ if (n & 1LL) res = (res * x) % MOD; x = (x * x) % MOD; n >>= 1LL; } ...
main.c: In function 'lol': main.c:22:19: error: 'fact' undeclared (first use in this function) 22 | long long x = fact[n]; | ^~~~ main.c:22:19: note: each undeclared identifier is reported only once for each function it appears in
s052984337
p03674
C++
//#pragma GCC optimize "O3" #include <algorithm> #include <iostream> #include <map> #include <queue> #include <set> #include <vector> using namespace std; #define LL 1000000007 void calc(vector<vector<long long int> > &v) { for (int i = 0; i < v.size(); i++) { v[i][0] = 1; v[i][i] = 1; } for (int k = 1...
a.cc: In function 'int main()': a.cc:63:39: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<' 63 | cout << (comb(n + 1, i + 1) % LL << endl; | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ a.cc:63:46: error: expected ')' before ';' token ...
s870582618
p03674
Java
import com.sun.xml.internal.fastinfoset.util.CharArray; import java.util.*; /** * Created by DELL on 2017/7/1. */ public class Main { static long fac(int x,int num){ long a=1; for (int i = 0; i <num ; i++) { a*=x-i; a/=(i+1); if(a>1e9+7) a-=1e...
Main.java:1: error: package com.sun.xml.internal.fastinfoset.util does not exist import com.sun.xml.internal.fastinfoset.util.CharArray; ^ 1 error
s192399587
p03674
C++
#include <bits/stdc++.h> using namespace std; int count1[100001]={0}; // Utility function to split the string using a delim. Refer - // http://stackoverflow.com/questions/236129/split-a-string-in-c vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; ...
a.cc: In function 'int printPowerSet(int*, int)': a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type] 53 | } | ^ a.cc: In function 'int main()': a.cc:66:33: error: 'mod' was not declared in this scope; did you mean 'modf'? 66 | cout<<count1[i]%mod<<endl; ...
s601789582
p03674
C++
#include <bits/stdc++.h> using namespace std; int count1[100001]={0}; // Utility function to split the string using a delim. Refer - // http://stackoverflow.com/questions/236129/split-a-string-in-c vector<string> split(const string &s, char delim) { vector<string> elems; stringstream ss(s); string item; ...
a.cc: In function 'int printPowerSet(int*, int)': a.cc:53:1: warning: no return statement in function returning non-void [-Wreturn-type] 53 | } | ^ a.cc: In function 'int main()': a.cc:61:9: error: 'i' was not declared in this scope 61 | for(i=0;i<n;i++) | ^ a.cc:64:13: error: 'i' was not ...
s071298331
p03675
C++
N = int(input()) A = list(map(int, input().split())) A.reverse() B = [] C = [] for i, a in enumerate(A): if i%2==0: B.append(a) else: C.append(a) print(*(B+list(reversed(C))))
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s119392724
p03675
Java
import java.io.*; import java.util.ArrayList; import java.util.Collections; import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; public class Main{ public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList<...
Main.java:5: error: package org.graalvm.compiler.nodes.calc does not exist import org.graalvm.compiler.nodes.calc.IntegerDivRemNode; ^ 1 error
s890263704
p03675
C++
#include <bits/stdc++.h> #include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <deque> #include <functional> #include <iostream> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <tuple> #include <utility> #include <vector> #define pi 3.141592653589...
a.cc: In function 'int main()': a.cc:26:4: error: expected '}' at end of input 26 | } | ^ a.cc:20:12: note: to match this '{' 20 | int main() { | ^
s194239694
p03675
C++
#inlcude<bits/stdc++.h> using namespace std; int main(){ long long int n; cin>>n; long long int a[n+1]; for(long long int i=1;i<=n;i++)cin>>a[i]; if(n%2){ for(long long int j=n;j>=1;j=j-2)cout<<a[j]<<" "; for(long long int j=2;j<=n-1;j=j+2)cout<<a[j]<<" "; } else{ for(long long int j=n;j...
a.cc:1:2: error: invalid preprocessing directive #inlcude; did you mean #include? 1 | #inlcude<bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope 5 | cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iost...
s212663823
p03675
C++
#include <iostream> // cout, endl, cin #include <string> // string, to_string, stoi #include <vector> // vector #include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound #include <utility> // pair, make_pair #include <tuple> // tuple, make_tuple #include <cstdint> // int64_t, int*_t #include <cstd...
a.cc: In function 'int main()': a.cc:34:14: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>') 34 | cout << a << endl; | ~~~~ ^~ ~ | | | | | std::vector<int> | std::ost...
s146085901
p03675
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; using Graph = vector<vector<int>>; int main() { ll n; cin>>n; ll a[n]={}; ll b[n]={}; deque<ll> d; ll aa; for(ll i=0; i<n; i++){ cin>>a[i];} ll counter=1000000; for(ll i=0; i<n; i++){ if(i%2==0){ d.push_back(a[i]);} else d.push_front(a[i]);} while(!=d....
a.cc: In function 'int main()': a.cc:21:7: error: expected primary-expression before '!=' token 21 | while(!=d.empty()){ | ^~
s362895980
p03675
C++
#include<bits/stdc++.h> #include <iostream> #include <string> 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;i>=0;i--) #define all(v)(v).begin(),(v).end() #define...
a.cc: In function 'int main()': a.cc:60:21: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} and 'const char [2]' to binary 'operator<<' 60 | rep(i,n) COUT(a[i]<<" "); a.cc:16:24: note: in definition of macro 'COUT' 16 |...
s107928362
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int a[]=new int[n]; StringBuilder ans = new StringBuilder(); String for(int i=0;i<n;i++){ a[i] = sc.nextInt(); } for(int j = n-1;j<0;j-...
Main.java:9: error: not a statement String ^ Main.java:9: error: ';' expected String ^ 2 errors
s367058046
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int a[]=new int[n]; StringBuilder ans = new StringBuilder(); String for(int i=0;i<n;i++){ a[i] = sc.nextInt(); } for(int j = n-1;j<0;j-...
Main.java:9: error: not a statement String ^ Main.java:9: error: ';' expected String ^ 2 errors
s479080953
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int a[]=new int[n]; for(int i=0;i<n;i++){ a[i] = sc.nextInt(); } for(int j = n-1;j<0;2*j--){ System.out.print(a[j]); } for(int k ...
Main.java:12: error: not a statement for(int j = n-1;j<0;2*j--){ ^ Main.java:15: error: not a statement for(int k = n-2;k<0;2*k--){ ^ 2 errors
s430660388
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); List<Integer> a = new ArrayList<Integer>(); for(int i=0;i<n;i++){ if(n % 2 == 0){ if(i % 2 == 0){ a.add(0,sc.nextInt()); }els...
Main.java:25: error: no suitable method found for join(String,List<Integer>) System.out.println(String.join("",a)); ^ method String.join(CharSequence,CharSequence...) is not applicable (varargs mismatch; List<Integer> cannot be converted to CharSequence) method String.join...
s336534146
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); List<String> a = new ArrayList<String>(); for(int i=0;i<n;i++){ if(n % 2 == 0){ if(i % 2 == 0){ a.add(0,sc.next()); }else{ ...
Main.java:25: error: empty character literal System.out.println(String.join('',a)); ^ Main.java:25: error: not a statement System.out.println(String.join('',a)); ^ Main.java:25: error: ';' expected System.out.println(String.join('',a))...
s364038411
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); List<Integer> a = new ArrayList<Integer>(); for(int i=0;i<n;i++){ if(n % 2 == 0){ if(i % 2 == 0){ a.add(0,sc.nextInt()); }els...
Main.java:25: error: empty character literal System.out.println(String.join('',a)); ^ Main.java:25: error: not a statement System.out.println(String.join('',a)); ^ Main.java:25: error: ';' expected System.out.println(String.join('',a))...
s526965327
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); List<Integer> a = new ArrayList<Integer>(); for(int i=0;i<n;i++){ if(n % 2 == 0){ if(i % 2 == 0){ a.add(0,sc.nextInt()); }els...
Main.java:25: error: incompatible types: List<Integer> cannot be converted to CharSequence System.out.println(String.join(a)); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s558935162
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int a[]=new a[n]; int b[]=new b[n]; for(int i=0;i<n;i++){ a[i] = sc.nextInt(); for(int j=0;j<=i;j++){ b[i-j] = a[j]; } } ...
Main.java:7: error: cannot find symbol int a[]=new a[n]; ^ symbol: class a location: class Main Main.java:8: error: cannot find symbol int b[]=new b[n]; ^ symbol: class b location: class Main 2 errors
s257687748
p03675
C++
#include <iostream> #include <vector> #include <algorithm> #include <bits/stdc++.h> using namespace std; long long int a,b,c[200010],d[100010],ans =1,ant=1; int main(){ cin >> a ; for(int i=0;i<a;i++) cin >> c[i]; for(int i=1;i<=a;i++){ reverse(c,c+i); } for(int i=0;i<a;i++) cout...
a.cc: In function 'int main()': a.cc:23:25: error: expected primary-expression before ';' token 23 | cout << c[i] << " " <<; | ^
s234673024
p03675
Java
import java.util.*; import java.lang.*; public class Main{ public static void main(String[] args){ FastScanner sc = new FastScanner(System.in); int N = sc.nextInt(); long[] ans = new long[N+1]; int b = N/2+1; int c = N/2+2; int d = N/2; if( N%2!=0 ){ for( int i=1; i<=N; i++ ){ if( i%2!=0 ){ ...
Main.java:5: error: cannot find symbol FastScanner sc = new FastScanner(System.in); ^ symbol: class FastScanner location: class Main Main.java:5: error: cannot find symbol FastScanner sc = new FastScanner(System.in); ^ symbol: class FastScanner location: class Main 2 errors
s460815707
p03675
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;++i) #define rep1(i,n) for(int i=1;i<=n;++i) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; //桁 int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } int...
a.cc: In function 'int main()': a.cc:69:11: error: 'class std::stack<long long int>' has no member named 'front' 69 | cout<<d.front(); | ^~~~~ a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'? 73 | cout<<c.top(); | ^~~ | ...
s116522970
p03675
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;++i) #define rep1(i,n) for(int i=1;i<=n;++i) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; //桁 int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } int...
a.cc: In function 'int main()': a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'? 73 | cout<<c.top(); | ^~~ | pop
s897850027
p03675
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;++i) #define rep1(i,n) for(int i=1;i<=n;++i) #define all(a) a.begin(),a.end() #define P pair<long long,long long> #define double long double using namespace std; //桁 int kt(int a){ double b=a; b=log10(b); int c=b; return c+1; } int...
a.cc: In function 'int main()': a.cc:73:11: error: 'class std::queue<long long int>' has no member named 'top'; did you mean 'pop'? 73 | cout<<c.top(); | ^~~ | pop a.cc: At global scope: a.cc:78:1: error: expected declaration before '}' token 78 | } | ^
s984033935
p03675
C++
#include <bits/stdc++.h> using namespace std; ...
a.cc: In function 'int main()': a.cc:36:12: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 36 | signed main() | ^~ a.cc:36:12: note: remove parentheses to default-initialize a variable 36 | signed main() | ^~ | -- a.cc:36...
s213214568
p03675
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; const int N=200005; const int MOD=1e9+7; int n; int a[N]; int b[N]; int main() { cin>>n; for(int i=1;i<=n;i++) { scanf("%d",&a[i]); } int m=n; int j=1; for(int i=n;i>=2;i-=2) { b[j]=a[i]; b[n-j+1]=a[i-1]; j++; ...
a.cc: In function 'int main()': a.cc:25:7: error: 'i' was not declared in this scope 25 | if(i&1) | ^
s848854588
p03675
C++
#include<iostream> #include<algorithm> using namespace std; const int S=(1<<20)+5; char buf[S],*H,*T; inline char Get() { if(H==T) T=(H=buf)+fread(buf,1,S,stdin); if(H==T) return -1; return *H++; } inline int read() { int x=0; char c=Get(); while(!isdigit(c)) c=Get(); while(isdigit(c)) x=x*10+c-'0',c=Get(); ...
a.cc:31:1: error: 'vector' does not name a type 31 | vector<Seg> R[1000000]; | ^~~~~~ a.cc: In function 'int main()': a.cc:45:25: error: 'R' was not declared in this scope 45 | R[a[i+1]].push_back(seg[tot]); | ^ a.cc:51:25: error: 'R' was not declared in...
s721941411
p03675
C++
#include<iostream> #include<vector> #include<string> using namespace std; int main(){ int n; int a[200005]; cin>>n; for(int i=0;i<n;i++){ cin>>a[i]; } vector<int> b; for(int i=0;i<n;i++){ b.push_back(a[i]); reverse(b.begin(),b.end()); } for(int i=0;i<n-1;i++){ cout<<b[i]<<" "; } co...
a.cc: In function 'int main()': a.cc:15:5: error: 'reverse' was not declared in this scope 15 | reverse(b.begin(),b.end()); | ^~~~~~~
s131553755
p03675
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a[200000],ans[200000]; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=n-1;i>=0;i--){ if((n-i)%2)ans[(n-i)/2)]=a[i]; else ans[n-((n-i)/2)]=a[i]; } for(int i=0;i<n;i++){ if(i!=n-1)cout<<ans[i]<<" "; e...
a.cc: In function 'int main()': a.cc:8:31: error: expected ']' before ')' token 8 | if((n-i)%2)ans[(n-i)/2)]=a[i]; | ^ | ] a.cc:8:31: error: expected ';' before ')' token 8 | if((n-i)%2)ans[(n-i)/2)]=a[i]; | ...
s791227414
p03675
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,a[200000],ans[200000]; cin>>n; for(int i=0;i<n;i++)cin>>a[i]; for(int i=n-1;i>=0;i++){ if((n-i)%2)ans[(n-i)/2)]=a[i]; else ans[n-((n-i)/2)]=a[i]; } for(int i=0;i<n;i++){ if(i!=n-1)cout<<ans[i]<<" "; e...
a.cc: In function 'int main()': a.cc:8:31: error: expected ']' before ')' token 8 | if((n-i)%2)ans[(n-i)/2)]=a[i]; | ^ | ] a.cc:8:31: error: expected ';' before ')' token 8 | if((n-i)%2)ans[(n-i)/2)]=a[i]; | ...
s871504176
p03675
C++
#include <bits/stdc++.h> using namespace std; const int maxn=1e5+7; int a[maxn]; int b[maxn<<1]; int c[maxn<<1]; int main() { // freopen("in.txt","r",stdin); int n,m; long long sum=0; scanf("%d%d",&n,&m); for(int i=1; i<=n; ++i) scanf("%d",&a[i]); for(int i=2; i<=n; ++i) { if(a[i]...
a.cc: In function 'int main()': a.cc:38:26: error: expression cannot be used as a function 38 | ma=max(ma,1LL(x*c[x]-b[x])); | ~~~^~~~~~~~~~~~~
s904262065
p03675
C
#include<bits/stdc++.h> using namespace std; const int maxn = 2e5+7; int a[maxn],ans[maxn]; int n; int main() { scanf("%d",&n); for(int i=1;i<=n;i++){ scanf("%d",&a[i]); } int l=1,r=n,k=n,cnt=1; for(int i=n;i>=1;i--){ if(cnt&1) ans[l++]=a[k--]; else ans[r--]=a[...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s202010357
p03675
C++
#include <bits/stdc++.h> using namespace std; int b[1000000001]; int main() { int i, a, n; cin >> n; int mid = (n - 1) / 2; for(i=0; i<n; i++) { cin >> a; //if(i % 2 == 0) b[mid-(i+1)/2] = a; else b[mid+(i+1)/2] = a; } if(n % 2 == 0) for(i=n-1; i>=0; i--) { ...
a.cc: In function 'int main()': a.cc:14:9: error: 'else' without a previous 'if' 14 | else b[mid+(i+1)/2] = a; | ^~~~
s628137347
p03675
Java
import java.util.*; class Main{ public static void main(String[] args){   Scanner sc = new Scanner(System.in); Deque<Integer> q = new ArrayDeque<Integer>(); int n = sc.nextInt(); int a[] = new int[n]; for(int i = 0;i <...
Main.java:5: error: illegal character: '\u00a0' ? ^ 1 error
s439439174
p03675
Java
improt java.util.*; class Main{ public static void main(String[] args){   Scanner sc = new Scanner(System.in); Deque<Integer> q = new ArrayDeque<Integer>(); int n = sc.nextInt(); int a[] = new int[n]; for(int i = 0;i <...
Main.java:1: error: class, interface, enum, or record expected improt java.util.*; ^ Main.java:5: error: illegal character: '\u00a0' ? ^ 2 errors
s018839635
p03675
Java
class Main{ public static void main(String[] args){   Scanner sc = new Scanner(System.in); Deque<Integer> q = new ArrayDeque<Integer>(); int n = sc.nextInt(); int a[] = new int[n]; for(int i = 0;i < n;i++){ a[...
Main.java:3: error: illegal character: '\u00a0' ? ^ 1 error
s868681026
p03675
C++
//#include "IntMod.h" //typedef IntMod<1000000007> MInt; //#include "Union_Find.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <utility> #include <algorithm> #include <functional> #include <cmath> #include <stack> #include <queue> #include <...
a.cc:56:1: error: 'list' does not name a type 56 | list<int> L; | ^~~~ a.cc: In function 'int main()': a.cc:63:25: error: 'L' was not declared in this scope 63 | L.push_back(a); | ^ a.cc:65:25: error: 'L' was not declared in this scope 65 | ...
s021345106
p03675
C++
include<bits/stdc++.h> using namespace std; int main(){ vector <int> a; vector <int> b; int N; cin>>N; for(int i=0;i<N;i++){ int aa; cin>>aa; a.push_back(aa); } for(int i=0;i<N;i++){ b.push_back(a[i...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:6:9: error: 'vector' was not declared in this scope 6 | vector <int> a; | ^~~~~~ a.cc:6:17: error: expected primary-expression before 'int' 6 | vector...
s483348833
p03675
C++
#include <iostream> #include <algorithm> #include <cstring> #include <cstdio> #include <vector> #include <cstdlib> #include <iomanip> #include <cmath> #include <ctime> #include <map> #include <set> #include <queue> #include <stack> using namespace std; #define lowbit(x) (x&(-x)) #define max(x,y) (x>y?x:y) #define min(x...
a.cc: In function 'int main()': a.cc:35:16: error: 'n' was not declared in this scope 35 | while(cin>>n){ | ^
s920852152
p03675
C++
#include <iostream> #include <vector> using namespace std; int main() { int n; cin>>n; vector<int> vec(n); for(int i=0;i<n;i++) { cin>>vec[i]; reverse(vec.begin(),vec.end()); } for(int i=0;i<n;i++) cout<<vec[i]<<" "; return 0; }
a.cc: In function 'int main()': a.cc:12:1: error: 'reverse' was not declared in this scope 12 | reverse(vec.begin(),vec.end()); | ^~~~~~~
s891402309
p03675
C++
#include<iostream> #include<string> #include<vector> #include<sstream> using namespace std; int main() { int n; cin >> n; vector<int> b; int btmp; for (int i = 0; i < n; i++) { cin >> btmp; b.push_back(btmp); reverse(b.begin(), b.end()); } auto itr = b.begin(); while (itr != b.end()) { string s = (itr ...
a.cc: In function 'int main()': a.cc:15:17: error: 'reverse' was not declared in this scope 15 | reverse(b.begin(), b.end()); | ^~~~~~~
s621160414
p03675
C++
import java.io.*; import java.lang.reflect.Array; import java.math.*; import java.security.KeyStore.Entry; import java.util.*; public class Main { private InputStream is; private PrintWriter out; int time = 0, dp[][], DP[][], dist[], prime[], start[], parent[], end[], val[], black[], arr[], arr1[][]; long MOD ...
a.cc:107:17: error: stray '@' in program 107 | @Override | ^ a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import jav...
s094944950
p03675
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class ContestMain { public static void main( String... args ) throws Exception { BufferedReader in = new BufferedReader( new InputStreamReader( System.in ) ); String input = ...
Main.java:6: error: class ContestMain is public, should be declared in a file named ContestMain.java public class ContestMain { ^ 1 error
s360595079
p03675
C++
#include <stdio.h> #include <stdint.h> uint32_t a[200000]; uint32_t e[200000]; int main(int argc, char **argv) { int n; scanf("%d\n", &n); for (int i = 0; i < n; i++) { scanf("%d ", &a[i]); } const int c = 200000 / 2; int f; if (n % 2) { // odd for (int i = 0; i < n; i++) { int j = ((i +...
a.cc: In function 'int main(int, char**)': a.cc:38:12: error: expected '}' at end of input 38 | return 0; | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s997042054
p03675
Java
import java.util.*; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); // 回数 int N = sc.nextInt(); //元になる数列を格納 ArrayList list = new ArrayList(); ArrayList b = new ArrayList(); while (sc.hasNextLine()) { list.add(Integer.parseInt(sc.next()) + " "); ...
Main.java:38: error: incompatible types: unexpected return value return 0; ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s685060564
p03675
C++
#include <iostream.h> using namespace std; void SortIn(int *b,int a,int i) { int *tmp; tmp = (int *)malloc(sizeof(int)*(i+1)); b[i]=a; for(int j=0; j<=i; j++) { tmp[j]=b[j]; } for(int j=i; j>=0; j--) { b[i-j]=tmp[j]; } free(tmp); } int main() { int n; cin>>n; int a; int* b; b=(int *)malloc(sizeof...
a.cc:1:10: fatal error: iostream.h: No such file or directory 1 | #include <iostream.h> | ^~~~~~~~~~~~ compilation terminated.
s004826446
p03675
C++
#include <iostream> #include <deque> using namespace std; int main() { int n; cin >> n; deque<int> d; bool isReversed = false; for (int i = 0; i < n; i++) { int value; cin >> value; if (isReversed) { d.push_front(value); } else { d.push_ba...
a.cc: In function 'int main()': a.cc:27:9: error: 'reverse' was not declared in this scope; did you mean 'isReversed'? 27 | reverse(d.begin(), d.end()); | ^~~~~~~ | isReversed
s884753539
p03675
C++
#include <iostream> #include <deque> #include <queue> #include <vector> #include <algorithm> using namespace std; int main() { bool flag = true; int n; cin >> n; vector<int> nums(n), res; deque<int> que; for (int i = 0; i < n; i++) cin >> nums[i]; for (int i = 0; i < n; i++) { if (flag) qu...
a.cc: In function 'int main()': a.cc:21:21: error: 'reserve' was not declared in this scope 21 | if (n % 2 == 1) reserve(res.begin(), res.end()); | ^~~~~~~
s795898690
p03675
C
#include <stdio.h> #include <stdlib.h> #define N 200000 int main(void){ int a[N]; int i, n; scanf("%d", &n); for(i=0; i<n; i++){ scanf("%d", &a[i]); } for(i=n-1; i>=0; i=i-2){ printf("%d ", b[i]); } for(i=n-2; i>=0; i=i-2){ printf("%d ", b[i]); } printf("\n"); return 0; }
main.c: In function 'main': main.c:16:31: error: 'b' undeclared (first use in this function) 16 | printf("%d ", b[i]); | ^ main.c:16:31: note: each undeclared identifier is reported only once for each function it appears in
s902651962
p03675
Java
import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.util.Stack; class AtCoder { public static void main(String[] args) { Scanner s = new Scanner(System.in); Queue<Long> queue = new LinkedList(); Stack<Long> stack = new Stack(); long ...
Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
s611431046
p03675
Java
import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; import java.util.Stack; public class AtCoder { public static void main(String[] args) { Scanner s = new Scanner(System.in); Queue<Long> queue = new LinkedList(); Stack<Long> stack = new Stack(); ...
Main.java:6: error: class AtCoder is public, should be declared in a file named AtCoder.java public class AtCoder { ^ Note: Main.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 1 error
s923056626
p03675
C++
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main { public static void main(String[] args) { Main main = new Main(); main.solve(args); } public void solve(String[] args) { MyScanner scanner = new MyScanner(); int N = scanner.nextInt(); ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: ...
s107078619
p03675
C++
n = int(input()) a = list(map(int, input().split())) occur = [0 for i in range(n + 1)] MOD = 1000000007 for i in range(n + 1): if occur[a[i]] > 0: val = n - 1 - i + occur[a[i]] else: occur[a[i]] = i + 1 inv = [0 if i > 2 else 1 for i in range(n + 2)] pinv = [0 if i > 2 else 1 for i in range(n + 2)] perm = [0 if...
a.cc:1:1: error: 'n' does not name a type 1 | n = int(input()) | ^
s901742624
p03675
Java
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); Deque<Integer> dq = new LinkedList<>(); boolean flag = false; for (int i = 0; i < n; i++){ if (!flag){ ...
Main.java:23: error: cannot find symbol System.out.print(dq.get(i) + " "); ^ symbol: method get(int) location: variable dq of type Deque<Integer> 1 error
s252873303
p03675
Java
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); Deque<Integer> dq = new Deque<Integer>(); boolean flag = false; for (int i = 0; i < n; i++){ if (!flag){ ...
Main.java:9: error: Deque is abstract; cannot be instantiated Deque<Integer> dq = new Deque<Integer>(); ^ Main.java:23: error: cannot find symbol system.out.print(dq.get(i) + " "); ^ symbol: method get(int) location: variable dq of typ...
s414548837
p03675
Java
import java.util.*; import java.io.*; public class Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); Deque<Integer> dq = new Deque<Integer>(); boolean flag = false; for (int i = 0; i < n; i++){ if (!flag){ ...
Main.java:22: error: not a statement for (int i = begin; i += inc; i >= 0 && i <= n - 1){ ^ 1 error
s378074729
p03675
Java
import java.util.*; import java.io.*; public class void Main{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); Deque<Integer> dq = new Deque<Integer>(); boolean flag = false; for (int i = 0; i < n; i++){ if (!fla...
Main.java:4: error: <identifier> expected public class void Main{ ^ Main.java:19: error: not a statement int begin = flag ? n - 1 ; 0; ^ Main.java:22: error: not a statement for (int i = begin; i += inc; i >= 0 && i <= n - 1){ ...
s789746671
p03675
C++
#include <stdio.h> int main() { int n, a[200001], i; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &a[i]); printf("%d", a[n-1]); for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]); if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]); else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i...
a.cc: In function 'int main()': a.cc:13:56: error: expected ';' before '}' token 13 | else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i]) | ^ | ; 14 | } | ~ ...
s564169580
p03675
C++
#include <stdio.h> #include<iostream> int main() { int n, a[200001], i; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &a[i]); printf("%d", a[n-1]); for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]); if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]); else for(i = 0; i <= n-2; i+=2...
a.cc: In function 'int main()': a.cc:14:56: error: expected ';' at end of input 14 | else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i]) | ^ | ; a.cc:14:56: error: expected '}' at end of inpu...
s746746583
p03675
C++
#include <stdio.h> int main() { int n, a[200001], i; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &a[i]); printf("%d", a[n-1]); for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]); if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]); else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i...
a.cc: In function 'int main()': a.cc:13:56: error: expected ';' at end of input 13 | else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i]) | ^ | ; a.cc:13:56: error: expected '}' at end of inpu...
s715656304
p03675
C
#include <stdio.h> int main() { int n, a[200001], i; scanf("%d", &n); for(i = 0; i < n; i++) scanf("%d", &a[i]); printf("%d", a[n-1]); for(i = n-3; i >= 0; i-=2) printf(" %d", a[i]); if(n&1) for (i = 1; i <= n-2; i+=2) printf(" %d", a[i]); else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i...
main.c: In function 'main': main.c:13:56: error: expected ';' at end of input 13 | else for(i = 0; i <= n-2; i+=2) printf(" %d", a[i]) | ^ | ; main.c:13:5: error: expected declaration or stat...
s791525814
p03675
Java
import java.io.*; import java.util.*; public class a_0701 { public static void main(String[] args) { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); List<Integer> b = new ArrayList<>(); int n=0; try { n = Integer.parseInt(br.readLine()); String str = br.readLine(); String...
Main.java:4: error: class a_0701 is public, should be declared in a file named a_0701.java public class a_0701 ^ 1 error
s510666313
p03675
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); Deque<Integer> dq = new Deque<Integer>(); for(int i = 1; i <= n; i++) { int a = sc.nextInt(); if((n - i) % 2 == 0) { dq.addFirst(a); } ...
Main.java:7: error: Deque is abstract; cannot be instantiated Deque<Integer> dq = new Deque<Integer>(); ^ 1 error
s849486764
p03675
C++
read = lambda: map(int, input().split()) n = int(input()) a = list(read()) from collections import deque b = deque() x = 1 for i in range(n): if x: b.append(a[i]) else: b.appendleft(a[i]) x ^= 1 ans = list(b) if not x: ans = ans[::-1] print(*ans)
a.cc:1:1: error: 'read' does not name a type 1 | read = lambda: map(int, input().split()) | ^~~~
s071703420
p03675
C++
include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #include<vector> #include<queue> using namespace std; int main(void){ int a[200000]; int c, d; int k; int n, m; int s, t; int x, y, z; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%d", &a[i]); } for (k=n-1; k >=0; k=k-2)p...
a.cc:1:1: error: 'include' does not name a type 1 | include<cstdio> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:4: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s871159160
p03675
C++
#include<iostream> #include<vector> using namespace std; int main(){ vector <long long> d; int n; long long a; cin >> n; for(int i = 0;i < n;i++){ cin >> a; d.push_back(a); } if(d.size()%2 == 0){ for(int i = d.size() - 1;i >= 1; i = i - 2){ cout << d[i] << " "; } for(int...
a.cc: In function 'int main()': a.cc:37:6: error: expected '}' at end of input 37 | } | ^ a.cc:26:22: note: to match this '{' 26 | if(d.size()%2 == 1){ | ^ a.cc:37:6: error: expected '}' at end of input 37 | } | ^ a.cc:6:11: note: to match this '{' ...
s974162835
p03675
C++
#include <iostream> #include <vector> #include <string> using namespace std; int main(){ int n; int num; vector<int> a; vector<int> b; cin >> n; for(int i = 0; i < n; i++){ cin >> num; a.push_back(num); } for(int i = 0; i < n; i++){ b.push_back(a[i]); reverse(b.begin(), b.end()); ...
a.cc: In function 'int main()': a.cc:22:5: error: 'reverse' was not declared in this scope 22 | reverse(b.begin(), b.end()); | ^~~~~~~
s912670681
p03675
C++
import java.io.PrintWriter; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int N = sc.nextInt(); LinkedList<Integer> q = new LinkedList<>(); for(int i=0; i<N; i++) if((N-i)%2==1) q...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.PrintWriter; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.util.*; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' ...
s382119544
p03675
C++
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.OutputStream; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmod...
s141586746
p03675
C++
#ifdef __APPLE__ #include "bits:stdc++.h" #else #include <bits\stdc++.h> #endif #define SZ(X) ((int)(X).size()) #define ALL(X) (X).begin(), (X).end() #define REP(I, N) for (LL I = 0; I < (N); ++I) #define REPP(I, A, B) for (LL I = (A); I < (B); ++I) #define RI(X) scanf("%lld", &(X)) #define RII(X, Y) scanf("%lld%lld",...
a.cc:4:10: fatal error: bits\stdc++.h: No such file or directory 4 | #include <bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s527916749
p03676
Java
// copied #include <bits/stdc++.h> using namespace std; typedef long long LL; typedef double DB; typedef unsigned int UI; typedef pair<int, int> PII; const int inf = 0x7f7f7f7f; #define rdi() read<int>() #define rdl() read<LL>() #define rds(a) scanf("%s", a) #define mk(i, j) make_pair(i, j) #define pb push_back #de...
Main.java:2: error: illegal character: '#' #include <bits/stdc++.h> ^ Main.java:2: error: class, interface, enum, or record expected #include <bits/stdc++.h> ^ Main.java:6: error: class, interface, enum, or record expected typedef long long LL; ^ Main.java:7: error: class, interface, enum, or record expected t...
s490764138
p03676
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> P; typedef pair<ll, ll> Pll; #define debug(var) do{std::cout << #var << " : ";view(var);}while(0) template<typename T> void view(T e){std::cout << e << std::endl;} template<typename T> void view(const std:...
a.cc: In function 'int main()': a.cc:78:14: error: lvalue required as left operand of assignment 78 | (ans + MOD) %= MOD; | ~~~~~^~~~~~
s300787039
p03676
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> P; typedef pair<ll, ll> Pll; #define debug(var) do{std::cout << #var << " : ";view(var);}while(0) template<typename T> void view(T e){std::cout << e << std::endl;} template<typename T> void view(const std:...
a.cc: In function 'int main()': a.cc:78:14: error: lvalue required as left operand of assignment 78 | (ans + MOD) %= MOD; | ~~~~~^~~~~~
s320062902
p03676
C++
/* * Welcome to my code! *---------------------------------------------* * author : lynmisakura(twitter : @andoreiji11) */ #include <iostream> #include <limits.h> #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include ...
a.cc: In function 'int main()': a.cc:139:18: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] 139 | if(k == 1)ans--; | ~~~^~
s791112488
p03676
C++
/* * Welcome to my code! *---------------------------------------------* * author : lynmisakura(twitter : @andoreiji11) */ #include <iostream> #include <limits.h> #include <algorithm> #include <bitset> #include <cctype> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include ...
a.cc: In function 'int main()': a.cc:139:18: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] 139 | if(k == 1)ans--; | ~~~^~
s523173817
p03676
C++
#include <bits/stdc++.h> using namespace std; #define fi first #define endl "\n" #define se second #define ls( s) (s&(-s)) #define ll long long #define inf 0x3f3f3f3f #define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const ll N = 103000; #define rep(i, begin, end) for (__typeof(end) i = (begin) - ((b...
a.cc: In function 'int main()': a.cc:65:2: error: expected ';' before numeric constant 65 | 1 1 cout<<r<<endl; | ^~ | ;
s142149875
p03676
C++
You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence. For each integer k=1,…,n+1, find the number of the different subsequences (not necessarily contiguous) of the given sequence with l...
a.cc:1:56: error: extended character … is not valid in an identifier 1 | You are given an integer sequence of length n+1, a1,a2,…,an+1, which consists of the n integers 1,…,n. It is known that each of the n integers 1,…,n appears at least once in this sequence. | ...