submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s033573375 | p03665 | C++ |
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <math.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 998244353;/... | a.cc: In function 'void exec()':
a.cc:56:23: error: 'tp_pow' was not declared in this scope
56 | ans = tp_pow<LLONG>(2, N - 1);
| ^~~~~~
a.cc:56:35: error: expected primary-expression before '>' token
56 | ans = tp_pow<LLONG>(2, N - 1);
| ... |
s902760725 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
... | a.cc: In function 'int main()':
a.cc:31:4: error: 't' was not declared in this scope
31 | if(t==0){
| ^
|
s174932802 | p03665 | C++ | #include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <que... | a.cc: In function 'int main()':
a.cc:72:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
72 | ans = 1;
| ^~~
| abs
|
s777466534 | p03665 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
typedef long long ll;
ll mypow(ll x, ll n){
if(n == 0)
return 1;
if(n % 2 == 0)
return mypow(x * x, n / 2);
else
return x * mypow(x, n - 1);
}
//参考http://izumi-math.jp/I_Yanagita... | a.cc: In function 'int main()':
a.cc:24:8: error: 'a' was not declared in this scope
24 | if(a % 2 != 0)odd_number_count++;
| ^
|
s011475849 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif
class Combination {
private:
const int64_t mod = 1e16;
vector<vector<int64_t>> comb;
void init(int64_t max_size) {
comb.assign(max_size, vector... | a.cc:66:2: error: stray '#' in program
66 | }#include <bits/stdc++.h>
| ^
a.cc:66:3: error: 'include' does not name a type
66 | }#include <bits/stdc++.h>
| ^~~~~~~
a.cc:74:7: error: redefinition of 'class Combination'
74 | class Combination {
| ^~~~~~~~~~~
a.cc:9:7: note: previous de... |
s748067526 | p03665 | C++ | #include <iostream>
#define ll long long
using namespace std;
int n, p, value[105];
ll memo[55][5005];
ll calculate(int i, ll sum){
if(memo[i][sum]!=-1)return memo[i][sum];
if(i>n){
if(sum%2== p)return 1;
else return 0;
}
ll t = calculate(i+1, sum+value[i]);
ll nt = calculate(i+1, su... | a.cc: In function 'int main()':
a.cc:18:5: error: 'memset' was not declared in this scope
18 | memset(memo, -1, sizeof(memo));
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstrin... |
s172358586 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,p; cin>>n>>p;
int m =0;
for(int i=0;i<n;i++){
int a; cin>>a;
if(a %2 == p) ++m;
}
if(m == 0)
cout<< ( (p == 0? (1LL<<n):0) <<endl;
else
cout<<(1LL<<(n-1)) <<endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:16:35: error: invalid operands of types 'long long int' and '<unresolved overloaded function type>' to binary 'operator<<'
16 | cout<< ( (p == 0? (1LL<<n):0) <<endl;
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~
a.cc:16:41: error: expected ')' before ';' token
16 | ... |
s846753124 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,p; cin>>n>>p;
int m =0;
for(int i=0;i<n;i++){
int a; cin>>a;
if(a %2 == p) ++m;
}
if(m == 0)
cout<< (p == 0)?(1LL<<N):0) <<endl;
else
cout<<(1LL<<(N-1)) <<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:16:27: error: 'N' was not declared in this scope
16 | cout<< (p == 0)?(1LL<<N):0) <<endl;
| ^
a.cc:18:18: error: 'N' was not declared in this scope
18 | cout<<(1LL<<(N-1)) <<endl;
| ^
|
s649108442 | p03665 | C++ | void solve(long long N, long long P, std::vector<long long> A) {
int one = 0;
long long tmp = 0;
for(int i =0 ;i<N;i++)if(A[i]%2)one = 1;
if(one == 0){
if(P == 1)tmp = 0;
else tmp = 1ll<<N;
}
else tmp = 1ll<<N-1;
cout<<tmp<<'\n';
} | a.cc:1:38: error: 'std::vector' has not been declared
1 | void solve(long long N, long long P, std::vector<long long> A) {
| ^~~
a.cc:1:49: error: expected ',' or '...' before '<' token
1 | void solve(long long N, long long P, std::vector<long long> A) {
| ... |
s881540468 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 2;
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 2;
void solve(long long N, long long P, std::vector<long long> A) {
int one = 0;
long long tmp = 0;
for(int i =0 ;i<N;i++)if(A[i]%2)one = 1;
if(one == 0){
if(P == 1... | a.cc:8:17: error: redefinition of 'const long long int MOD'
8 | const long long MOD = 2;
| ^~~
a.cc:4:17: note: 'const long long int MOD' previously defined here
4 | const long long MOD = 2;
| ^~~
a.cc:38:6: error: redefinition of 'void solve(long long int, long long ... |
s101527351 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 2;
void solve(long long N, long long P, std::vector<long long> A) {
int one = 0;
long long tmp = 0;
for(int i =0 ;i<N;i++)if(A[i]%2)one = 1;
if(one == 0){
if(P == 1)tmp = 0;
else tmp = 1ll<<n;
}
else tmp = 1ll<<n-1;
... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:12:24: error: 'n' was not declared in this scope
12 | else tmp = 1ll<<n;
| ^
a.cc:14:23: error: 'n' was not declared in this scope
14 | else tmp = 1ll<<n-1;
| ... |
s123526610 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 2;
void solve(long long N, long long P, std::vector<long long> A) {
int one = 0;
for(int i =0 ;i<N;i++)if(A[i]%2)one = 1;
if(one == 0){
if(P == 1)cout<<0;
else cout<<(ll)pow(2,N);
}
else cout<<(ll)pow(2,N-1);
}
// Gener... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:11:20: error: 'll' was not declared in this scope
11 | else cout<<(ll)pow(2,N);
| ^~
a.cc:13:19: error: 'll' was not declared in this scope
13 | else cout<<(ll)pow(2,N-1);
| ... |
s447460989 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
const long long MOD = 2;
void solve(long long N, long long P, std::vector<long long> A) {
int one = 0;
for(int i =0 ;i<N;i++}if(A[i]%2)one = 1;
if(one){
if(P == 1)return cout<<0;
else return cout<<pow(2,n);
}
else return cout<<pow(2,n-1);
}
... | a.cc: In function 'void solve(long long int, long long int, std::vector<long long int>)':
a.cc:8:25: error: expected ')' before '}' token
8 | for(int i =0 ;i<N;i++}if(A[i]%2)one = 1;
| ~ ^
| )
a.cc:8:25: error: expected primary-expression before '}' token... |
s425602509 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
ll combo(ll a, ll b){
if(b==0) return 1;
else{
ll ue=1;
ll shita=1;
for(ll i=a; i>=a-b+1; i--) ue*=i;
for(ll i=1; i<=b; i++) shita*=i;
return ue/shita;
}
}
int main(){
ll N, P; cin>>N>>P;
vector<ll> B(N);
ll odd=0;
ll even=0;
... | a.cc: In function 'int main()':
a.cc:28:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
28 | cout<<ans<<endl;
| ^~~
| abs
|
s091795899 | p03665 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
// write your code here
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int p = sc.nextInt();
int odd = 0;
for (int i = 0; i < n; i++) {
if (sc.nextInt() % 2 == 1... | Main.java:20: error: reached end of file while parsing
}
^
1 error
|
s121260047 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,p,one=0,zero=0,a,ans;
cin>>n>>p;
for(int i=0;i<n;i++){
cin>>a;
if(a%2==0){
zero++;
}
else{
one++;
}
}/
if(p==1 && one==0){
cout<<"0"<<endl;
}
else{
cout<<pow(2,n-1)<<endl;
}
return(0);
} | a.cc: In function 'int main()':
a.cc:14:10: error: expected primary-expression before '/' token
14 | }/
| ^
a.cc:15:9: error: expected primary-expression before 'if'
15 | if(p==1 && one==0){
| ^~
a.cc:18:9: error: 'else' without a previous 'if'
18 | else{
... |
s515301773 | p03665 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;
ll ncn(ll n){
if(n == 1){return 2;}
retur... | a.cc: In function 'int main()':
a.cc:29:23: error: expected primary-expression before '=' token
29 | }else if(B==0&&P%==0){
| ^
|
s434331872 | p03665 | Java | import java.math.BigDecimal;
import java.util.*;
public class Math {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int p = sc.nextInt();
int o = 0, e = 0;
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
... | Main.java:4: error: class Math is public, should be declared in a file named Math.java
public class Math {
^
Main.java:33: error: cannot find symbol
for (int i = 0; i < Math.min(r, n-r); i++) {
^
symbol: method min(int,int)
location: class Math
Main.java:36: error: c... |
s236772014 | p03665 | C++ | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#... | a.cc:24:21: error: use of parameter outside function body before ']' token
24 | ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
| ^
a.cc: In function 'll minn(...)':
a.cc:24:41: error: 'n' was not declared in this scope
24 | ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n)... |
s773093329 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'int main()':
a.cc:99:16: error: expected primary-expression before '=' token
99 | if(a[i]%==1){
| ^
|
s124116251 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int,int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
typedef vector<pii>... | a.cc: In function 'int main()':
a.cc:61:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
61 | if(cnt1==n&&&p==1){
| ~~^~~
|
s494251998 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n,p;
cin >> n >> p;
long long a[n];
for(int i=0;i<n;i++){
cin >> a[i];
a[i]=a[i]%2;
}
long long dp[n+1];
long long k[n+1];
k[0]=1
for(int i=1;i<+n;i++){
k[i]=k[i-1]*2;
}
dp[0]=1;
... | a.cc: In function 'int main()':
a.cc:14:11: error: expected ';' before 'for'
14 | k[0]=1
| ^
| ;
15 | for(int i=1;i<+n;i++){
| ~~~
a.cc:15:17: error: 'i' was not declared in this scope
15 | for(int i=1;i<+n;i++){
| ^
|
s989556648 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,P,O=0,E=0,x,A;cin>>N>>P;
for(int i=0;i<N;i++){
cin>>A;
if(A%2==0)E++;
else O++;
}
if(O%2==1)x=pow(2,O-1);
else{
long long int s=1,t=1;
for(int i=1;i<=O/2;i++)s*=i;
for(int i=O/2+1;i<=O;i++)t*=i;
if(P==0)x=(pow(2,O)-t/s... | a.cc: In function 'int main()':
a.cc:18:12: error: no matching function for call to 'pow(int)'
18 | cout<<pow(2*E)*x<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
from a.cc:1:
/u... |
s820264086 | p03665 | C | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#define DIV LLONG_MAX
long long mypow(long long k, long long n) {
long long temp = 1;
k = k % DIV;
while (n) {
if (n % 2) temp = temp * k % DIV;
k = k * k % DIV;
n = n / 2;
}
return temp % DIV;
}
long long cmb(long long n, long ... | main.c: In function 'main':
main.c:53:9: error: expected declaration or statement at end of input
53 | return 0;
| ^~~~~~
|
s476985764 | p03665 | C++ | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#define DIV LLONG_MAX
long long mypow(long long k, long long n) {
long long temp = 1;
k = k % DIV;
while (n) {
if (n % 2) temp = temp * k % DIV;
k = k * k % DIV;
n = n / 2;
}
return temp % DIV;
}
long long cmb(long long n, long ... | a.cc: In function 'int main()':
a.cc:53:18: error: expected '}' at end of input
53 | return 0;
| ^
a.cc:31:11: note: to match this '{'
31 | int main(){
| ^
|
s103365617 | p03665 | C++ | #include<iostream>
#include <bits/stdc++.h>
#include <cmath>
int main()
{
int N,P;
cin >> N >> P;
vector<int> vec(N);
for (int i=0; i<N; i++){
cin >> vec[i];
}
int even;
double odd;
even=0;
odd=0;
for (int i=0;i<N;i++){
if (vec[i]%2==0){
even++;
}
}
odd = N-even;
... | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin >> N >> P;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked t... |
s522616884 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N,P;
cin >> N >> P;
vector<int> A(N);
int E = 0;
int O = 0;
for (int i = 0; i < N; i++){
cin >> A[i];
if (A[i] % 2 == 0) E++;
if (A[i] % 2 == 1) O++;
}
long long ans = 1;
for (int i = 0; i < E; i++) ans*=2;
//Calculate binomia... | a.cc: In function 'int main()':
a.cc:17:55: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, std::vector<int>)'
17 | vector<vector<long long>> B(O + 1,vector<int>(O + 1));
| ^
In file included from /usr/includ... |
s417065186 | p03665 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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(),... | a.cc: In function 'long long int h(long long int, long long int)':
a.cc:41:16: error: expected ';' before '>' token
41 | for(int i=j,i>0;j--){
| ^
| ;
a.cc:41:16: error: expected primary-expression before '>' token
|
s959202092 | p03665 | C++ | #include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
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(),... | a.cc: In function 'long long int h(long long int, long long int)':
a.cc:41:16: error: expected ';' before '>' token
41 | for(int i=j,i>0;j--){
| ^
| ;
a.cc:41:16: error: expected primary-expression before '>' token
a.cc: In function 'int main()':
a.cc:82:17: error: expecte... |
s852980319 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:21:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
21 | dp[i][0]=dp[i-1][0]+1;
| ^~
| dup
a.cc:25:7: error: 'dp' was not declared in this scope; did you mean 'dup'?
25 | dp[i][0]=dp[i-1][1]+1;
| ^~
| ... |
s989244247 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
long long cob(long long x, long long y){
long long tmp1 = 1;
for(int i = x; i > x - y; i++){
tmp1 *= i;
}
long long tmp2 = 1;
for(int i = 1; i < y + 1; i++){
tmp2 *= i;
}
return tmp1 / tmp2;
}
int main(){
long long n, p; cin >> n >> p;
vector<int... | a.cc: In function 'int main()':
a.cc:33:9: error: expected unqualified-id before '=' token
33 | int = 1;
| ^
a.cc:34:11: error: 'i' was not declared in this scope
34 | while(i <= x){
| ^
|
s487174718 | p03665 | C++ | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include<string>
#include <stack>
#include<queue>
#include<map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;
int main() {
int n,p,ans=0;
bool gu=tr... | a.cc: In function 'int main()':
a.cc:29:62: error: 'pow' was not declared in this scope
29 | cout << fixed << setprecision(15) <<pow(2,n) << endl;
| ^~~
a.cc:34:55: error: 'pow' was not declared in this scope
34 | ... |
s668303119 | p03665 | C++ | #include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include<Math.h>
#include <cstdio>
#include <iostream>
#include <iomanip>
#include<string>
#include <stack>
#include<queue>
#include<map>
#include <stdlib.h>
#include <bits/stdc++.h>
#include <set>
typedef long long ll;
usi... | a.cc:6:9: fatal error: Math.h: No such file or directory
6 | #include<Math.h>
| ^~~~~~~~
compilation terminated.
|
s302521429 | p03665 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++)
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 100000... | a.cc: In function 'int main()':
a.cc:79:14: error: 'combi' was not declared in this scope; did you mean 'conbi'?
79 | ans *= combi(ck,i) ;
| ^~~~~
| conbi
a.cc:85:14: error: 'combi' was not declared in this scope; did you mean 'conbi'?
85 | ans *= combi(ck,i) ;
... |
s003986590 | p03665 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int P = sc.necrInt();
int odd = 0;
for (int i = 0; i < N; i ++) {
if (sc.nextInt()%2 == 1) odd++;
}
long oddComb = 0;
for (int i = 1; ... | Main.java:7: error: cannot find symbol
int P = sc.necrInt();
^
symbol: method necrInt()
location: variable sc of type Scanner
Main.java:18: error: cannot find symbol
System.out.println(p == 1
^
symbol: variable p
location: class Main
2 errors
|
s884733623 | p03665 | Java | import java.util.*;
public class Main {
pubkic static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int P = sc.necrInt();
int odd = 0;
for (int i = 0; i < N; i ++) {
if (sc.nextInt()%2 == 1) odd++;
}
long oddComb = 0;
for (int i = 1; ... | Main.java:4: error: <identifier> expected
pubkic static void main(String[] args) {
^
Main.java:19: error: ')' or ',' expected
? oddComb : (1L<<N)-oddComb;
^
2 errors
|
s148201050 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,p; cin>>n>>p;
int C[n+1][n+1];
long long c0=0,c1=0;
for(int i=0;i<n;i++){
int a; cin>>a;
if(a%2==0) c0++;
else c1++;
}C[0][0]=1;
for(int i=1;i<=n;i++){
for(int j=0;j<=i;j++){
if(j==0 || j==i) C[i][j]=1;
else C[i][j]... | a.cc: In function 'int main()':
a.cc:19:26: error: expected ',' or ';' before 'ans'
19 | long long re=pow(2,c0) ans=0;
| ^~~
a.cc:21:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
21 | if(bit%2==p) ans+=re*C[n][bit];
| ^~~
| ... |
s561263346 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int main () {
int N, P, odd = 0, even = 0;
cin >> N >> P;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
if (A % 2) odd++;
else even++;
}
long long ans = 1;
if (even == N) {
for (int i = 0; i < N; i++) {
... | a.cc: In function 'int main()':
a.cc:11:13: error: no match for 'operator%' (operand types are 'std::vector<int>' and 'int')
11 | if (A % 2) odd++;
| ~ ^ ~
| | |
| | int
| std::vector<int>
In file included from /usr/include/c++/14/valarray:605... |
s249441456 | p03665 | C | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = (1e9)+7;
void fastIO(){
ios_base::sync_with_stdio(0); cin.tie(0);
}
int main(){
fastIO();
ll n,c,x;
cin>>n>>c;
int par=0,impar=0;
for(int i=0;i<n;i++){
cin>>x;
x%2==0?par++:impar++;
}
ll ans = ... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s881473027 | p03665 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
long long int64_t a,b,c[110],d[110],e,f,g[110],h[110];
cin >>a>>b;
e =0,f=0;
for(int i=0;i<a;i++)
cin >> c[i];
for(int i=0;i<a;i++){
d[i] = c[i]%2;
if( d[i] ==0){
e ++;
}
else{
f++;
}
}
g[0]... | a.cc: In function 'int main()':
a.cc:5:21: error: expected initializer before 'a'
5 | long long int64_t a,b,c[110],d[110],e,f,g[110],h[110];
| ^
a.cc:6:9: error: 'a' was not declared in this scope
6 | cin >>a>>b;
| ^
a.cc:6:12: error: 'b' was not declared in this scop... |
s460891586 | p03665 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
long long int a,b,c[110],d[110],e,f,g[110],h[110];
cin >>a>>b;
e =0,f=0;
for(int i=0;i<a;i++)
cin >> c[i];
for(int i=0;i<a;i++){
d[i] = c[i]%2;
if( d[i] ==0){
e ++;
}
else{
f++;
}
}
g =1,h=1... | a.cc: In function 'int main()':
a.cc:22:5: error: incompatible types in assignment of 'int' to 'long long int [110]'
22 | g =1,h=1;
| ~~^~
a.cc:22:9: error: incompatible types in assignment of 'int' to 'long long int [110]'
22 | g =1,h=1;
| ~^~
a.cc:24:7: error: invalid operands of types ... |
s997941633 | p03665 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
long long int a,b,c[110],d[110],e,f,g[110],h[110];
e =0,f=0;
for(int i=0;i<a;i++)
cin >> c[i];
for(int i=0;i<a;i++){
d[i] = c[i]%2;
if( d[i] ==0){
e ++;
}
else{
f++;
}
}
g[0] =1,h[0]=1;
for(... | a.cc: In lambda function:
a.cc:26:18: error: expected '{' before ';' token
26 | h[i+1] =2*[i];
| ^
a.cc: In function 'int main()':
a.cc:26:14: error: no match for 'operator*' (operand types are 'int' and 'main()::<lambda()>')
26 | h[i+1] =2*[i];
| ~^~~~
| ... |
s812846979 | p03665 | C++ | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int main() {
long long int a,b,c[110],d[110],e,f,g,h;
e =0,f=0;
for(int i=0;i<a;i++)
cin >> c[i];
for(int i=0;i<a;i++){
d[i] = c[i]%2;
if( d[i] ==0){
e ++;
}
else{
f++;
}
}
g[0] =1,h[0]=1;
for(int i=0;i<... | a.cc: In function 'int main()':
a.cc:21:4: error: invalid types 'long long int[int]' for array subscript
21 | g[0] =1,h[0]=1;
| ^
a.cc:21:12: error: invalid types 'long long int[int]' for array subscript
21 | g[0] =1,h[0]=1;
| ^
a.cc:23:6: error: invalid types 'long long int[int]' fo... |
s612099686 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
const int maxn = 50 + 10;
long long int a[maxn];
long long int tavan(int a, int b)
{
long long int jav = 1;
int (int i = 0; i < b; i ++)
{
jav *= a;
}
return jav;
}
int main()
{
long long int n, k, e = 0, o = 0, jav = 0;
cin >> n >> k... | a.cc: In function 'long long int tavan(int, int)':
a.cc:11:5: error: expected primary-expression before 'int'
11 | int (int i = 0; i < b; i ++)
| ^~~
a.cc:11:21: error: 'i' was not declared in this scope
11 | int (int i = 0; i < b; i ++)
| ^
|
s489438870 | p03665 | C++ | #include <iostream>
//using namespace std;long n,x,a,i,b;int main(){for(cin>>n>>x;n>i;i++){cin>>a;b+=a%2;}cout << (b?1<<n:x?0:1<<--n) << endl;} | /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
|
s275831547 | p03665 | C++ | #include <iostream>
using namespace std;int main(){long long n,x;cin>>n>>x;for(int i = 0; n > i; i++){int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}}cout << (x==0?(long long)pow(2,n):0) << endl;} | a.cc: In function 'int main()':
a.cc:2:126: error: 'pow' was not declared in this scope
2 | using namespace std;int main(){long long n,x;cin>>n>>x;for(int i = 0; n > i; i++){int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}}cout << (x==0?(long long)pow(2,n):0) << endl;}
| ... |
s316020893 | p03665 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int main(){
long long n,x;cin>>n>>x;
for(int i = 0; n > i; i++)int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}
cout << (x==0?(long long)pow(2,n):0) << endl;
}
| a.cc: In function 'int main()':
a.cc:6:40: error: 'a' was not declared in this scope
6 | for(int i = 0; n > i; i++)int a;cin>>a;if(a%2==1){cout << (long long)pow(2,n)/2 << endl;return 0;}
| ^
|
s173002710 | p03665 | C++ | N, P = map(int,input().split())
A = list(map(int,input().split()))
dp = [[[0 for k in range(2)] for j in range(N+1)] for i in range(N+1)] #dp[i][j][k]は1-iまででj個選んだ時にmod2がkとなる選び方
dp[1][0][0] = 1
if(A[0] % 2 == 0):
dp[1][1][0] = 1
else:
dp[1][1][1] = 1
for i in range(2, N+1):
for j in range(i+1):
if(j ... | a.cc:3:72: error: stray '#' in program
3 | dp = [[[0 for k in range(2)] for j in range(N+1)] for i in range(N+1)] #dp[i][j][k]は1-iまででj個選んだ時にmod2がkとなる選び方
| ^
a.cc:1:1: error: 'N' does not name a type
1 | N, P = map(int,input().split())
... |
s473774816 | p03665 | C++ | #incluce<bits/stdc++.h>
using namespace std;
int main(){
int N, P;
cin >> N >> P;
for(int i=0; i<N; i++){
int A; cin >> A;
}
cout << (long long)pow(2, N-1) << endl;
return 0;
} | a.cc:1:2: error: invalid preprocessing directive #incluce; did you mean #include?
1 | #incluce<bits/stdc++.h>
| ^~~~~~~
| include
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
6 | cin >> N >> P;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header... |
s383219765 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) ... | a.cc: In function 'int main()':
a.cc:37:4: error: 'else' without a previous 'if'
37 | else Out(A);
| ^~~~
|
s092477829 | p03665 | C++ | #include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
const long long MOD = 1000000007;
typedef long long ll;
int
main(int argc, ch... | a.cc: In function 'int main(int, char**)':
a.cc:23:13: error: invalid types 'int[int]' for array subscript
23 | cin >> a[i];
| ^
a.cc:30:10: error: invalid types 'int[int]' for array subscript
30 | if (a[i] % 2) {
| ^
|
s687444918 | p03665 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <math.h>
using namespace std;
typedef long long int ll;
int main(){
int n,p; cin >> n >> p;
vector<int> a(n);
int odd=0;
for(int i=0;i<n;i++){
cin >> a[i];
if(a[i]%2==1)odd++;
}
if(p==1&&odd==0){
cout << 0 << endl;
retur... | a.cc: In function 'int main()':
a.cc:22:9: error: 'else' without a previous 'if'
22 | else if(p==0&&odd==0){
| ^~~~
|
s431057268 | p03665 | C++ | #include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
using namespace std;
int n, m;
int a[2005];
long long ans;
int f[10005]={0};
int main(){
cin >> n >> p;
for (int i=1; i<=n; i++) cin >> a[i];
f[0]=1;
for (int i=1; i<=n; i++)
for (int j=5000... | a.cc: In function 'int main()':
a.cc:13:17: error: 'p' was not declared in this scope
13 | cin >> n >> p;
| ^
|
s141129344 | p03665 | C++ | /**
* code generated by JHelper
* More info: https://github.com/AlexeyDmitriev/JHelper
* @author edamat
*/
#include <bits/stdc++.h>
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a), i##_len = (b); i < i##_len; ++i)
#defin... | a.cc:25:13: error: '::main' must return 'int'
25 | #define int lint
| ^~~~
a.cc:386:1: note: in expansion of macro 'int'
386 | int main(){
| ^~~
|
s333775970 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long int n,p,e=0,a=1,b=0;cin>>n>>p;
for(int i=0;i<n;i++){
int a;cin>>a;
if(a%2)e++;
}
if(e>0){
for(int i=0;i<e;;i++)a*=2;
}
if(p==0){
for(int i=0;i<=n-e;i+=2){
long int c=1;
for(int j=n-e-i+1;j<=n-e;j++)c*=j;
for(int ... | a.cc: In function 'int main()':
a.cc:10:21: error: expected primary-expression before ';' token
10 | for(int i=0;i<e;;i++)a*=2;
| ^
a.cc:10:21: error: expected ')' before ';' token
10 | for(int i=0;i<e;;i++)a*=2;
| ~ ^
| )
a.cc:10... |
s205420117 | p03665 | C++ | #include<iostream>
using namespace std;
long i,n,p,a,f;
int main()
{
for(cin>>n>>p;i<n;i++)cin>>a,f+=a%2;
cout<<n==1&&f==0&&p==0?2:(!f)&&p?0:1l<<n-1)<<endl;
} | a.cc: In function 'int main()':
a.cc:7:16: error: no match for 'operator==' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and 'int')
7 | cout<<n==1&&f==0&&p==0?2:(!f)&&p?0:1l<<n-1)<<endl;
| ~~~~~~~^~~
| | |
| ... |
s783489175 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod = (int)1e9 + 7;
const int INF = (int)100100100;
void comb(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;k <v.size();k++){
for(int j = 1;j<k;j++){
v[k][... | a.cc: In function 'int main()':
a.cc:41:5: error: 'else' without a previous 'if'
41 | else cout << ans << endl;
| ^~~~
|
s079101363 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll> ;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=1LL<<60;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld EPS = 1e-9; //微調整用(EPSより小さいと0と判定など)
#define gcd __gcd //llは受け取ってくれない
int lc... | a.cc: In function 'int main()':
a.cc:76:13: error: cannot convert 'main()::<lambda(ll, ll)>' to 'll' {aka 'long long int'} in initialization
76 | ll Comb = [&] (ll n, ll k) -> ll {
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| main()::<lambda(ll, ll)>
77 | return Cmb... |
s135133375 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll> ;
using pld = pair<ld, ld>;
const int INF=1e9+7;
const ll LINF=1LL<<60;
const ll MOD=1e9+7;
const ld PI=acos(-1);
const ld EPS = 1e-9; //微調整用(EPSより小さいと0と判定など)
#define gcd __gcd //llは受け取ってくれない
int lc... | a.cc: In function 'int main()':
a.cc:76:13: error: cannot convert 'main()::<lambda(ll, ll)>' to 'll' {aka 'long long int'} in initialization
76 | ll Cmbs = [&] (ll n, ll k) -> ll {
| ^~~~~~~~~~~~~~~~~~~~~~~~
| |
| main()::<lambda(ll, ll)>
77 | return Cmb... |
s607707642 | p03665 | C++ | 45 1
17 55 85 55 74 20 90 67 40 70 39 89 91 50 16 24 14 43 24 66 25 9 89 71 41 16 53 13 61 15 85 72 62 67 42 26 36 66 4 87 59 91 4 25 26
| a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 45 1
| ^~
|
s965946045 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define cinv(n,vec) VL (vec)(n);for(auto&v:vec)cin>>v;
#define int long long
#define itn int
#define pb push_back
#define m_p make_pair
#define m_t ma... | a.cc:87:1: error: unterminated comment
87 | /*
| ^
|
s328107144 | p03665 | C | #include <stdio.h>
int main(void) {
int N, P, A[55], i, n_e, n_o;
long long c;
scanf("%d %d", &N, &P);
n_e=0; n_o=0;
for (i=1; i<=N; i++) {
scanf("%d", &A[i]);
if ((A[i])%2 == 0) n_e+=1;
else n_o+=1;
}
if (n_o!=0) {
c=1;
for (i=1; i<=N-1; i++) {
... | main.c: In function 'main':
main.c:18:5: error: expected '}' before 'else'
18 | else if (P==1) c=0;
| ^~~~
main.c:26:1: error: expected declaration or statement at end of input
26 | }
| ^
|
s449195041 | p03665 | C++ | long long int N,P;
cin>>N>>P;
long long int A[N];
long long int S = 0,s=0,B=0;
for(int x = 0;x<N;x++){
cin>>A[x];
}for(int x = 0;x<N;x++){
if(A[x]%2==0){
S++;
}else{
s++;
}
}
if(P==0){
B+=1;
long long int D=0,C = S*(S+1)/2;
for(int x = s-1;x>0;x-=2){
D+=x;
}
B+=C... | a.cc:2:1: error: 'cin' does not name a type
2 | cin>>N>>P;
| ^~~
a.cc:3:17: error: size of array 'A' is not an integral constant-expression
3 | long long int A[N];
| ^
a.cc:6:1: error: expected unqualified-id before 'for'
6 | for(int x = 0;x<N;x++){
| ^~~
a.cc:6:15: error: ... |
s378591990 | p03665 | C++ | long long int N,P;
cin>>N>>P;
long long int A[N];
long long int S = 0,s=0,B=0;
for(int x = 0;x<N;x++){
cin>>A[x];
}for(int x = 0;x<N;x++){
if(A[x]%2==0){
S++;
}else{
s++;
}
}
if(P==0){
B+=1;
long long int D=0,C = S*(S+1)/2;
for(int x = s-1;x>0;x-=2){
D+=x;
}
B+=C... | a.cc:2:1: error: 'cin' does not name a type
2 | cin>>N>>P;
| ^~~
a.cc:3:17: error: size of array 'A' is not an integral constant-expression
3 | long long int A[N];
| ^
a.cc:6:1: error: expected unqualified-id before 'for'
6 | for(int x = 0;x<N;x++){
| ^~~
a.cc:6:15: error: ... |
s077542657 | p03665 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<string>
using namespace std;
const int INF = 1<<30;
typedef long long int ll;
int main(){
int n, p;cin>>n>>p;
int m=0;
for(int i=0;i<n;i++){
int t;cin>>t;
m+=(t%2!=0);
}
if(m==0) cout<<(p==0?(int... | a.cc: In function 'int main()':
a.cc:21:68: error: expected '}' at end of input
21 | else cout<<ll(pow((float)2, m-1)*pow((float)2, n-m))<<endl;
| ^
a.cc:13:11: note: to match this '{'
13 | int main(){
| ^
|
s679015419 | p03665 | C++ | #include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
ll n,q;
cin >> n >> q;
ll a[n];
for(int i=0;i<n;i++) cin >> a[i];
ll x=0,y=0;
for(int i=0;i<n;i++){
if(a[i]%2==0){
x++;
}
else{
y++;
}
}
if(y!=0){
cout << (ll)pow(2,n-1) << endl;... | a.cc: In function 'int main()':
a.cc:25:8: error: 'p' was not declared in this scope
25 | if(p==0){
| ^
|
s038546749 | p03665 | C++ | #include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
ll n,q;
cin >> n >> q;
for(int i=0;i<n;i++) cin >> a[i];
ll x=0,y=0;
for(int i=0;i<n;i++){
if(a[i]%2==0){
x++;
}
else{
y++;
}
}
if(y!=0){
cout << (ll)pow(2,n-1) << endl;
}
else... | a.cc: In function 'int main()':
a.cc:10:31: error: 'a' was not declared in this scope
10 | for(int i=0;i<n;i++) cin >> a[i];
| ^
a.cc:13:8: error: 'a' was not declared in this scope
13 | if(a[i]%2==0){
| ^
a.cc:24:8: error: 'p' was not declared in this scope
... |
s890172948 | p03665 | C++ | #include<iostream>
#include<cmath>
#include<numeric>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define int64 long long
#define yokuwaruprime (10*10*10*10*10*10*10*10*10+7)
using namespace std;
int64 power2(int n){
... | a.cc: In function 'int main()':
a.cc:25:7: error: conflicting declaration 'int a [n]'
25 | int a[n];
| ^
a.cc:23:11: note: previous declaration as 'int a'
23 | int n,p,a=0,b=0;
| ^
a.cc:27:11: error: invalid types 'int[int]' for array subscript
27 | cin>>a[i];
| ... |
s553144520 | p03665 | C | #include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<cmath>
using namespace std;
long long cmb(int a, int b){
long long s=1;
for(int i=1;i<=b;i++){
s=s*(a+1-i)/i;
}
return s;
}
int main(){
int n, p;
cin >> n >> p;
vector<int> m(2,0);
int a,i;
for(i=0;i<n;i++){
cin >> ... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s972732756 | p03665 | C++ | #include<iostream>
using namespace std;
long long n,p,ans=1,a,cnt0,cnt1;
main(){
cin>>n>>p;
for(int i=0;i<n;i++){
cin>>a;
ans*=2;
if(a%2)cnt1++;
else cnt0++;
}
if(cnt0==n and p==0)cout<<ans<<endl;
else if(cnt==n and p==1)cout<<0<<endl;
else cout<<ans/2<<endl;
} | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:13:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
13 | else if(cnt==n and p==1)cout<<0<<endl;
| ^~~
| i... |
s017511832 | p03665 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<cstdio>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int SIZE = 100;
int main() {
ll n, p;
ll odd, even;... | a.cc: In function 'int main()':
a.cc:37:46: error: 'pow' was not declared in this scope
37 | printf("%lld\n", (ll)pow(2, n));
| ^~~
a.cc:41:46: error: 'pow' was not declared in this scope
41 | printf("%lld\n", (ll)p... |
s577840999 | p03665 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<cstdio>
using namespace std;
typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
const int SIZE = 100;
int main() {
ll n, p;
ll odd, even;... | a.cc: In function 'int main()':
a.cc:23:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
23 | scanf_s("%lld %lld", &n, &p);
| ^~~~~~~
| scanf
a.cc:37:46: error: 'pow' was not declared in this scope
37 | printf("%lld\n", (ll)pow(2... |
s358577466 | p03665 | C++ | #include<bits/stdc++.h>
#include<math.h>
using namespace std;
typedef long long ll;
int main()
{
int N, P; cin >> N >> P;
ll ans = 1;
vector<int> A(N);
for(int i = 0; i < N; i++)
{
cin >> A.at(i);
}
int X = 0, Y = 0;
for(int i = 0; i < N; i++)
{
if(A.at(i) % 2 == 0)
... | a.cc: In function 'int main()':
a.cc:26:8: error: redeclaration of 'll ans'
26 | ll ans = 1;
| ^~~
a.cc:8:8: note: 'll ans' previously declared here
8 | ll ans = 1;
| ^~~
|
s045807620 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n,p;
cin >> n >> p;
bool gusu==true;
int a[n];
for (int i=0;i<n;i++){
cin >> a[i];
if (a[i]%2==1)gusu=false;
}
if (p==0 && gusu)cout << pow(2,n) <<endl;
else if (p==1 && gusu) cout << 0 <<endl;
else cout <<pow(2,n-1)<<endl;
} | a.cc: In function 'int main()':
a.cc:6:12: error: expected initializer before '==' token
6 | bool gusu==true;
| ^~
a.cc:10:19: error: 'gusu' was not declared in this scope
10 | if (a[i]%2==1)gusu=false;
| ^~~~
a.cc:12:15: error: 'gusu' was not declared in this scope... |
s821969972 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n,p;
scanf("%d %d", &n,&p);
int k0=0,k1=0;
for(int i=0;i<n;i++){
int a;
scanf("%d", &a);
if(a%2==0){
k0++;
}else{
k1++;
}
}
ll ans;
if(k1==0){
ans=(1LL<<n);
}else{
ans=(1LL<<(n-1));
}
if(p==1){
... | a.cc: In function 'int main()':
a.cc:18:3: error: 'll' was not declared in this scope
18 | ll ans;
| ^~
a.cc:20:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
20 | ans=(1LL<<n);
| ^~~
| abs
a.cc:22:5: error: 'ans' was not declared in this scope; did you mean ... |
s483208603 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int n, p; cin >> n >> p;
int A[n];
for (int i = 0; i < n; i++) {
cin >> A[i];
}
int cnt_even = 0, cnt_odd = 0;
for (int i = 0; i < n; i++) {
if (A[i] % 2 == 0) cnt_even++;
else cnt_odd++;
}
long long ans = 0;
if (cnt_odd == 0) {
if (p == 0) cout... | a.cc: In function 'int main()':
a.cc:20:32: error: 'N' was not declared in this scope
20 | cout << pow(2, N - 1) << endl;
| ^
|
s903555052 | p03665 | C++ | #include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define llong long long int
#define ullong unsigned long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
const static long long int MOD = 1000000000 + 7;
const static int dy[] = {0, 1, 0, -1};
const static int dx[] = {1, 0, -1, 0};
template... | a.cc: In function 'int main(int, char**)':
a.cc:40:24: error: expected ';' before 'cout'
40 | ans *= pow(2, even)
| ^
| ;
41 |
42 | cout << ans << endl;
| ~~~~
|
s034140550 | p03665 | C++ | #include "bits/stdc++.h"
using namespace std;
int main() {
int N, P;
cin >> N >> P;
vector<int> A(N);
for (int i = 0; i < N; i++) {
cin >> A[i];
}
int cnt0 = 0;
int cnt1 = 0;
for (int i = 0; i < N; i++) {
if (A[i] % 2 == 0) {
cnt0++;
}
else {... | a.cc: In function 'int main()':
a.cc:27:31: error: expected ')' before 'N'
27 | long long ans = pow(2. N);
| ~ ^~
| )
a.cc:27:28: error: no matching function for call to 'pow(double)'
27 | long long ans = pow(2. N);
| ... |
s793002426 | p03665 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)
#define rep_r(i,s,n)for(ll i=n-1;i>=s;i--)
#define repe_r(i,s,n)for(ll i=s;i<=n;i++)
static ... | a.cc: In function 'int main()':
a.cc:28:12: error: redeclaration of 'll p'
28 | ll p = 0;
| ^
a.cc:20:15: note: 'll p' previously declared here
20 | ll n, p; cin >> n >> p;
| ^
|
s876752048 | p03665 | C++ | /* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>
// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>
// container library
#include <array>
#include <bitset>
#include <deque>
#... | a.cc: In function 'int main()':
a.cc:156:35: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
156 | cout << 0 < endl;
| ~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/string:48,
... |
s029403433 | p03665 | C++ | # -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline
def main():
N, P = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x % 2, A))
if A.count(1):
ans = pow(2,N-1)
else:
if P == 0:
ans = pow(2,N)
else:
ans... | a.cc:1:3: error: invalid preprocessing directive #-
1 | # -*- coding: utf-8 -*-
| ^
a.cc:20:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
20 | if __name__ == '__main__':
| ^~~~~~~~~~
a.cc:2:1: error: 'import' does not name a type
2 | import ... |
s646405008 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
const int MAX=510000;
const int MOD=1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for (int i=2;i<MAX;i++) {
fac[i]=fac[i-1]*i%MOD;
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
... | a.cc:71:11: error: redefinition of 'const int MAX'
71 | const int MAX=510000;
| ^~~
a.cc:4:11: note: 'const int MAX' previously defined here
4 | const int MAX=510000;
| ^~~
a.cc:72:11: error: redefinition of 'const int MOD'
72 | const int MOD=1000000007;
| ^~~
a... |
s853197986 | p03665 | C++ | #include<iostream>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace... | /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
|
s970901305 | p03665 | C++ | #include<algorithm>
#include<cstring>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
int n,a[55],p;
int f[55][55];
int C(int x,int y){return f[y][x];}
void pre()
{
f[1][1]=f[1][0]=f[0][0]=1;
for(int i=2;i<=50;i++)
{
f[i][0]=f[i][i]=1;
for(int j=1;j<i;j++)
f[i][j]=f[i-1][j]+f[i-... | a.cc: In function 'int main()':
a.cc:24:9: error: 'scanf' was not declared in this scope
24 | scanf("%d%d",&n,&p);
| ^~~~~
a.cc:33:9: error: 'printf' was not declared in this scope
33 | printf("%lld\n",ans);
| ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdi... |
s732414348 | p03665 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const i... | a.cc: In function 'int main()':
a.cc:28:35: error: expected ';' before 'endl'
28 | else cout << (p ? 0 : ans) endl;
| ^~~~~
| ;
|
s897765042 | p03665 | Java | import java.io.*;
import java.util.*;
public class Main {
private void compute(){
Scanner scanner = new Scanner (System.in);
int n = scanner.nextInt();
int p = scanner.nextInt();
int e, o;
for (int i=0;i<n;i++) {
if (scanner.nextInt() % 2 == 0)
e++;
else
o++;
}
... | Main.java:13: error: variable e might not have been initialized
e++;
^
Main.java:15: error: variable o might not have been initialized
o++;
^
Main.java:19: error: variable o might not have been initialized
rtn *= o;
^
Main.java:23: error: variable o might not have been... |
s449232917 | p03665 | Java | import java.io.*;
import java.util.*;
public class Main {
private void compute(){
Scanner scanner = new Scanner (System.in);
int n = scanner.nextInt();
int p = scanner.nextInt();
int e, o;
for (int i=0;i<n;i++) {
if (scanner.nextInt() % 2 == 0)
e++;
else
o++;
}
... | Main.java:33: error: <identifier> expected
private static long co(int n, k) {
^
1 error
|
s572978258 | p03665 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<en... | a.cc: In function 'int main()':
a.cc:32:13: error: 'p' was not declared in this scope
32 | cin>>n>>p;
| ^
|
s076093381 | p03665 | C++ | include <bits/stdc++.h>
#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<end... | a.cc:1:1: error: 'include' does not name a type
1 | include <bits/stdc++.h>
| ^~~~~~~
a.cc:16:7: error: 'll' does not name a type; did you mean 'all'?
16 | const ll LINF = 1e18;
| ^~
| all
a.cc:21:1: error: 'string' does not name a type
21 | string alph("abcdefghijklmnopqrstuvwxy... |
s212036042 | p03665 | C++ | #include <bits/c++.h>
using namespace std;
int main() {
int n,p;
cin >> n >> p;
int a[p];
for (int i = 0;i < p;i++) {
cin >> a[i]
}
int pw = pow(2,n);
int ans2 = 0;
for (int i = 0;i < pw;i++) {
int ans = 0;
for (int j = n - 1;j >= 0;j++) {
int m = i;
if (m%2==1) {
ans += a[i];
}
m/=2;
}... | a.cc:1:10: fatal error: bits/c++.h: No such file or directory
1 | #include <bits/c++.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s187658437 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int sisu(int a,int b){
int c=a;
for(int i=0;i!=b;i++){
a=a*c;
}
a=a/c;
return a;
}
long nCr(int n, int r){
long ans=1;
for(int i=n;i>n-r;--i){
ans = ans*i;
}
for(int i=1;i<r+1;++i){
ans=ans/i;
}
return ans;
}
int main(){
int n,p,a[50];
... | a.cc: In function 'int main()':
a.cc:61:27: error: expected ')' before ';' token
61 | for(int i=2;i!=b+2;i+2;){
| ~ ^
| )
a.cc:61:28: error: expected primary-expression before ')' token
61 | for(int i=2;i!=b+2;i+2;){
| ... |
s218199202 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int sisu(int a,int b){
int c=a;
for(int i=0;i!=b;i++){
a=a*c;
}
a=a/c;
return a;
}
long nCr(int n, int r){
long ans=1;
for(int i=n;i>n-r;--i){
ans = ans*i;
}
for(int i=1;i<r+1;++i){
ans=ans/i;
}
return ans;
}
int main(){
int n,p,a[50];
... | a.cc: In function 'int main()':
a.cc:49:27: error: expected ')' before ';' token
49 | for(int i=1;i!=b+2;i+2;){
| ~ ^
| )
a.cc:49:28: error: expected primary-expression before ')' token
49 | for(int i=1;i!=b+2;i+2;){
| ... |
s209453153 | p03665 | C++ | #include<bits/stdc++.h>
using namespace std;
int sisu(int a,int b){
int c=a;
for(int i=0;i!=b;i++){
a=a*c;
}
a=a/c;
return a;
}
long nCr(int n, int r){
long ans=1;
for(int i=n;i>n-r;--i){
ans = ans*i;
}
for(int i=1i<r+1;++i){
ans=ans/i;
}
return ans;
}
int main(){
int n,p,a[50];
... | a.cc: In function 'long int nCr(int, int)':
a.cc:19:15: error: no match for 'operator<' (operand types are 'std::complex<double>' and 'int')
19 | for(int i=1i<r+1;++i){
| ~~^~~~
| | |
| | int
| std::complex<double>
In file included from /u... |
s849372910 | p03665 | C++ | n,m=map(int,input().split())
s=list(map(int,input().split()))
odd=0
even=0
p=0
for i in s:
if i%2==1:
odd+=1
else:
even+=1
even=2**even
from math import factorial
def f(n,m):
return factorial(n)//(factorial(n-m)*factorial(m))
for i in range(1,odd+1,2):
p+=f(odd,i)
print(p*even) | a.cc:1:1: error: 'n' does not name a type
1 | n,m=map(int,input().split())
| ^
|
s366438954 | p03665 | C++ | #include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<math.h>
#include<numeric>
#include<cassert>
#include<random>
#include<deque>
#include<chrono... | In file included from /usr/include/c++/14/cassert:44,
from a.cc:16:
a.cc: In function 'int main()':
a.cc:63:21: error: expected ')' before ';' token
63 | assert(false;)
| ^
a.cc:63:21: error: expected ')' before ';' token
a.cc:63:9: note: to match this '('
63 | ... |
s021777001 | p03665 | C++ | #include<iostream>
using namespace std;
int main(){
int n, p;
cin >> n >> p;
int a[n];
bool odd = false;
for(int i = 0; i < n; i++){
cin >> a[i];
if(a[i]%2 == 1) odd = true;
}
if(odd == false && p == 0){
ll ans = 1;
for(int i = 0; i < n; i++) ans *= 2;
... | a.cc: In function 'int main()':
a.cc:16:9: error: 'll' was not declared in this scope
16 | ll ans = 1;
| ^~
a.cc:17:37: error: 'ans' was not declared in this scope; did you mean 'abs'?
17 | for(int i = 0; i < n; i++) ans *= 2;
| ^~~
| ... |
s176114009 | p03665 | C++ | //海老原祐輔
//J4-180012
//Biscuits
//https://beta.atcoder.jp/contests/agc017/tasks/agc017_a
//サンプルケースは全て通るが一部のテストケースにおいてWAになります。
//原因がよくわかりません。
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define range(i, a, b) for (int i = a; i < b; ++i)
#define rep(i, n) rang... | a.cc: In function 'int main()':
a.cc:25:31: error: expected ';' before ')' token
25 | for (int i=0;i<N+1,++i){
| ^
| ;
|
s677077266 | p03665 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
using namespace std;
#define ll long long
ll MAX(ll a, ll b) {
if (a > b)return a;
else return b;
}
ll MIN(ll a, ll b) {
if (a < b)return a;
else return b;
}
ll powsur(ll a, ll b, ll... | a.cc: In function 'int main()':
a.cc:122:23: error: 'pow' was not declared in this scope
122 | ans = pow(2, even);
| ^~~
a.cc:131:23: error: 'pow' was not declared in this scope
131 | ans = pow(2, even);
| ^~~
|
s146124228 | p03665 | C++ | #include<iostream>
using namespace std;
typedef long long ll
ll pow(int a,int b){
ll ans=1;
for(int j=0;j<b;j++){
ans*=a;
}
return ans;
}
int main(){
int n,p;
cin>>n>>p;
int a[n];
for(int j=0;j<n;j++){
cin>>a[j];
if(a[j]%2==1){
cout<<pow(2,n-1);
... | a.cc:4:1: error: expected initializer before 'll'
4 | ll pow(int a,int b){
| ^~
a.cc: In function 'int main()':
a.cc:19:19: error: 'pow' was not declared in this scope
19 | cout<<pow(2,n-1);
| ^~~
a.cc:23:19: error: 'pow' was not declared in this scope
23 | if(p==... |
s347767946 | p03665 | C++ | #include<iostream>
using namespace std;
int main(){
int n,p;
cin>>n>>p;
int a[n];
for(int j=0;j<n;j++){
cin>>a[j];
if(a[j]%2==1){
cout<<2**(n-1);
return 0;
}
}
if(p==0)cout<<2**n;
if(p==1)cout<<0;
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:21: error: invalid type argument of unary '*' (have 'int')
10 | cout<<2**(n-1);
| ^~~~~~
a.cc:14:21: error: invalid type argument of unary '*' (have 'int')
14 | if(p==0)cout<<2**n;
| ^~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.