submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s271418864 | p03846 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
const int NUM = 1000000007;
int main() {
int n; cin >> n;
map<int, int> mp;
for (int i = 0; i < n; i++) {
int a; cin >> a;
mp[a]++;
}
if (n % 2 == 0) {
for (int i = 1; i < n; i += 2) {
if (mp[i] != 2) {
cout << 0 << endl;
... | a.cc: In function 'int main()':
a.cc:22:25: error: 'pow' was not declared in this scope
22 | cout << pow(2, n / 2) << endl;
| ^~~
a.cc:36:25: error: 'pow' was not declared in this scope
36 | cout << pow(2, (n - 1) / 2) << endl;
| ... |
s689423094 | p03846 | C++ | #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#define lld long long int
#define DBG1(vari1) cerr<<#vari1<<" = "<<(vari1)<<endl;
#define DBG2(vari1,vari2) cerr<<#vari1<<" = "<<(va... | a.cc: In function 'int power(int, int)':
a.cc:16:14: error: 'll' was not declared in this scope; did you mean 'lld'?
16 | #define MOD (ll)(1e9 + 7)
| ^~
a.cc:22:46: note: in expansion of macro 'MOD'
22 | ans = (ans * base) % MOD;
| ... |
s010558375 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
long long ans=1;
for(int i=0;i<n;i++){
cin>>a[i];
}
sort(a,a+n);
reverse(a,a+n);
if(n%2==0){
for(int i=0;i<n-1;i++){
if(i%2==0){
if(a[i]!=a[i+1]){
cout<<0<<e... | a.cc: In function 'int main()':
a.cc:57:31: error: expected ';' before 'cout'
57 | ans=ans%1000000007
| ^
| ;
58 | cout<<ans<<endl;
| ~~~~
|
s773252904 | p03846 | C++ | #include <iostream>
#include <string>
#include <cstring>
#include <math.h>
#include <cmath>
#include <algorithm>
using namespace std;
int n[1000000];
int N;
long long pow(int n)
{
long long base = 2, ans = 1;
while (n)
{
if (n & 1)
{
ans *= base;
}
base *= bas... | a.cc: In function 'int main()':
a.cc:51:37: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
51 | cout << pow((N - 1) / 2)%10E9+7 << endl;
| ~~~~~~~~~~~~~~~~^~~~~
| | |
| lon... |
s095315811 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
ll MOD = 1e9 + 7;
int n;
cin >> n;
int a[n];
map<int, int> m;
REP(i, n){
cin >> a[i];
m[a[i]]++;
}
bool flag = 0;
if (n % 2){
for (auto x : m){
if (x.first == 0){
if (x.second != 1) flag = 1;
}
else if (x.second != 2) flag = 1... | a.cc: In function 'int main()':
a.cc:7:9: error: 'll' was not declared in this scope
7 | ll MOD = 1e9 + 7;
| ^~
a.cc:12:13: error: 'i' was not declared in this scope
12 | REP(i, n){
| ^
a.cc:12:9: error: 'REP' was not declared in this scope
12 | REP(i, n... |
s247168052 | p03846 | C++ | #include <iostream>
#include <map>
using namespace std;
bool check(map<int, int> reportsMap, int noses) {
int maxReport = noses - 1;
if (noses % 2 == 0) {
for (int i = 1; i <= maxReport; i+=2) {
if (reportsMap[i] != 2) { return false; }
}
} else {
if (reportsMap[0] != 1) { return ... | a.cc:38:1: error: extended character is not valid in an identifier
38 | long long answer = 1;
| ^
a.cc:39:1: error: extended character is not valid in an identifier
39 | for (int j = 0; j < (noses / 2); j++) {
| ^
a.cc:40:1: error: extended character is not valid in an identifier
40 | ... |
s891551890 | p03846 | C++ | #include <algorithm>
#include <string>
using namespace std;
const long mod = 1e9+7;
#define REP(i, n) for(int i = 0; i < (int)n; ++i)
int main() {
int N;
int a;
cin >> N;
vector<int> A;
REP(i, N) {
cin >> a;
A.push_back(a);
}
int init = 0;
if (N % 2 == 0) {
... | a.cc: In function 'int main()':
a.cc:13:5: error: 'cin' was not declared in this scope
13 | cin >> N;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <string>
+++ |+#include <iostream>
3 |
a.cc:14:5: er... |
s504756174 | p03846 | C++ | #include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;
int main() {
int N, A[100000];
cin >> N;
for (int i = 0; i < N; ++i) {
cin >> A[i];
}
sort(A, A + N);
if (N % 2 == 0) {
for (int i = 0; i < N - 3; i += 2) {
if (!(A[i] == A[i + 1] && A[i] + 2 == A[i + 2] &&
... | a.cc: In function 'int main()':
a.cc:43:12: error: expected '}' at end of input
43 | return 0;
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s511244331 | p03846 | C++ | #include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
using namespace std;
int main(){
int n;
cin>>n;
int ans=1;
int t[100010];
int a[100010];
for(int i=0;i<100010;i++){
t[i]=0;
a[i]=0;
}
for(int i=0;i<n;i++){
cin>>t[i];
a[t[i]]++;
}
for(int i=0;i<n;i++){
... | a.cc: In function 'int main()':
a.cc:25:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
25 | if(a>=1 and i%2==0)
| ~^~~
a.cc:31:11: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
31 | if(a>=1 and i%2==1)
| ~^~... |
s105599756 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
template<int mod> struct ModInt {
using ll = long long;
int x;
template<class T>
ModInt(T a) {
x = a % mod;
if (x < 0) {
x += mod;
}
}
ModInt() : x(0) {}
inline ModInt& operator+=(const ModInt& rhs)
{
(*this) += rhs.x;
return *this;
}
template<class... | a.cc:210:5: error: redefinition of 'int main()'
210 | int main()
| ^~~~
a.cc:205:5: note: 'int main()' previously defined here
205 | int main()
| ^~~~
|
s435522992 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long int n;
cin >> n;
long long int a[n];
for(int i=0;i<n;i++)cin >>a[i];
sort(a,a+n);
if (n%2==0){
if(a[0]!=1 || a[1]!=1)cout << 0 <<endl;
else cout << pow(2,n/2)%1000000007<<endl;
}
else{
if(a[0]!=0)cout << 0 <<endl;
else cout ... | a.cc: In function 'int main()':
a.cc:12:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
12 | else cout << pow(2,n/2)%1000000007<<endl;
| ~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s424475725 | p03846 | C++ | #include <iostream>
#include <cmath>
#define MOD = 10^9 + 7
int main()
{
int n;
long long ans = (long long)1;
cin >> n;
vector<int> nums(n + 1, 0);
for (int i = 0; i < n; i++) {
int num;
cin >> num;
nums[num]++;
}
//validation
if (n % 2 == 0) {
for (int i = 1; i <=n; i++9) {
if (... | a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
10 | cin >> n;
| ^~~
| 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 to st... |
s437633094 | p03846 | Java | import java.util.Arrays;
public class Main {
private static java.util.Scanner scanner = new java.util.Scanner(System.in);
public static void main(String[] args) {
int n = scanner.nextInt(), a[] = new int[(n + 1) / 2], max = 0;
for (int i = 0, temp; i < n; i++) {
if (((temp = scanne... | Main.java:28: error: cannot find symbol
Util.println(max, Arrays.toString(a), ans);
^
symbol: variable Util
location: class Main
1 error
|
s869977953 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
const int mod = 1e9+7;
int a[1e5];
int solve(long long n){
int ans=1;
sort( a, a+n );
if( (a[0] && n%2) || (a[0]==n%2 && n%2==0) ){
return 0;
}
if( a[0]==0 ){
a = a+1;
n--;
}
for( int i=0; i<n; i+=2 ){
if( a[i]!=a[i+1] ) return 0;
ans... | a.cc:5:7: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
5 | int a[1e5];
| ^~~
a.cc:5:7: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
5 | int a[1e5];
| ^~~
| |
| double
a.cc:5:7: error: size of a... |
s132051635 | p03846 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
const long long mod = 1e9+7;
long long a[1e5];
long long solve(long long n){
long long ans=1LL;
sort( a, a+n );
if( (a[0] && n%2) || (a[0]==n%2 && n%2==0) ){
return 0LL;
}
if( a[0]==0 ){
a = a+1;
n--;
}
for( long long i=0LL; i<n... | a.cc:5:13: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
5 | long long a[1e5];
| ^~~
a.cc:5:13: error: could not convert '1.0e+5' from 'double' to 'long unsigned int'
5 | long long a[1e5];
| ^~~
| |
| ... |
s594249077 | p03846 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
const long long mod = 1e9+7;
long long a[1e5]
long long solve(long long n){
long long ans=1LL;
sort( a, a+n );
if( (a[0] && n%2) || (a[0]==n%2 && n%2==0) ){
return 0LL;
}
if( a[0]==0 ){
a = a+1;
n--;
}
for( long long i=0LL; i<n;... | a.cc:7:1: error: expected initializer before 'long'
7 | long long solve(long long n){
| ^~~~
a.cc: In function 'int main()':
a.cc:33:12: error: 'a' was not declared in this scope
33 | cin >> a[i];
| ^
a.cc:36:11: error: 'solve' was not declared in this scope
36 | cout << solve(N) ... |
s844393735 | p03846 | C++ | #include<iostream>
#include<algorythm>
using namespace std;
const long long mod = 1e9+7;
long long a[1e5]
long long solve(long long n){
long long ans=1LL;
sort( a, a+n );
if( (a[0] && n%2) || (a[0]==n%2 && n%2==0) ){
return 0LL;
}
if( a[0]==0 ){
a = a+1;
n--;
}
for( long long i=0LL; i<n;... | a.cc:2:9: fatal error: algorythm: No such file or directory
2 | #include<algorythm>
| ^~~~~~~~~~~
compilation terminated.
|
s604978371 | p03846 | C++ | #include<std/c++.h>
using namespace std;
const long long mod = 1e9+7;
long long solve(long long n, vector<long long> a){
long long ans=1LL;
sort( a.begin(), a.end() );
if( (a[0] && n%2) || (a[0]==n%2 && n%2==0) ){
return 0LL;
}
if( a[0]==0 ){
a.erase(a.begin());
n--;
}
for( long long i=0... | a.cc:1:9: fatal error: std/c++.h: No such file or directory
1 | #include<std/c++.h>
| ^~~~~~~~~~~
compilation terminated.
|
s094079512 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
int N;
scanf("%d",&N);
int A[N];
for(int i = 0;i < N;i++){
scanf("%d",&A[i]);
}
if(N % 2 == 0){
for(int i = 1;i < N;i += 2){
int cnt = 0;
for(int j = 0;j < N;j++){
if(i == A[j]){
cnt++;
}
}
if(cnt != 2){... | main.c: In function 'main':
main.c:48:18: error: invalid operands to binary % (have 'float' and 'int')
48 | int ans = ans1 % 1000000007;
| ^
|
s095959105 | p03846 | C++ | //file_name:ABC50_C.cpp
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define max... | a.cc: In function 'int main()':
a.cc:102:13: error: break statement not within loop or switch
102 | break;
| ^~~~~
a.cc:110:22: error: expected ';' before '}' token
110 | break
| ^
| ;
111 | }
| ... |
s848492019 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#define ll long long
#define MOD 1e9+7
ll a[100005];
using namespace std;
int main(){
ll n;
cin>>n;
ll flag=1;//标志
ll ans=1;
if(n%2==0){ //偶数
for(ll i=0;i<n;i++){
ll x;
cin>>x;
a[x]++;
if(x>=n || x%... | a.cc: In function 'int main()':
a.cc:29:42: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
29 | ans=ans*2%MOD;
| ~~~~~^
| |
| ... |
s930055359 | p03846 | C++ | #include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ... | a.cc: In function 'long long int pow_quick(long long int, long long int)':
a.cc:43:16: error: expected '}' at end of input
43 | r %= mod;
| ^
a.cc:41:16: note: to match this '{'
41 | if (b & 1) {
| ^
a.cc:43:16: error: expected '}' at end of input
43 | ... |
s512470411 | p03846 | C++ | #include<bits/stdc++.h>
#include<queue>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int N,ans;
bool flag =true;
cin>>N;
int A[N],B[N]={};
REP(i,N){
cin>>A[i];
B[A[i]]++;
if(B[A[i]]>=3) flag=false;... | a.cc: In function 'int main()':
a.cc:29:10: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
29 | ans=ans%(pow(10,9)+7);
| ~~~^~~~~~~~~~~~~~
| | |
| long long int __gnu_cxx::__promote<dou... |
s812442932 | p03846 | C++ | #include<bits/stdc++.h>
#include<queue>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N,ans;
bool flag =true;
cin>>N;
int A[N],B[N]={};
REP(i,N){
cin>>A[i];
B[A[i]]++;
if(B[A[i]]>=3) flag=false;
}
if(... | a.cc: In function 'int main()':
a.cc:29:10: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
29 | ans=ans%(pow(10,9)+7);
| ~~~^~~~~~~~~~~~~~
| | |
| int __gnu_cxx::__promote<double>::__ty... |
s979981772 | p03846 | C++ | #include<bits/stdc++.h>
#include<queue>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int N,ans;
bool flag =true;
cin>>N;
int A[N],B[N]={};
REP(i,N){
cin>>A[i];
B[A[i]]++;
if(B[A[i]]>=3) flag=false;
}
if... | a.cc: In function 'int main()':
a.cc:31:17: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
31 | else cout<<ans%(pow(10,9)+7);
| ~~~^~~~~~~~~~~~~~
| | |
| int __gnu_... |
s814695973 | p03846 | C++ | #include <iostream># {{{
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <ma... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <iostream># {{{
| ^
a.cc:20:25: error: stray '#' in program
20 | const int MOD = 1e9 + 7;# }}}
| ^
a.cc:20:27: error: expected declaration before '}' token
20 | const int MOD = 1e9... |
s503599887 | p03846 | C++ | #include <iostream># {{{
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <ma... | a.cc:1:20: warning: extra tokens at end of #include directive
1 | #include <iostream># {{{
| ^
a.cc:20:25: error: stray '#' in program
20 | const int MOD = 1e9 + 7;# }}}
| ^
a.cc:20:27: error: expected declaration before '}' token
20 | const int MOD = 1e9... |
s936139304 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 1000000005
#define NIL -1
int main(){
ll n; cin >> n;
bool flg = true;
ll ans = 1;
vector<ll> a(n);
for(ll i = 0; i < n; i++){
... | a.cc: In function 'int main()':
a.cc:18:15: error: no match for 'operator+' (operand types are 'std::vector<long long int>' and 'll' {aka 'long long int'})
18 | sort(a, a + n);
| ~ ^ ~
| | |
| | ll {aka long long int}
| std::vector<long ... |
s408654383 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 1000000005
#define NIL -1
int main(){
ll n; cin >> n;
bool flg = true;
ll ans = 1;
ll a[n];
for(ll i = 0; i < n; i++){
cin >> a... | a.cc: In function 'int main()':
a.cc:20:15: error: request for member 'erase' in 'a', which is of non-class type 'll [n]' {aka 'long long int [n]'}
20 | if(n%2) a.erase(a.begin());
| ^~~~~
a.cc:20:23: error: request for member 'begin' in 'a', which is of non-class type 'll [n]' {aka 'long lon... |
s316389923 | p03846 | C++ | #include <bits/stdc++.h>
#define MOD 1000000007
template<typename T>
T power(T a, T b)
{
T res = 1;
while(b > 0) {
if(b & 1) res = res * a % MOD;
a = a * a % MOD;
b >>= 1;
}
return res;
}
using namespace std;
int main()
{
long N;
long A[100001];
map<long, long> co... | a.cc: In function 'int main()':
a.cc:58:14: error: expected '}' at end of input
58 | return 0;
| ^
a.cc:20:1: note: to match this '{'
20 | {
| ^
|
s853595432 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM = 1000000000;
#define mod = MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
ll n; cin >> n;
ll a[n];
map<ll, int> mp;
ll ans = 0;
for(ll i = 0; i < n; i++){
cin >> a... | a.cc: In function 'int main()':
a.cc:5:13: error: expected primary-expression before '=' token
5 | #define mod = MM + 7;
| ^
a.cc:40:20: note: in expansion of macro 'mod'
40 | ans %= mod;
| ^~~
a.cc:4:12: error: expected primary-expression before '=' token
... |
s377087814 | p03846 | C++ | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;
class Main{
public static void main(String[] args) {
SC sc=new SC(System.in);
int N=sc.nextInt();
int syurui=(N+1)/2;
... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.BufferedReader;
| ^~~~~~
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 '-fm... |
s619935810 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int ans = 0;
bool check=false;
int a[n];
for (int i=0; i<n; i++) {
cin>>a[i];
}
sort(a,a+n);
if(n%2==1){ //奇数個(中央0)
for(int i=0;i<=n/2;i++){
if(a[0]!=0){
break;
}
if(i>0){
if(a[i*2-1]!=i... | a.cc: In function 'int main()':
a.cc:43:35: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'double' to binary 'operator%'
43 | cout << (check?(pow(2,n/2)%(1e9+7)):0) << endl;
| ~~~~~~~~~~^~~~~~~~
| | ... |
s800293896 | p03846 | C++ | N = int(input())
A = [int(x) for x in input().split()]
if not N%2:
result = 2**(N/2)
A.sort()
for i in range(0,N-1,2):
if A[i] != A[i+1]:
result = 0
else:
result = 2**(N/2 - 1)
for i in range(1,N,2):
if A[i] != A[i+1]:
result = 0
print(int(result)) | a.cc:1:1: error: 'N' does not name a type
1 | N = int(input())
| ^
|
s801818951 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,a[100001],temp,flag,mod=(ll)1e9+7;
int main(void){
cin>>n;
for(int i=0;i<n;i++){
cin>>temp;
a[temp]++;
}
if((n+1) % 2 == 0){
if(a[0] != 1)flag=1;
for(int i=1;i<n/2+1;i++){
if(a[i*2] !=... | a.cc: In function 'int main()':
a.cc:21:30: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'll' {aka 'long long int'} to binary 'operator%'
21 | else cout<<pow(2,n/2)%mod<<endl;
| ~~~~~~~~~~^~~~
| | |
... |
s786601560 | p03846 | C++ | #include<iostream>
using namespace std;
int main() {
long long N;
cin >> N;
long long A[N];
for (long long i = 0; i < N; i++) {
cin >> A[i];
}
long long cnt[N + 1] = {};
bool flg = true;
for (long long i = 0; i < N; i++) {
int j = A[i];
cnt[j]++;
}
for (long long i = 0; i < N; i++) {
if (cnt[0] >= 2)... | a.cc: In function 'int main()':
a.cc:43:29: error: invalid operands of types 'int' and 'double' to binary 'operator%'
43 | ans %= (1e9 + 7);
| ~~~~^~~~~~~~~~~~
a.cc:43:29: note: in evaluation of 'operator%=(int, double)'
a.cc:50:29: error: invalid operands of t... |
s242858248 | p03846 | C++ | #include<iostream>
using namespace std;
int main() {
long long N;
cin >> N;
long long A[N];
for (long long i = 0; i < N; i++) {
cin >> A[i];
}
long long cnt[N + 1] = {};
bool flg = true;
for (long long i = 0; i < N; i++) {
int j = A[i];
cnt[j]++;
}
for (long long i = 0; i < N; i++) {
if (cnt[0] >= 2)... | a.cc: In function 'int main()':
a.cc:43:29: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
43 | ans %= (1e9 + 7);
| ~~~~^~~~~~~~~~~~
a.cc:43:29: note: in evaluation of 'operator%=(long long int, double)'
a.cc:50:29: error: i... |
s355226729 | p03846 | C++ | #include<iostream>
#include<vector>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int n; cin >> n;
ll ans;
int n_div = n/2;
vector<int> a(0);
int s;
int count = 0;
for(int i = 1; i <= n; i++){
c... | a.cc: In function 'int main()':
a.cc:41:17: error: invalid operands of types 'long long int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
41 | cout << ans % (pow(10, 9) + 7) << endl;
| ~~~ ^ ~~~~~~~~~~~~~~~~
| | |
| ... |
s718846053 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin >> N;
long long A[N];
for (long long i = 0; i < N; i++) {
cin >> A[i];
}
long long cnt[N] = {};
bool flg = true;
for (long long i = 0; i < N; i++) {
cnt[A[i]]++;
}
for (long long i = 0; i < N; i++) {
if (cnt[0] >= 2) {
flg = f... | a.cc: In function 'int main()':
a.cc:44:21: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
44 | cout << ans % (1e9 + 7);
| ~~~ ^ ~~~~~~~~~
| | |
| | double
| long lon... |
s507920692 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
for (int i = 0; i < N; i++) {
cin >> A[i];
}
int cnt[N] = {};
bool flg = true;
for (int i = 0; i < N; i++) {
cnt[A[i]]++;
}
for (int i = 0; i < N; i++) {
if (A[0] >= 2) {
flg = false;
}
if (i != 0) {
if (A[i] % 2 != 0) {... | a.cc: In function 'int main()':
a.cc:7:24: error: 'A' was not declared in this scope
7 | cin >> A[i];
| ^
a.cc:12:21: error: 'A' was not declared in this scope
12 | cnt[A[i]]++;
| ^
a.cc:15:21: error: 'A' was not declared in t... |
s498265580 | p03846 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int N;
int count;
int answer=1;
bool can = true;
vector<int> A(10000);
cin >> N;
for (int i = 1; i < N + 1; ++i) cin >> A[i];
if (N % 2 == 0) {//Nが偶数の場合
//並びがありうるかどうかの確認
for (int j = 1; j < N ; j=j... | a.cc: In function 'int main()':
a.cc:40:26: error: 'pow' was not declared in this scope
40 | answer = pow(2, N / 2);
| ^~~
|
s588797074 | p03846 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;
int main()
{
int N;
int count;
int answer;
bool can = true;
vector<int> A(10000);
cin >> N;
for (int i = 1; i < N + 1; ++i) cin >> A[i];
if (N % 2 == 0) {//Nが偶数の場合
//並びがありうるかどうかの確認
for (int j = 1; j < N ; j=j+... | a.cc: In function 'int main()':
a.cc:37:26: error: 'pow' was not declared in this scope
37 | answer = pow(2, N / 2);
| ^~~
a.cc:69:26: error: 'pow' was not declared in this scope
69 | answer = pow(2, N / 2);
| ^~~
|
s534253741 | p03846 | C++ | #include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
int mkhash(vector<int> v) {
int h = 0;
for (int i = 0; i < v.size(); i++) {
h += v[i] * pow(10, i);
}
return h;
}
int main(int argc, char const* argv[])
{
cin.tie(0);
ios::sync_with... | a.cc: In function 'int mkhash(std::vector<int>)':
a.cc:10:21: error: 'pow' was not declared in this scope
10 | h += v[i] * pow(10, i);
| ^~~
|
s439212600 | p03846 | C++ | 8
7 5 1 1 7 3 5 3
| a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 8
| ^
|
s968531437 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+100;
const long long Mod = 1e9+7;
long long ans, a, t[maxn],n;
int main(){
cin >> n;
for(int i=0; i<n; i++){
cin >> a;
t[a]++;
}
ans = 1;
if(n%2 == 1){
for(int i=0; i<n; i+=2){
if((i!=0 && t[i]!... | a.cc: In function 'int main()':
a.cc:34:15: error: invalid operands of types '<unresolved overloaded function type>' and 'long long int' to binary 'operator<<'
34 | count << ans;
| ~~~~~~^~~~~~
|
s133362193 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%d”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%d”,&a[i]);
}
long temp;
for(long i=0;i<n;i++){//sort
for(long j=i+1;j<n;j++){
if(a[i]>a[j]){
temp=a[j];
a[j]=a[i];
... | main.c: In function 'main':
main.c:5:10: error: stray '\342' in program
5 | scanf(<U+201C>%d<U+201D>,&n);
| ^~~~~~~~
main.c:5:11: error: expected expression before '%' token
5 | scanf(“%d”,&n);
| ^
main.c:5:13: error: stray '\342' in program
5 | scanf(<U+201C>%d<U+201... |
s509982248 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
long temp;
for(long i=0;i<n;i++){//sort
for(long j=i+1;j<n;j++){
if(a[i]>a[j]){
temp=a[j];
a[j]=a[i];
... | main.c: In function 'main':
main.c:5:10: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:11: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:14: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+... |
s201163980 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
long temp;
for(long i=0;i<n;i++){//sort
for(long j=i+1;j<n;j++){
if(a[i]>a[j]){
temp=a[j];
a[j]=a[i];
... | main.c: In function 'main':
main.c:5:10: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:11: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:14: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+... |
s281747394 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
int chek=0;
for(long i=0;i<(n/2)+n%2;i++){
chek=0;
if(n%2==1){
for(long j=0;j<n;j++){
if(i==0){
if(i==a[j... | main.c: In function 'main':
main.c:5:9: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:10: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:13: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,... |
s574515531 | p03846 | C | #include<stdio.h>
#include<math.h>
int main(){
long n;
scanf(“%ld”,&n);
long a[n];
int ans=1;
for(long i=0;i<n;i++){
scanf(“%ld”,&a[i]);
}
int chek=0;
for(long i=0;i<(n/2)+n%2;i++){
chek=0;
if(n%2==1){
for(long j=0;j<n;j++){
if(i==0){
if(i==a[j... | main.c: In function 'main':
main.c:5:9: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,&n);
| ^~~~~~~~
main.c:5:10: error: expected expression before '%' token
5 | scanf(“%ld”,&n);
| ^
main.c:5:13: error: stray '\342' in program
5 | scanf(<U+201C>%ld<U+201D>,... |
s193645370 | p03846 | C++ | #include <stdio.h>
int main(void)
{
int n,a[100001];
scanf("%d",&n);
for(i=0; i<n; i++)scanf("%d",&a[i]);
puts("0");
return 0;
} | a.cc: In function 'int main()':
a.cc:6:13: error: 'i' was not declared in this scope
6 | for(i=0; i<n; i++)scanf("%d",&a[i]);
| ^
|
s124088668 | p03846 | C++ | #include <algorithm>
#include <bitset>
#include <cstdio>
#include <functional>
#include <initializer_list>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#i... | a.cc: In function 'int main()':
a.cc:47:7: error: 'i' was not declared in this scope
47 | if (i % 2 == = 0) {
| ^
a.cc:47:16: error: expected primary-expression before '=' token
47 | if (i % 2 == = 0) {
| ^
|
s087262305 | p03846 | C | #include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int a[n/2+!],i,j;
long ans=1,tmp=0;
for(i=0;i<n/2+1;i++)a[i]=0;
if(n%2==0)a[n/2]=2;
for(i=0;i<n;i++){
scanf("%d",&tmp);
a[tmp/2]++;
}
for(i=0;i<n/2+1;i++){
if(n%2==0){
if(a[i]!=2){
puts("0");
return 0;
}
... | main.c: In function 'main':
main.c:6:28: error: expected expression before ']' token
6 | int a[n/2+!],i,j;
| ^
|
s499812378 | p03846 | C | #include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int a[n],i,j;
long ans=1;
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(a[i]<a[j]){
int tmp=a[i];
a[i]=a[j];
a[j]=tmp;
}
}
}
if(n%2==1){
int tmp=a[0];
if(a[0]!=0||a[... | main.c: In function 'main':
main.c:34:52: error: 'tmp' undeclared (first use in this function)
34 | if(tmp!=a[i]-2){
| ^~~
main.c:34:52: note: each undeclared identifier is reported only once for each function it... |
s224472923 | p03846 | C | #include<stdio.h>
int main(){
int n;
scanf("%d",&n);
int a[n],i,j;
long ans=1;
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<n;i++){
for(j=0;j<n;j++){
if(a[i]<a[j]){
int tmp=a[i];
a[i]=a[j];
a[j]=tmp;
}
}
}
if(n%2==1){
int tmp=a[0];
for(i=2;i<n;i+... | main.c: In function 'main':
main.c:22:60: error: subscripted value is neither array nor pointer nor vector
22 | if(tmp!=tmp[i]-2){
| ^
main.c:36:60: error: subscripted value is neither array nor pointer n... |
s064644147 | p03846 | C++ | #include <string.h>
#include <iostream>
#include <math.h>
using namespace std;
int main() {
cout<<(int)pow(2, N / 2) % 1000000007<<endl;
} | a.cc: In function 'int main()':
a.cc:6:19: error: 'N' was not declared in this scope
6 | cout<<(int)pow(2, N / 2) % 1000000007<<endl;
| ^
|
s803511500 | p03846 | C++ | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main(){
long long N;
cin >> N;
bool odd;
if(N % 2) odd = true;
else odd = false;
vector<int> A(N), cnt(n);
for(int i = 0; i < N; i++){
cin >> A[i];
cnt[A[i]]++;
}
bool exist_ans = true;
... | a.cc: In function 'int main()':
a.cc:13:27: error: 'n' was not declared in this scope
13 | vector<int> A(N), cnt(n);
| ^
|
s310736873 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
int n,a[500000],t[500000],tag,an;
int main(){
cin>>n;
for(int i=0;i<n;i++){
cin>>a[i];
t[a[i]]++;
}
for(int i=1;i<n+5;i++){
if(t[i]%2==1)tag=1;
}
if(tag==0){
for(int i=1;i<n+5;i++){
if(t[i]>0)an++;
... | a.cc: In function 'int main()':
a.cc:19:24: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
19 | cout<<pow(2,an)%1000000007<<endl;
| ~~~~~~~~~^~~~~~~~~~~
| | |
| | ... |
s559609568 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
int n, a[100005];
bool flag;
int main()
{
cin >> n;
for(int i = 0; i < n; i++){
cin >> a[i];
}
sort(a, a + n);
if(n % 2){
if(a[0] == 0){
ans = 1;
}
}
else{
if(a[0] == a[1]){
ans = 2;
}
}
int j = 1;
for(int i = (n % 2 ? 2 : ... | a.cc: In function 'int main()':
a.cc:14:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | ans = 1;
| ^~~
| abs
a.cc:19:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
19 | ans = 2;
| ^~~
| abs
a.cc:25:7: error: ... |
s032185146 | p03846 | C++ | #include <iostream>
#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++)
ll a[100001] = {};
ll b[100001] = {};
int main() {
ll N; cin >> N;
repe(i, 1, N) {
cin >> a[i];
b... | a.cc: In function 'int main()':
a.cc:51:17: error: 'pow' was not declared in this scope
51 | cout << pow(2, N / 2);
| ^~~
|
s626631198 | p03846 | C++ | #include<iostream>
#include<math.h>
using namespace std;
int main(){
int n;cin>>n;
int a[n];
int b[n];
for(int i=0;i<n;i++)b[i]=0;
for(int i=0;i<n;i++)cin>>a[i];
for(int i=0;i<n;i++)b[a[i]]++;
if(n%2==0){
for(int i=1;i<n;i+=2){
if(b[i]!=2){
cout<<0<<endl;
return 0;
}
}... | a.cc: In function 'int main()':
a.cc:28:19: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
28 | cout<<pow(2,n/2)%1000000007<<endl;
| ~~~~~~~~~~^~~~~~~~~~~
| | |
| | int
| ... |
s113562097 | p03846 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int a[n];
int box[n]={0};
for(int i=0;i<n;i++){
cin>>a[i];
box[a[i]]++;
}
int m=0;
long long int x=1
int mod=1000000007;
if(n%2==0){
for(int i=0;i<n;i++){
if(box[i]==1||box[i]>2){
cout<<0<<endl;
return 0;
}
}
for(int i... | a.cc: In function 'int main()':
a.cc:15:9: error: expected ',' or ';' before 'int'
15 | int mod=1000000007;
| ^~~
a.cc:26:20: error: 'mod' was not declared in this scope
26 | x%=mod;
| ^~~
a.cc:43:20: error: 'mod' was not declared in this scope
43 ... |
s871366608 | p03846 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int n, a[100000], i, cnt = 0, sum = 1, j, k = 0,x;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (a[i] == a[j]&&i!=j) {
cnt += 1;
}
}
if (cnt != 1 && a[i] != 0... | a.cc: In function 'int main()':
a.cc:28:27: error: lvalue required as left operand of assignment
28 | if(x%2=0){
| ~^~
|
s102165579 | p03846 | C++ | int main() {
int n, a[100000], i, cnt = 0, sum = 1, j, k = 0;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if (a[i] == a[j]&&i!=j) {
cnt += 1;
}
}
if (cnt != 1 && a[i] != 0 || cnt != 0 && a[i] == 0) {
printf("0");
k = 1... | a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
3 | scanf("%d", &n);
| ^~~~~
a.cc:14:25: error: 'printf' was not declared in this scope
14 | printf("0");
| ^~~~~~
a.cc:1:1: note: 'printf' is define... |
s932700829 | p03846 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main() {
int n, a[100000], i, cnt = 0, max = 0, sum = 1,j;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
if (a[i] == 0) {
cnt = 1;
}
if (a[i] >= max) {
max = a[i];
}
}
for (i = 0; i < n; i++) {
for (j = 0; j < n; j++) {
if... | a.cc: In function 'int main()':
a.cc:32:27: error: expected '}' at end of input
32 | printf("%d", sum);
| ^
a.cc:3:12: note: to match this '{'
3 | int main() {
| ^
|
s741037248 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;
int X[10000];
int mod = 1e9 + 7;
int main() {
int N;
long long int Y = 0;
int Z = 0;
int a;
cin >> N;
for (int i... | a.cc:88:5: error: redefinition of 'int X [10000]'
88 | int X[10000];
| ^
a.cc:13:5: note: 'int X [10000]' previously declared here
13 | int X[10000];
| ^
a.cc:89:5: error: redefinition of 'int mod'
89 | int mod = 1e9 + 7;
| ^~~
a.cc:14:5: note: 'int mod' previously defined here
... |
s793060804 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;
int X[10000];
int main() {
int N;
long long int Y = 0;
int Z = 0;
int a;
cin >> N;
for (int i = 0; i < N; i++) {... | a.cc: In function 'int main()':
a.cc:63:10: error: expected '}' at end of input
63 | }
| ^
a.cc:15:12: note: to match this '{'
15 | int main() {
| ^
|
s527464859 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include<map>
using namespace std;
int X[10000];
int main() {
int N;
long long int Y = 0;
int Z = 0;
int a;
cin >> N;
for (int i = 0; i < N; i++) {... | a.cc: In function 'int main()':
a.cc:59:10: error: expected '}' at end of input
59 | }
| ^
a.cc:15:12: note: to match this '{'
15 | int main() {
| ^
|
s258555034 | p03846 | C++ | #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int N, temp;
bool c = true
long long ans = 1;
int line[100100];
void checkList(){
if(N % 2 == 1){
/*if(line[0] != 0){
return 0;
}
for(int i = 0; i < N; i++){
temp = i;
if(i % 2... | a.cc:9:1: error: expected ',' or ';' before 'long'
9 | long long ans = 1;
| ^~~~
a.cc: In function 'int main()':
a.cc:67:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
67 | ans *= 2;
| ^~~
| abs
a.cc:69:13: error: 'ans' was not declared in this scope... |
s142108900 | p03846 | C++ | #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
int N, temp;
int ans = 1;
int line[100100];
int checkList(){
if(N % 2 == 1){
if(line[0] != 0){
return 0;
}
for(int i = 0; i < N; i++){
temp = i;
if(i % 2 == 1){
... | a.cc: In function 'int checkList()':
a.cc:29:22: error: expected primary-expression before ';' token
29 | return ans % ;
| ^
|
s032509204 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n,a[100005];
cin>>n;
for(int i=0;i<n;i++) cin>>a[i];
sort(a,a+n);
bool check = true;
if(n%2!=0){
int m=2;
if(a[0]!=0)check=false;
for(int i=1;i<n;){
if(a[i]!=m||a[i+1]!=m)check=false;
m += 2;
i += 2;
}
}
if(n%2==0){
int m=1;
... | a.cc: In function 'int main()':
a.cc:30:38: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%'
30 | if(check==1){cout<<pow(2,n/2)%ex<<endl;}
| ~~~~~~~~~~^~~
| | ... |
s463888013 | p03846 | C++ | #include <iostream>
using namespace std;
int main(){
int n;
cin >> n;
int array[n];
for(int i = 0; i<n; i++){
cin >> array[i];
}
sort(array, array+n);
bool flag = true;
int ans = 1;
if(n%2==0){
for(int i=0; i<n; i++){
if(array[i] != i/2 * 2 + 1){
... | a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(array, array+n);
| ^~~~
| short
|
s413971973 | p03846 | C++ | #include<iostream>
#include<math.h>
#include<algorithm>
using namespace std;
long long judge(int N, int line[]){
int temp;
if(N % 2 == 0){
for(int i = 0; i < N; i++){
temp = i;
if(i % 2 == 0){
temp++;
}
if(line[i] != temp){
... | a.cc:21:53: error: exponent has no digits
21 | return (long long)powl(2, N/2) % (long long)1ep + 7;
| ^~~
|
s059587764 | p03846 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
#define mod 1000000007
int x[100010];
int main(){
int n; cin >> n;
for (int i = 0; i < n; i++) {
int k;
cin >> k;
x[k]++;
}
if (n % 2 == 1) {
bool flag = true;
long long ans = 1;
if (x[0] != 1) flag = false;
for (int i = 2;... | a.cc:42:5: error: redefinition of 'int x [100010]'
42 | int x[100010];
| ^
a.cc:5:5: note: 'int x [100010]' previously declared here
5 | int x[100010];
| ^
a.cc:44:5: error: redefinition of 'int main()'
44 | int main(){
| ^~~~
a.cc:7:5: note: 'int main()' previously defined here
... |
s034754808 | p03846 | C++ | #include <iostream>
using namespace std;
#define mod 1000000007
int x[100010];
int main(){
int n; cin >> n;
for (int i = 0; i < n; i++) {
int k;
cin >> k;
x[k]++;
}
if (n % 2 == 1) {
bool flag = true;
long long ans = 1;
if (x[0] != 1) flag = false;
for (int i = 2; i < n; i += 2) {
... | a.cc:41:5: error: redefinition of 'int x [100010]'
41 | int x[100010];
| ^
a.cc:4:5: note: 'int x [100010]' previously declared here
4 | int x[100010];
| ^
a.cc:43:5: error: redefinition of 'int main()'
43 | int main(){
| ^~~~
a.cc:6:5: note: 'int main()' previously defined here
... |
s363842988 | p03846 | C++ | #include<iostream>
#include<string>
#include<cmath>
using namespace std;
typedef long long ll;
int main(){
int n;
int A[100100];
const int MOD = 1e9+7;
cin >> n;
for(int i = 0; i < n; i++) {int p; cin >> p; A[p]++;}
long long ans = 1;
flag = 1;
if(n % 2 == 1){
if(A[0] != 1) {flag = 0;}
for(int i = 2; i < n; i+... | a.cc: In function 'int main()':
a.cc:19:1: error: 'flag' was not declared in this scope
19 | flag = 1;
| ^~~~
|
s431321416 | p03846 | C++ | #include<iostream>
#include<string>
#include <cmath>
using namespace std;
typedef long long ll;
int main(){
ll ans = 1;
int a[100100];
const int MOD = 1e9+7;
int n;
cin >> n;
for(int i = 0; i < n; i++) {int p; cin >> p; a[p]++;}
if(n % 2 == 1) {
if(a[0] != 1) ans = 0;
else for(int i = 2; i < n; i+=2)
if(a[i] == ... | a.cc: In function 'int main()':
a.cc:22:24: error: expected ';' before 'return'
22 | else {cout << 0 << endl return 0;}
| ^~~~~~~
| ;
a.cc:28:25: error: expected ';' before 'return'
28 | else {cout << 0 << endl return 0;}
| ^... |
s403248859 | p03846 | C++ | #include<iostream>
#include<string>
#include <cmath>
using namespace std;
int main(){
ll n,p,i,ans = 1;
int a[100000];
const int MOD = 1e9+7;
cin >> n;
for(i = 0; i < n; i++) {cin >> p; a[p]++;}
if(n % 2 == 1) {
if(a[0] != 1) ans = 0;
else for(i = 2; i < n; i+=2){
if(a[i] == 2) (ans *= 2) %= MOD;
else {ans = 0;... | a.cc: In function 'int main()':
a.cc:8:1: error: 'll' was not declared in this scope
8 | ll n,p,i,ans = 1;
| ^~
a.cc:13:8: error: 'n' was not declared in this scope
13 | cin >> n;
| ^
a.cc:15:5: error: 'i' was not declared in this scope
15 | for(i = 0; i < n; i++) {cin >> p; a[p]++;}
... |
s108981460 | p03846 | C++ | #include<iostream>
#include<string>
#include <cmath>
#define MOD 1000000007
using namespace std;
int main(){
int n,p,i,ans = 1;
int a[100000];
cin >> n;
for(i = 0; i < n; i++) {cin >> p; a[p]++;}
if(n % 2 == 1) {
if(a[0] != 1) ans = 0;
else for(i = 2; i < n; i+=2){
{if(a[i] != 2) ans = 0; break;}
}
}
else
for(i... | a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:7:11: note: to match this '{'
7 | int main(){
| ^
|
s352657943 | p03846 | C++ | #include<iostream>
#include<string>
#include <cmath>
#define INF 1000000007
using namespace std;
int main(){
int n,p,i,ans = 1;
int a[100000];
cin >> n;
for(i = 0; i < n; i++) {cin >> p; a[p]++;}
if(n % 2 == 1) {
if(a[0] != 1) ans = 0;
else for(i = 2; i < n; i+=2){
{if(a[i] != 2) ans = 0; break;}
}
}
else
for(i... | a.cc: In function 'int main()':
a.cc:29:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
29 | else cout << pow(2,n/2) % INF <<endl;
| ~~~~~~~~~~ ^
| |
| __gnu_cxx::__promote<double... |
s290450053 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[100005];
int main(){
int n;
cin >> n;
int ma = 0;
for(int i=0; i < n; i++){
int temp;
cin >> temp;
ma = max(ma, temp);
a[temp] += 1;
}
int flag = 0;
int Flag = 0;
while(ma > 0){
if(a[ma] == 2... | a.cc: In function 'int main()':
a.cc:28:36: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
28 | long long res = (pow(2, n / 4) % 1000000007) * (pow(2, n / 4) % 1000000007) % 1000000007;
| ~~~~~~~~~~~~~ ^ ~~~~~~~~~~... |
s272781637 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int a[100005];
int main(){
int n;
cin >> n;
int ma = 0;
for(int i=0; i < n; i++){
int temp;
cin >> temp;
ma = max(ma, temp);
a[temp] += 1;
}
int flag = 0;
while(ma > 0){
if(a[ma] == 2) flag = 1;
... | a.cc: In function 'int main()':
a.cc:27:54: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
27 | if(n % 2 == 1 and a[0] == 1) cout << pow(2, n/2) % (1000000007) << endl;
| ~~~~~~~~~~~ ^ ~~~~~~~~~... |
s975680186 | p03846 | C++ | #include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[100010], count[100010] = {0};
for (int i = 0; i < n; i++) {
cin >> a[i];
count[a[i]]++;
}
if (n%2 == 1) {
count[0]++;
}
for (int i = (n+1)%2; i < n; i += 2) {
if (conut[i] ... | a.cc: In function 'int main()':
a.cc:22:13: error: 'conut' was not declared in this scope; did you mean 'count'?
22 | if (conut[i] != 2) {
| ^~~~~
| count
|
s269508184 | p03846 | C++ | #include <iostream>
#include <vector>
#include <math.h>
#include <iomanip>
#include <algorithm>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ls(n);
for (int i = 0; i < n; i++) {
cin >> ls[i];
}
std::sort(ls.begin(), ls.end());
if (n % 2 == 0) {
int count... | a.cc: In function 'int main()':
a.cc:31:23: error: no matching function for call to 'stoull(__gnu_cxx::__promote<double>::__type)'
31 | cout << stoull(fmod(pow(2, n / 2), 1000000007));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
... |
s637281969 | p03846 | C++ | #include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<int> ls(n);
for (int i = 0; i < n; i++) {
cin >> ls[i];
}
sort(ls.begin(), ls.end());
if (n % 2 == 0) {
int count = 1;
for (int i = 0; i < n; i++) {
... | a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
15 | sort(ls.begin(), ls.end());
| ^~~~
| sqrt
|
s436239534 | p03846 | C++ | #include <iostream>
#include <array>
#include <math.h>
using namespace std;
int main() {
int n;
cin >> n;
int ls[n];
for (int i = 0; i < n; i++) {
cin >> ls[i];
}
sort(ls, ls + n);
if (n % 2 == 0) {
int count = 1;
for (int i = 0; i < n; i++) {
if(ls[i]... | a.cc: In function 'int main()':
a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
15 | sort(ls, ls + n);
| ^~~~
| sqrt
|
s224148663 | p03846 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int sum = 0, ans = 1;
for(int i = 0; i < n; i++) {
sum += sc.nextInt();
}
int key = 0;
for(int i = n; i > 1; i -= 2) {
key += n - 1;
}
key *= 2;
if(sum ... | Main.java:20: error: ';' expected
ans = ans % (1000000000 + 7)
^
1 error
|
s418145829 | p03846 | C++ | using namespace std;
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
typedef long long ll;
typedef pair<int,int> p;
#define rep(i, n) for(int (i) = 0; (... | a.cc: In function 'int main()':
a.cc:44:32: error: invalid operands of types 'll' {aka 'long long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
44 | result = ((result + 1) % (pow(10,9) + 7));
| ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~
| ... |
s012445361 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
int main() {
int N;
cin >> N;
long a[N];
unordered_map<long, long> aMap;
for (int i = 0; i < N; ++i) {
cin >> a[i];
if (aMap.find(a[i]) == aMap.end()) {
aMap[a[i]] = 1;
} el... | a.cc: In function 'int main()':
a.cc:43:23: error: 'pow' was not declared in this scope
43 | cout << round(pow(2, (N - 1) / 2)) << endl;
| ^~~
a.cc:43:17: error: 'round' was not declared in this scope
43 | cout << round(pow(2, (N - 1) / 2)) << endl;
| ... |
s943661639 | p03846 | C++ | #include <iostream>
#include <unordered_map>
using namespace std;
int main() {
#ifdef __APPLE__
freopen("input2.txt", "r", stdin);
#endif
int N;
cin >> N;
long a[N];
unordered_map<long, long> aMap;
for (int i = 0; i < N; ++i) {
cin >> a[i];
if (aMap.find(a[i]) == aMap.end()) {... | a.cc: In function 'int main()':
a.cc:44:23: error: 'pow' was not declared in this scope
44 | cout << round(pow(2, (N - 1) / 2)) << endl;
| ^~~
a.cc:44:17: error: 'round' was not declared in this scope
44 | cout << round(pow(2, (N - 1) / 2)) << endl;
| ... |
s303013527 | p03846 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int main() {
int N;
cin >> N;
vector <ll> A(N);
for (int i=0; i<N; i++) {
cin >> A[i];
}
if (N%2==1) {
a.push_back(0);
}
sort(A.begin(),A.end());
for (int i=0; i<N; i+=2) ... | a.cc: In function 'int main()':
a.cc:16:5: error: 'a' was not declared in this scope
16 | a.push_back(0);
| ^
|
s801746747 | p03846 | C++ | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
int main() {
int N;
cin >> N;
vector <ll> a(N);
for (int i=0; i<N; i++) {
cin >> a[i];
}
if (N%2==1) {
a.push_back(0);
}
sort(a.begin(),a.end());
for (int i=0; i<N; i+=2) {
if (a[i]!=a[i+... | a.cc: In function 'int main()':
a.cc:18:3: error: 'sort' was not declared in this scope; did you mean 'short'?
18 | sort(a.begin(),a.end());
| ^~~~
| short
|
s301393767 | p03846 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextInt();
int[] a = new int[n];
int[] b = new int[100001];
for(int i = 0 ; i < n ; i++) a[i] = sc.nextInt();
long ans = 1;
for(int i = 0 ; i < n ; i++) b[a[i]]++;
if... | Main.java:7: error: incompatible types: possible lossy conversion from long to int
int[] a = new int[n];
^
1 error
|
s148067250 | p03846 | C++ | #include <iostream>
#include <math.h>
#include <algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++) {
cin >> a[i];
}
sort (a, a + n);
int ans1 = 0;
if (n % 2 == 1) {
int ans = 0;
for (int i = 0; i < n; i++) {
... | a.cc: In function 'int main()':
a.cc:43:34: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
43 | cout << pow(2, n / 2)% (pow(10,9) + 7);
| ~~~~~~~~~~~~~^ ~~~~~~... |
s984455543 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define DEBUG(x) cerr << #x << ": " << x << endl;
#define MAX 1000000007;
int main() {
int n;
cin >> n;
vector<int> A;
for (int i = 0; i < n; i++) {
int x;
cin >> x;
A.push_back(x);
}
vector<int> B;
// 要素数が偶数の時
if (... | a.cc: In function 'int main()':
a.cc:66:23: error: expected primary-expression before '<<' token
66 | cout << ans % MAX << endl;
| ^~
|
s912711051 | p03846 | C++ | #include <bits\stdc++.h>
using namespace std;
int n,cnt[1000005],i,x;
long long ans;
int main()
{
cin>>n;
for (i=1;i<=n;i++)
{
cin>>x;
cnt[x]++;
}
if (n&1)
{
for (i=2;i<=n;i+=2)
{
if (cnt[i]!=2)
{
cout<<0;
return 0;
}
}
if (cnt[0]!=1)
{
cout<<0;
return 0;
}
}
else
{
for... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s845407028 | p03846 | C++ | #include <bits\stdc++.h>
using namespace std;
int n,cnt[1000005],i,x;
long long ans;
int main()
{
cin>>n;
for (i=1;i<=n;i++)
{
cin>>x;
cnt[x]++;
}
if (n&1)
{
for (i=2;i<=n;i+=2)
{
if (cnt[i]!=2)
{
cout<<0;
return 0;
}
}
if (cnt[0]!=1)
{
cout<<0;
return 0;
}
}
else
{
for... | a.cc:1:10: fatal error: bits\stdc++.h: No such file or directory
1 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s531056551 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#... | a.cc: In function 'int main()':
a.cc:35:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'long long unsigned int [100001]')
35 | cin>>b;
| ~~~^~~
| | |
| | long long unsigned int [100001]
| ... |
s554262923 | p03846 | C++ | #include<iostream>
using namespace std;
#include<vector>
#include<set>
int main(){
int n;
cin>>n;
vector<int> a(n);
vector<int> ans(n,0);
long long int ansr=1;
for(int i = 0;i<n;i++){
cin>>a[i];
ans[a[i]]++;
}
if(n%2==1)ans[0]++;
for(int i = 1-n%2;i<n;i+=2){
if(ans[i]!=2){
cout<<0<<endl;
return 0;... | a.cc: In function 'int main()':
a.cc:23:33: error: expected ';' before '}' token
23 | ansr%=1000000007
| ^
| ;
24 | }
| ~
|
s001720183 | p03846 | C++ | #include <cstdio>
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <stack>
#include <functional>
#include <set>
#include <map>
#include <deque>
#define NMAX 100005
#define MMAX 103
//コメントアウトするとdebug()を実行しない
#define DEBUG
using namespace std;
... | a.cc: In function 'int solve()':
a.cc:35:28: error: no matching function for call to 'std::vector<int>::push_back()'
35 | T.push_back();
| ~~~~~~~~~~~^~
In file included from /usr/include/c++/14/vector:66,
from a.cc:5:
/usr/include/c++/14/bits/stl_vector.h:1283:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.