submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s743522553 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef long double ld;
int main(){
int t=1;
//cin>>t;
while(t--){
int n;
cin>>n;
ll MOD=1e9+7;
map<int,int> a;
for(int i=0;i<n;i++){
int x;
cin>>x... | a.cc: In function 'int main()':
a.cc:29:29: error: 'N' was not declared in this scope
29 | for (int i=0; i<N/2; i++) {
| ^
a.cc:48:29: error: 'N' was not declared in this scope
48 | for (int i=0; i<N/2; i++) {
| ^
|
s801840166 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef long long ll;
typedef long double ld;
int main(){
int t=1;
//cin>>t;
while(t--){
int n;
cin>>n;
map<int,int> a;
for(int i=0;i<n;i++){
int x;
cin>>x;
a[x]++;
... | In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterato... |
s455577494 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define f first
#define s second
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(A... | a.cc: In function 'void solve()':
a.cc:40:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
40 | cout<<pow(2,n/2)%MOD<<endl;
| ~~~~~~~~~~^
| |
| __gnu_cxx::__promote<doub... |
s122258684 | p03846 | Java | import java.util.*;
import java.math.*;
public class Main {
static BigDecimal a = new BigDecimal("2");
static BigDecimal b = new BigDecimal("2");
static BigDecimal c = new BigDecimal("1000000007");
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N= sc.nextInt();... | Main.java:31: error: cannot find symbol
a = a.multiply(b);
^
symbol: method multiply(BigDecimal)
location: variable a of type int[]
Main.java:33: error: cannot find symbol
a = a.remainder(c);
^
symbol: method remainder(BigDecimal)
location: variable a of type int[]
2 er... |
s567606913 | p03846 | C++ | #include <iostream>
#include<cmath>
using namespace std;
int find(int arr[], int i, int num){
for(int j=0;j<i;j++){
if(arr[j]==num){
return j;
}
}
return -1;
}
int main() {
int a;
cin>>a;
int a_len=a;
int arr[a];
for(int i=0;i<a;i++){
cin>>arr[i];
}
bool fail=false;
if(a%2==1){
int j=find(arr,a,0)... | a.cc: In function 'int main()':
a.cc:67:39: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'double' to binary 'operator%'
67 | cout<<pow(2.0,a_len/2)%pow(10.0,9.0)+7<<endl;
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
| ... |
s666791366 | p03846 | C++ | #include <iostream>
#include<algorithm>
using namespace std;
const int P=1000000007;
int main() {
int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
if(n%2==0){
int x=1;
for(int i=0;i<n;i+=2){
if(arr[i]==i+1 and arr[i+1]==i+1){
x*=2;
x%=P;
}e... | a.cc: In function 'int main()':
a.cc:41:10: error: expected '}' at end of input
41 | }
| ^
a.cc:26:8: note: to match this '{'
26 | }else{
| ^
a.cc:41:10: error: expected '}' at end of input
41 | }
| ^
a.cc:5:12: note: to match this '{'
5 | int ma... |
s965208132 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod ll(1e9+7)
ll power(ll x){
ll temp=1;
for(ll i=0;i<x;i++){
temp=((temp%mod)*(2%mod))%mod;
}
return temp;
}
int main()
{
ll i,n,a[1000000],status=0,temp=0,cou=0,ans;
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
... | a.cc: In function 'int main()':
a.cc:22:12: error: lvalue required as left operand of assignment
22 | if(n==1&&a[0]=0)
| ~~~~^~~~~~
|
s806435462 | p03846 | C++ |
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
ll i,n,a[1000000],status=0,temp=0,cou=0;
cin>>n;
for(i=0;i<n;i++)
{
cin>>a[i];
}
sort(a,a+n);
if(n%2==0)
{
status=0;
}
else
{
status=1;
}
if(status==0)
{
... | a.cc: In function 'int main()':
a.cc:80:18: error: invalid operands of types 'll' {aka 'long long int'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
80 | cout<<(cou*2)%(pow(10,9)+7);
| ~~~~~~~^~~~~~~~~~~~~~
| | |
| ... |
s585418854 | p03846 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_multiset tree<long long , null_type,less_equal<long long >, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set tree<long long , null_type,less<long long >, r... | a.cc: In function 'long long int biexp(long long int, long long int)':
a.cc:23:18: error: expected ';' before 'return'
23 | res=(res%mod)
| ^
| ;
24 | return res;
| ~~~~~~
a.cc:23:8: warning: control reaches end of non-void function [-Wreturn... |
s017911909 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#define ll long long
ll MOD=1e9+7;
ll a[100005];
using namespace std;
int main(){
ll n;
cin>>n;
ll flag=1;//flag
ll ans=1;
if(n%2==0){ // even number
for(ll i=0;i<n;i++){
ll x;
cin>>x;
a[x]++;//a[7]... | a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before '/' token
26 | / / give data x error
| ^
a.cc:26:27: error: expected primary-expression before '/' token
26 | / / give data x error
| ... |
s795066626 | p03846 | C++ | using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const int MAXN = 100100;
const int MOD = 1e9+7;
int cnt[MAXN];
int solve(int N) {
ll ans = 1;
if (N % 2 == 1) {
if (cnt[0... | a.cc:4:9: error: 'pair' does not name a type
4 | typedef pair<int, int> pii;
| ^~~~
a.cc:5:9: error: 'vector' does not name a type
5 | typedef vector<int> vi;
| ^~~~~~
a.cc: In constructor 'cww::cww()':
a.cc:6:18: error: 'ios' has not been declared
6 | struct cww{cww(){ios::sync_... |
s202458152 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define rep(i,n) for(int i = 0 ; i < n ;i++)
int end(){
cout << 0 << endl;
return 0 ;
}
ll const mod = 1e9+7 ;
int main(){
int n ;
cin >> n ;
ll ans = 1 ;
map<int,int> mp ;
rep(i,n){
int a ;
cin >> a ;
... | a.cc: In function 'int main()':
a.cc:41:2: error: expected '}' at end of input
41 | }
| ^
a.cc:13:11: note: to match this '{'
13 | int main(){
| ^
|
s739330409 | p03846 | C++ | #ifdef DEBUG
#else
# pragma GCC optimize("O3,no-stack-protector")
# pragma GCC optimize("unroll-loops")
# if __cplusplus < 201703L
# pragma GCC target("avx")
# else
# pragma GCC target("avx2")
# endif
#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tun... | a.cc: In function 'int main()':
a.cc:116:21: error: no matching function for call to 'modpow(long long int, long long int, const Int&)'
116 | ans = modpow(2LL, (n / 2LL), MOD);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~
a.cc:32:3: note: candidate: 'template<class T> T modpow(T, T, T)'
32 | T modpow(... |
s509245728 | p03846 | C++ | #ifdef DEBUG
#else
# pragma GCC optimize("O3,no-stack-protector")
# pragma GCC optimize("unroll-loops")
# if __cplusplus < 201703L
# pragma GCC target("avx")
# else
# pragma GCC target("avx2")
# endif
#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tun... | a.cc: In function 'int main()':
a.cc:116:21: error: no matching function for call to 'modpow(int, Int, const Int&)'
116 | ans = modpow(2, (n / 2), MOD);
| ~~~~~~^~~~~~~~~~~~~~~~~
a.cc:32:3: note: candidate: 'template<class T> T modpow(T, T, T)'
32 | T modpow(T a, T n, T mod) {
| ... |
s529195244 | p03846 | C++ | #include <iostream>
#include <sstream> // istringstream
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
int N;
cin >> N;
int A[N];
for(int i=0; i<N; ++i) cin >> A[i];
// 記録
int memo[100000+10] = {0};
for(int i=0; i<N; ++i){
... | a.cc: In function 'int main()':
a.cc:42:33: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
42 | long long ans = pow(2, N/2) % (1000000000+7);
| ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
| | ... |
s237940126 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1e9+7
ll i,j,k,l;
ll mypow(ll a,ll b){
ll num=1;
while(b!=0){
num*=a;
num%=mod;
b--;
}
return num;
}
int main(){
ll n;cin>>n;
vector<ll> a(n);
for(ll i=0;i<n;i++){cin>>a[i];}
ll ans=... | a.cc: In function 'long long int mypow(long long int, long long int)':
a.cc:12:12: error: invalid operands of types 'long long int' and 'double' to binary 'operator%'
12 | num%=mod;
| ^
a.cc:12:12: note: in evaluation of 'operator%=(long long int, double)'
|
s173696511 | p03846 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
inline int D()
{
int t;
scanf("%d",&t);
return t;
}
inline ll llD(){
ll t;
scanf("%lld",&t);
return t;
}
const int N=2e5+9;
int arr[N];
ll mod=1e9+7,sum=0;
int main(){
int n =D();
int k=2;
int T=0;
if(n==1)
return cout<<1... | a.cc: In function 'int main()':
a.cc:44:20: error: expected ';' before 'return'
44 | if((n/2 != sum)
| ^
| ;
45 | return printf("0"),0;
| ~~~~~~
a.cc:46:1: error: expected primary-expression before 'if'
46 | if(n&1)
| ^~
a.cc:4... |
s270566831 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#define ll long long
ll MOD=1e9+7;
ll a[100005];
using namespace std;
int main(){
ll n;
cin>>n;
ll flag=1;//flag
ll ans=1;
if(n%2==0){ // even number
for(ll i=0;i<n;i++){
ll x;
cin>>x;
a[x]++;//a[7]... | a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before '/' token
26 | / / give data x error
| ^
a.cc:26:27: error: expected primary-expression before '/' token
26 | / / give data x error
| ... |
s666615525 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
static int fast_io = []() { std::ios::sync_with_stdio(false); cin.tie(nullptr); return 0; }();
int main(){
long long int mod=1e9+7;
long long int n;
cin>>n;
vector<long long int> nums(100005);
long long int ans=1;
long long int flag=1;
if(n%2==0){
for(lon... | a.cc: In function 'int main()':
a.cc:42:6: error: 'posible' was not declared in this scope
42 | if(posible)
| ^~~~~~~
|
s127796903 | p03846 | C++ | #include <iostream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;
bool is_possible(vector<int> row){
vector<int> numbers(row.size(),0);
//for (int i: numbers) printf("%d",i);
for (int i: row){
if (numbers[i/2] == 0) numbers[i/2]+=1;
else if (numbers[i/2] == 1 && i != 0) numbers[i/2]+=1;... | a.cc: In function 'int main()':
a.cc:30:37: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
30 | printf("\n%d",result%(pow(10,9)+5));
| ~~~~~~^~~~~~~~~~~~~~
| ... |
s434791427 | p03846 | C++ | #include <iostream>
#include <string>
#include<vector>
#include<algorithm>
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using vi = vector<int>;
const int MOD = 1e9 + 7;
int main() {
int N;
cin >> N;
int a = 1;
... | a.cc: In function 'int main()':
a.cc:44:23: error: 'pow' was not declared in this scope
44 | if (a == 1) ans = pow(2, N / 2);
| ^~~
|
s978444188 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(x) (x).begin(),(x).end()
using vi = vector<int>;
const int MOD = 1e9+7;
int main() {
int main() {
int N;
cin >> N;
int a = 1;
vi A(N);
rep(i, N) {
cin >> A[i]... | a.cc: In function 'int main()':
a.cc:14:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
14 | int main() {
| ^~
a.cc:14:9: note: remove parentheses to default-initialize a variable
14 | int main() {
| ^~
| --
a.cc:14:9: note: or ... |
s666315137 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
using vi = vector<int>;
const int MOD = 1e9 + 7;
int main() {
int N;
cin >> N;
bool a = true;
vi A(N);
rep(i, N) {
cin >> A[i... | a.cc: In function 'int main()':
a.cc:36:31: error: expected '}' at end of input
36 | cout << ans % MOD << endl;
| ^
a.cc:13:12: note: to match this '{'
13 | int main() {
| ^
|
s806174420 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i, n) for(int i = 0; i < n; i++);
using vi = vector<int>;
const int MOD = 1e9+7;
int main() {
int N;
cin >> N;
bool a = true;
vi A[N];
rep(i,N){
cin >> A[i];
}
sort(A,A + N);
if(N%2 == 0){
rep(i,N/2){
... | a.cc:21:37: error: extended character is not valid in an identifier
21 | if(!A[2i] == A[2i+1] || !A[2i] == 2i-1)
| ^
a.cc: In function 'int main()':
a.cc:16:14: error: 'i' was not declared in this scope
16 | cin >> A[i];
| ^
a.cc:2... |
s154984995 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>A(N);
for(int i=0;i<N;i++)
cin>>A.at(i);
sort(A.begin(),A.end());
bool x=true;
for(int i=0;i<N;i++){
if(N%2==0){
if(A.at(i)!=2*((N/2))+1){x=false; break;}
}else{
if(A.at(i)!=2*((N+1)/2)){x=false; break;}
}
... | a.cc: In function 'int main()':
a.cc:22:8: error: expected primary-expression before 'int'
22 | fo(int i=0;i<(N/2);i++){
| ^~~
a.cc:22:16: error: 'i' was not declared in this scope
22 | fo(int i=0;i<(N/2);i++){
| ^
|
s820744620 | p03846 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<VVI> VVVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_... | a.cc: In function 'int main()':
a.cc:159:33: error: expected ']' before ')' token
159 | if(a[a[i*2] != i * 2) {
| ^
| ]
|
s228695366 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++){
cin >> A.at(i);
}
sort(A.begin(), A.end());
int y = N % 2;
bool can = true;
if (y == 0){
for (int i = 0; i < N; i += 2){
if (A.a... | a.cc: In function 'int main()':
a.cc:41:7: error: invalid operands of types 'double' and 'long int' to binary 'operator%'
41 | x %= 10000000007;
| ~~^~~~~~~~~~~~~~
a.cc:41:7: note: in evaluation of 'operator%=(double, long int)'
|
s786610663 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N;
cin >> N;
vector<int> A(N);
for (int i = 0; i < N; i++){
cin >> A.at(i);
}
sort(A.begin(), A.end());
int y = N % 2;
bool can = true;
if (y == 0){
for (int i = 0; i < N; i += 2){
if (A.a... | a.cc: In function 'int main()':
a.cc:40:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
40 | double x = pow(2, N/2) % (pow(10, 9) + 7)
| ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~
... |
s726638513 | p03846 | C++ | #include <iostream>
#define MOD 1000000000+7
using namespace std;
int main(void){
int n;
cin>>n;
int a_count[n] = {};
for(int i=0;i<n;i++){
int a;
cin>>a;
a_count[a] ++;
}
long long ans=1;
for(int i= (n%2)+1;i<n;i+=2){
if(a_count[i] == 2){
ans *= ... | a.cc: In function 'int main()':
a.cc:17:21: error: expected ';' before 'ans'
17 | ans *= 2
| ^
| ;
18 | ans %= MOD;
| ~~~
|
s736932154 | p03846 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<list>
#include<map>
#include<deque>
#include<math.h>
using namespace std;
#define ll long long
#define MOD 1000000007
vector <ll> g[10];
ll visited[10];
int main(){
ll n;
ll i;
... | a.cc: In function 'int main()':
a.cc:28:15: error: 'N' was not declared in this scope
28 | if((A+N)%2==1||a[A/2]>2){cout << 0;return 0;}
| ^
a.cc:29:12: error: 'N' was not declared in this scope
29 | if(N%2>0&&a[0]>1){cout << 0;return 0;}
| ^
|
s405742037 | 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[] a = new int[n];
for(int i = 0; i < n; i++) {
a[sc.nextInt()]++;
}
long ans = 0;
int pp = 0;
long MOD = (long)Math.pow(10, 9) + 7;
... | Main.java:28: error: incompatible types: int cannot be converted to boolean
if(pp = 1) {
^
1 error
|
s941260605 | p03846 | C++ | import java.util.*;
import java.io.*;
public class Main{
static int repow(int b,int p){
long a = b;
long res=1;
while(p>0){
if(p%2==1){
res*=a;
}
a*=a;
p/=2;
}
return (int)res;
}
static int repow(int b,int p,int modder){
long a = b%modder;
long res=1;
... | a.cc:358:7: error: stray '@' in program
358 | @SuppressWarnings("unchecked")
| ^
a.cc:384:7: error: stray '@' in program
384 | @SuppressWarnings("unchecked")
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'impor... |
s814593109 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
#define rep(i,a,b) for(ll i=a ; i<b ; i++)
#define qrep(que, ite)... | a.cc: In function 'int main()':
a.cc:76:10: error: expected primary-expression before ')' token
76 | if()
| ^
a.cc:77:3: error: expected primary-expression before '}' token
77 | }else{
| ^
|
s955333649 | p03846 | C++ | /*I wanna be the very best, like no one ever was...*/
#include<bits/stdc++.h>
using namespace std;
/******* All Required define Pre-Processors and Constants *******/
#define ll long long
#define ull unsigned long long
#define ld long double
#define mem(a, b) memset(a, (b), sizeof(a))
#define rep(i, j, k) for (in... | a.cc: In function 'int main()':
a.cc:23:14: error: expected unqualified-id before '\xa'
23 | #define endl '\n';
| ^~~~
a.cc:88:32: note: in expansion of macro 'endl'
88 | std::cout << 0 << std::endl;
| ^~~~
|
s955603397 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int no_of_people;
cin >> no_of_people ;
int difference[no_of_people];
sort(difference,difference+no_of_people);
if(difference[1]==0)
{
cout << 0;
}
else
{
cout << 2**(no_of_people/2);
}
}
| a.cc: In function 'int main()':
a.cc:17:15: error: invalid type argument of unary '*' (have 'int')
17 | cout << 2**(no_of_people/2);
| ^~~~~~~~~~~~~~~~~
|
s122355145 | p03846 | C++ | /*2020/03/15 ABC 050*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
int main() {
int n;
cin >> n;
vector<int> vec(n);
for(int i=0; i<n; i++) cin >> vec[i];
sort(vec.begin(), vec.end());
int j=-1, k=0;
if(n%2==0) {
for(int i=0; i<n;... | a.cc: In function 'int main()':
a.cc:33:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
33 | cout << pow(2, n/2) % 1000000007<< endl;
| ~~~~~~~~~~~ ^ ~~~~~~~~~~
| | |
| ... |
s970281811 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc: In function 'int main()':
a.cc:20:14: error: conflicting declaration 'std::vector<long long int> a'
20 | vector<ll> a(n), b(n);
| ^
a.cc:18:12: note: previous declaration as 'll a'
18 | ll n, s, a;
| ^
a.cc:22:9: error: invalid types 'll {aka long long int}[ll {aka lo... |
s869222893 | p03846 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
int main() {
int N, ans, i;
std::vector<int> vec;
std::string str;
std::cin >> N;
for (i = 0; i < N; i++) {
std::cin >> str;
vec.push_back(std::stoi(str));
}
std::sort(vec.begin()... | a.cc: In function 'int main()':
a.cc:41:42: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%'
41 | ans = std::pow(2, std::floor(N / 2)) % (std::pow(10, 9) + 7);
| ~~~~~~~~~~~~~~~~~... |
s698703692 | p03846 | Java | import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] times = new int[n];
boolean isOdd = (n & 1) == 1;
int num = 0;
for(int i = 0; i < n; i++) {
... | Main.java:39: error: cannot find symbol
res = res * x % MOD;
^
symbol: variable MOD
location: class Main
Main.java:41: error: cannot find symbol
x = x * x % MOD;
^
symbol: variable MOD
location: class Main
2 errors
|
s840426332 | p03846 | C++ | #include <cstdio>
#include <iostream>
using namespace std ;
const int P = 1000000007 ;
int n ;
int yes[500000] ;
int base[500000] ;
int expow(int a, int b){
int res = 1 ;
while (b){
if (b & 1)
res = 1ll * a * res % P ;
a = 1ll * a * a % P ; b >>= 1 ;
}
return res ;
}
int ... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(base + 1, base + n + 1) ;
| ^~~~
| short
|
s944066875 | p03846 | Java | import com.sun.javafx.logging.JFRInputEvent;
import java.io.*;
import java.util.*;
class Main {
static final int M = 1000000007;
public static void main(String[] args) throws Exception {
final Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int[] A = new int[N];
for (int i = 0; i < N; i++) {
... | Main.java:1: error: package com.sun.javafx.logging does not exist
import com.sun.javafx.logging.JFRInputEvent;
^
1 error
|
s437850552 | p03846 | C++ | #include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(int argc, const char * argv[])
// cinを高速にするためのおまじない
cin.tie(0);
ios::sync_with_stdio(false);
long cnt = 0;
cin >> cnt;
int store[100000] = {0};
int error = fa... | a.cc:11:5: error: expected initializer before 'cin'
11 | cin.tie(0);
| ^~~
a.cc:12:5: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
12 | ios::sync_with_stdio(false);
| ^~~
a.cc:15:5: error: 'cin' does not name a type
15 | cin >> ... |
s358881141 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0; i<(n); i++)
int a[100100];
int cnt[100100];
int main() {
int n;
cin >> n;
rep(i,n) cin >> a[i];
rep(i,n) cnt[i]=0;
rep(i,n) cnt[a[i]]++;
if(n%2==0){
int limit = n-1;
bool ok = t... | a.cc: In function 'int main()':
a.cc:28:28: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
28 | ll ans = pow(2,count)%1000000007;
| ~~~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s565594230 | p03846 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <bits/stdc++.h>
#include <set>
#include <list> //list<???> a; a.push_back ,insert(追加したい要素),a.sort(),参照できない
#include <vector> //vector<???> a; a.push_back,sort(a.begin(),a.end());a[i]
//配列 int a[N];a[i]=追加したい要素;sort(a,a+N);a[i]
const int MOD = 1e9+7;
using... | a.cc: In function 'int main()':
a.cc:50:5: error: break statement not within loop or switch
50 | break;
| ^~~~~
|
s921455854 | p03846 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <bits/stdc++.h>
#include <set>
#include <list> //list<???> a; a.push_back ,insert(追加したい要素),a.sort(),参照できない
#include <vector> //vector<???> a; a.push_back,sort(a.begin(),a.end());a[i]
//配列 int a[N];a[i]=追加したい要素;sort(a,a+N);a[i]
const int MOD = 1e9+7;
using... | a.cc: In function 'int main()':
a.cc:35:64: error: expected ')' before '{' token
35 | if((i%2==0 && a[i]+2==a[i+1]) || (i%2==1 && a[i]==a[i+1]){
| ~ ^
| )
a.cc:42:5: error: ex... |
s741281406 | p03846 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <bits/stdc++.h>
#include <set>
#include <list> //list<???> a; a.push_back ,insert(追加したい要素),a.sort(),参照できない
#include <vector> //vector<???> a; a.push_back,sort(a.begin(),a.end());a[i]
//配列 int a[N];a[i]=追加したい要素;sort(a,a+N);a[i]
using namespace std;
typedef... | a.cc: In function 'int main()':
a.cc:57:4: error: expected '}' at end of input
57 | }
| ^
a.cc:18:11: note: to match this '{'
18 | int main(){
| ^
|
s318762372 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF= 1LL << 60;
#define REP(i,n) for(ll i=0; i<n; i++)
#define FOR(i,a,n) for(ll i=a; i<n; i++)
#define tl 1'000'000'009
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll n;
cin >> n;
vector<ll>A(n);
map<ll,ll>p;
... | a.cc: In function 'int main()':
a.cc:28:31: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
28 | cout << (powl(2,n/2)*flag)%tl << endl;
| ~~~~~~~~~~~~~~~~~~^
| |
| long double
|
s594347076 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF= 1LL << 60;
#define REP(i,n) for(ll i=0; i<n; i++)
#define FOR(i,a,n) for(ll i=a; i<n; i++)
#define tl 1'000'000'009
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
cin >> n;
vector<int>A(n);
map<int,int>... | a.cc: In function 'int main()':
a.cc:28:35: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
28 | cout << ((flag)?powl(2,n/2):0)%tl << endl;
| ~~~~~~~~~~~~~~~~~~~~~~^
| |
| long double
|
s133799252 | p03846 | C++ | #include<bits/stdc++.h>
#include<numeric>
using namespace std;
#define ll long long
#define mp make_pair
#define fi first
#define se second
#define pii pair<ll,ll>
#define pb push_back
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define what_is(x) cerr << #x << " is " << x << endl;
int mai... | a.cc: In function 'int main()':
a.cc:27:17: error: break statement not within loop or switch
27 | {flag=0;break;}
| ^~~~~
|
s276559987 | p03846 | C++ | #include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#define ll long long
ll MOD=1e9+7;
ll a[100005];
using namespace std;
int main(){
ll n;
cin>>n;
ll flag=1;//flag
ll ans=1;
if(n%2==0){ // even number
for(ll i=0;i<n;i++){
ll x;
cin>>x;
a[x]++;//a[7]... | a.cc: In function 'int main()':
a.cc:26:25: error: expected primary-expression before '/' token
26 | / / give data x error
| ^
a.cc:26:27: error: expected primary-expression before '/' token
26 | / / give data x error
| ... |
s402862037 | p03846 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <climits>
using namespace std;
bool comp(pair<int, string> a, pair<int, string> b){
if(a.first != b.first) return a.first > b.first;
else return a.second... | a.cc: In function 'int main()':
a.cc:41:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
41 | cout << pow(2,n/2)%((int)pow(10,9) + 7) << endl;
| ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
| | ... |
s915395199 | p03846 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <climits>
using namespace std;
bool comp(pair<int, string> a, pair<int, string> b){
if(a.first != b.first) return a.first > b.first;
else return a.second... | a.cc: In function 'int main()':
a.cc:41:18: error: expected primary-expression before '<<' token
41 | cout << << endl;
| ^~
a.cc:49:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
49 | cout << pow(2,... |
s481615891 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
long long MOD = 1E9+7;
int main(){
int n;
cin >> n;
int a[n],b[n]={};
for(int i=0;i<n;i++){
cin >> a[i];
b[a[i]/2]++;
}
for(int i=0;i<(n+1)/2;i++){
if(n%2){
if(b[0]!=1) cout << 0 << endl;
return 0;
}
else{
if(b[i... | a.cc: In function 'int main()':
a.cc:24:26: error: 'c' was not declared in this scope
24 | for(int i=1;i<=n/2;i++)c = (2*c)%MOD;
| ^
a.cc:25:11: error: 'c' was not declared in this scope
25 | cout << c << endl;
| ^
|
s811386608 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ff(i,a,b) for(i=a;i<=b;i++)
#define fb(i,a,b) for(i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL)
#define 1000000007
int main()
{
fast;
ll n,i,total=0;
bool ans=false;
cin>>n;
ll a[n+1];
unordered... | a.cc:7:9: error: macro names must be identifiers
7 | #define 1000000007
| ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:66:41: error: no match for 'operator%' (operand types are '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'std::unordered_map<long long int, long long int>')
66 | ... |
s864436352 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int N,ans=2;
bool flag = true;
cin >> N;
vector<int> A(N/2 +1,0);
for(int i=0;i<N;i++){
int a;
cin >> a;
if(N%2==0){
if(a%2==0){
flag = false;
}
}else{
... | a.cc: In function 'int main()':
a.cc:47:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
47 | cout << pow(2,N/2)%1000000007 << endl;
| ~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s473222122 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int N;
bool flag = true;
cin >> N;
vector<int> A(N/2 +1,0);
for(int i=0;i<N;i++){
int a;
cin >> a;
if(N%2==0){
if(a%2==0){
flag = false;
}
}else{
... | a.cc: In function 'int main()':
a.cc:42:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
42 | cout << pow(2,N/2)%1000000007 << endl;
| ~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s403427673 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.eras... | a.cc: In function 'int main()':
a.cc:71:26: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
71 | cout << (b?pow(2,n/2)%1000000007:0) << endl;
| ~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s508185961 | p03846 | C++ | #include<iostream>
#include<numeric>
#include<algorithm>
using namespace std;
int main()
{
int n;
cin >> n;
int a[100000];
for (int i = 0; i < n;i++)
cin >> a[i];
int c = count(a, a + n, 0);
if (n % 2 == 0 && c > 0 || n % 2 != 0 && c> 1)
cout << "0";
else
{
for (int i = 0; i < n;i++)
{
if (count(a, a... | a.cc: In function 'int main()':
a.cc:26:47: error: 'pow' was not declared in this scope
26 | cout << (n * 2)%((int)pow(10,9) + 7);
| ^~~
a.cc:28:49: error: 'pow' was not declared in this scope
28 | cout << (n - 1) ... |
s299860349 | p03846 | C++ | #include<iostream>
#include<numeric>
using namespace std;
int main()
{
int n;
cin >> n;
int a[100000];
for (int i = 0; i < n;i++)
cin >> a[i];
int c = count(a, a + n, 0);
if (n % 2 == 0 && c > 0 || n % 2 != 0 && c> 1)
cout << "0";
else
{
if (n % 2 == 0)
cout << n * 2;
else
cout << n - 1;
}
r... | a.cc: In function 'int main()':
a.cc:11:17: error: 'count' was not declared in this scope
11 | int c = count(a, a + n, 0);
| ^~~~~
|
s316095663 | p03846 | C++ | #include<iostream>
#include<numeric>
using namespace std;
int main()
{
int n;
cin >> n;
int a[100000];
for (int i = 0; i < n;i++)
cin >> a[i];
if (n % 2 == 0 && count(a, a + n, 0) > 0 || n % 2 != 0 && count(a, a + n, 0) > 1)
cout << "0";
else
{
if (n % 2 == 0)
cout << n * 2;
else
cout << n - 1;
}
... | a.cc: In function 'int main()':
a.cc:11:27: error: 'count' was not declared in this scope
11 | if (n % 2 == 0 && count(a, a + n, 0) > 0 || n % 2 != 0 && count(a, a + n, 0) > 1)
| ^~~~~
|
s669158927 | p03846 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
long long int D = 1000000007;
int main(){
int N;
vector<int> a(N);
for(int i = 0; i < N; i++) cin >> a[i];
bool coh = true;
long long int ans = 0LL;
for(int i = 0; i < N; i++){
if(a[i] < 0 || a[i] > N-1){
coh = ... | a.cc:31:4: error: expected unqualified-id before 'else'
31 | }else{
| ^~~~
a.cc:44:3: error: expected unqualified-id before 'if'
44 | if(coh) cout << ans;
| ^~
a.cc:45:3: error: expected unqualified-id before 'else'
45 | else cout << 0;
| ^~~~
a.cc:46:1: error: expected declarati... |
s210590356 | p03846 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
long long int D = 1000000007;
int main(){
int N;
vector<int> a(N);
for(int i = 0; i < N; i++) cin >> a[i];
bool coh = true;
long long int ans = 0LL;
for(int i = 0; i < N; i++){
if(a[i] < 0 || a[i] > N-1){
coh = ... | a.cc: In function 'int main()':
a.cc:27:7: error: expected ')' before 'for'
27 | if(N
| ~ ^
| )
28 | for(auto iter = m.begin(); iter != m.end(); iter++){
| ~~~
a.cc:28:32: error: 'iter' was not declared in this scope
28 | for(auto iter = m.begin(); iter != m.end(); ite... |
s058136940 | p03846 | C++ | #include <iostream>
#include <vector>
#include <map>
using namespace std;
long long int D = 1000000007;
int main(){
int N;
vector<int> a(N);
for(int i = 0; i < N; i++) cin >> a[i];
bool coh = true;
long long int ans = 0LL;
for(int i = 0; i < N; i++){
if(a[i] < 0 || a[i] > N-1){
coh = ... | a.cc: In function 'int main()':
a.cc:27:7: error: expected ')' before 'for'
27 | if(N
| ~ ^
| )
28 | for(auto iter = m.begin(); iter != m.end(); iter++){
| ~~~
a.cc:28:32: error: 'iter' was not declared in this scope
28 | for(auto iter = m.begin(); iter != m.end(); ite... |
s041033482 | p03846 | C | #include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>
#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX... | main.c: In function 'main':
main.c:472:27: error: too few arguments to function 'powU64WMod'
472 | printf("%"PRIu64"\n", powU64WMod(2, N / 2));
| ^~~~~~~~~~
main.c:115:17: note: declared here
115 | static uint64_t powU64WMod(const uint64_t base, const uint64_t exp, const uint64_t... |
s158718272 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#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 1e9
#define ALL(v) v.begin(), v.end()
typedef long long ll;
#define downque(que) priority_queue<ll> que;
#define upque(qu... | a.cc: In function 'int main()':
a.cc:41:6: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%'
41 | ans%(1e9+7);
| ~~~^~~~~~~~
| | |
| | double
| ll {aka long long int}
|
s271559672 | p03846 | Java | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
vector<int> number(100100);
for (int i = 0; i < N; i++) {
int a;
cin >> a;
number[a]++;
}
int mod = 1000000000 + 7;
bool valid = true;
if (N % 2 != 0) {
if (number[0] != 1) {
valid = false;
} el... | Main.java:1: error: illegal character: '#'
#include <bits/stdc++.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include <bits/stdc++.h>
^
Main.java:7: error: not a statement
cin >> N;
^
Main.java:12: error: not a statement
cin >> a;
^
Main.java:66: error: not a stateme... |
s810302354 | p03846 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int main(){
int N;
cin>>N;
vector<int>A(N);
for (int i=0;i<N;++i){
cin>>A[i];
}
bool Flag=true;
long long ans=0;
long long MOD=1000000007;
if (N%2==0){
for (int i=0;i<N;++i){
... | a.cc: In function 'int main()':
a.cc:33:21: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%'
33 | ans=pow(2,ans)%MOD;
| ~~~~~~~~~~^~~~
| | |
| | long long int
... |
s062985255 | p03846 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N;cin>>N;
vector<int>A(N);
for (int i=0;i<N;++i){
cin>>A[i];
}
bool Flag=true;
long long ans=0;
long long MOD=1000000009;
if (N%2==0){
for (int i=0;i<N;++i){
if (A[i]%2==0){
Flag=f... | a.cc: In function 'int main()':
a.cc:32:3: error: 'else' without a previous 'if'
32 | else{
| ^~~~
|
s328765158 | p03846 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
int N;cin>>N;
vector<int>A(N);
for (int i=0;i<N;++i){
cin>>A[i];
}
bool Flag=true;
long long ans=0;
long long MOD=1000000009;
if (N%2==0){
for (int i=0;i<N;++i){
if (A[i]%2==0){
Flag=f... | a.cc: In function 'int main()':
a.cc:32:3: error: 'else' without a previous 'if'
32 | else{
| ^~~~
a.cc:40:14: error: expected unqualified-id before numeric constant
40 | for (int 2=0;i<(N+1);i+=2)
| ^
a.cc:40:13: error: expected ';' before numeric constant
40 | for (int 2=... |
s652610171 | p03846 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;cin>>N;
vector<int>A(N);
for (int i=0;i<N;++i){
cin>>A[i];
}
bool Flag=true;
long long ans=0;
long long MOD=1000000009;
if (N%2==0){
for (int i=0;i<N;++i){
if (A[i]%2==0){
Flag=false;
break;
... | a.cc: In function 'int main()':
a.cc:24:16: error: 'count' is not a member of 'std'; did you mean 'cout'?
24 | if (std::count(A.begin(), A.end(),i)!=2){
| ^~~~~
| cout
a.cc:31:3: error: 'else' without a previous 'if'
31 | else{
| ^~~~
a.cc:39:14: error: ex... |
s141024550 | p03846 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;cin>>N;
vector<int>A(N);
for (int i=0;i<N;++i){
cin>>A[i];
}
bool Flag=true;
long long ans=0;
long long MOD=1000000009;
if (N%2==0){
for (int i=0;i<N;++i){
if (A[i]%2==0){
Flag=false;
break;
... | a.cc: In function 'int main()':
a.cc:24:11: error: 'count' was not declared in this scope
24 | if (count(A.begin(), A.end(),i)!=2){
| ^~~~~
a.cc:31:3: error: 'else' without a previous 'if'
31 | else{
| ^~~~
a.cc:39:14: error: expected unqualified-id before numeric constant
39 | ... |
s281864260 | p03846 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <fstream>
#include <sstream>
#include <iomanip>
using namespace std;
long long MOD = 1000000007;
int main(){
int N;
cin >> N;
vector<int> cnt(N,0);
cn... | a.cc: In function 'int main()':
a.cc:22:22: error: expected primary-expression before '>' token
22 | for(int i=1; 2*i=>N; i++){
| ^
|
s113057906 | p03846 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define rep(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define DEBUG(x) ... | a.cc: In function 'int main()':
a.cc:10:28: error: expected ')' before 'm'
10 | #define SORT(x) sort(ALL(x)m);
| ~ ^
a.cc:57:3: note: in expansion of macro 'SORT'
57 | SORT(a);
| ^~~~
a.cc:10:28: error: expected ')' before 'm'
10 | #define SORT(x) sort(ALL(x)m);
|... |
s172038313 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define INF -2147483647
int main(){
int a,d=-1,q=1,w=1;
int b,c[1000000]={};
cin>>a;
for(int i=0;i<a;i++){
cin>>b;
c[b]++;
}
if(a%2==0&&c[0]!=0) w=1;
if(a%2==1&&c[0]!=1) w=1;
if(w==1){
for(int i=1;i<=a;i++){
if(c[i]==1... | cc1plus: error: '::main' must return 'int'
|
s575253612 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define INF -2147483647
int main(){
int a,d=-1,q=1,w=1;
int b,c[1000000]={};
cin>>a;
for(int i=0;i<a;i++){
cin>>b;
c[b]++;
}
if(a%2==0&&c[0]!=0) w=1;
if(a%2==1&&c[0]!=1) w=1;
if(w==1){
for(int i=1;i<=a;i++){
if(c[i]==1... | cc1plus: error: '::main' must return 'int'
cc1plus: error: '::main' must return 'int'
a.cc:32:5: error: redefinition of 'int main()'
32 | int main(){
| ^~~~
a.cc:5:5: note: 'int main()' previously defined here
5 | int main(){
| ^~~~
|
s999487166 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define INF -2147483647
int main(){
int a,d=-1,q=1,w=1;
int b,c[1000000]={};
cin>>a;
for(int i=0;i<a;i++){
cin>>b;
c[b]++;
}
if(a%2==0&&c[0]!=0) w=1;
if(a%2==1&&c[0]!=1) w=1;
if(w==1){
for(int i=1;i<=a;i++){
if(c[i]==1||c[i]>=3) {
q=0;
br... | a.cc: In function 'int main()':
a.cc:23:12: error: expected primary-expression before ')' token
23 | if(q==1&&) cout<<(((d+1)/2)*((d+1)/2))%100000007;
| ^
|
s308443202 | 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[] a = new int[n];
for(int i = 0;i < n;i++)a[i]=sc.nextInt();
Arrays.sort(a);
if(a[0]==0){
if(n%2==0){
System.out.print... | Main.java:39: error: ';' expected
long q = 1000000007
^
1 error
|
s840090809 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define MOD 1e9+7;
#define re... | a.cc: In function 'int main()':
a.cc:47:12: error: invalid operands of types 'long int' and 'double' to binary 'operator%'
47 | answer %= MOD;
| ^
a.cc:47:12: note: in evaluation of 'operator%=(long int, double)'
|
s558787742 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define MOD 1e9+7;
#define re... | a.cc: In function 'int main()':
a.cc:12:18: error: expected ',' or ';' before 'for'
12 | #define rep(i,n) for(int i=0; i<(int)(n);i++)
| ^~~
a.cc:45:3: note: in expansion of macro 'rep'
45 | rep(i,n/2){
| ^~~
a.cc:45:7: error: 'i' was not declared in this scope
45 | rep(i,n/2... |
s632401975 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0;... | a.cc: In function 'int main()':
a.cc:11:18: error: expected ',' or ';' before 'for'
11 | #define rep(i,n) for(int i=0; i<(int)(n);i++)
| ^~~
a.cc:45:3: note: in expansion of macro 'rep'
45 | rep(i,n/2){
| ^~~
a.cc:45:7: error: 'i' was not declared in this scope
45 | rep(i,n/2... |
s594173027 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
#define fix10 cout << fixed << setprecision(10);
#define rep(i,n) for(int i=0;... | a.cc: In function 'int main()':
a.cc:22:10: error: 'i' was not declared in this scope
22 | a.at(i) = tmp;
| ^
a.cc:11:18: error: expected ',' or ';' before 'for'
11 | #define rep(i,n) for(int i=0; i<(int)(n);i++);
| ^~~
a.cc:45:3: note: in expansion of macro 'rep'
45 |... |
s611275577 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
typedef long long int ll;
const ll INF=(ll)1e18;
ll mod_pow(ll x,ll n, ll mod){
if(n==0) return 1;
ll res = mod_pow(x*x%mod, n/2, mod);
if(n&1) res = res*x%mod;
r... | a.cc: In function 'int main()':
a.cc:34:3: error: expected primary-expression before 'if'
34 | if(N%2&1){
| ^~
|
s208962034 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
int main(){
int N;
cin >> N;
int A[N];
rep(i,N)cin >> A[i];
int a[N];
rep(i,N)a[i] = A[i];
int M=0;
sort(a,a+N);
if(N%2==1){
for(int i=1;i<N;i+=2){
if((a[i+1]-a[i])!=0)M++;}
}
else{
for(int i=0;i<N;i+=2){
if((a[i+... | a.cc: In function 'int main()':
a.cc:25:30: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
25 | if(M==0)cout << pow(2,N/2)%(1000000000+7) << endl;
| ~~~~~~~~~~^~~~~~~~~~~~~~~
| | ... |
s547424504 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
int n; cin >> n;
int arr[n];
unordered_map<int, int> m, vis;
for(int i=0; i<n; i++){
cin >> arr[i];
m[arr[i]] += 1;
}
ll ans = 1;
for(auto j:m){
if(vis[j.first]) continue;
if(j.se... | a.cc: In function 'int main()':
a.cc:17:53: error: expected ';' before '}' token
17 | if(j.first != 0){ans *= 2; ans %= 1000000007}
| ^
| ;
|
s121940626 | p03846 | C++ | #include<iostream>
#include<map>
using namespace std;
int main() {
int n; cin >> n;
map<int, int>a;
for (int i = 0; i < n; i++) {
int tmp; cin >> tmp;
a[tmp]++;
}
for (auto x : a) {
if (x.first == 0) {
if (n % 2 == 0) {
if (x.second > 0) {
cout << 0 << endl;
return 0;
}
}
else {
... | a.cc: In function 'int main()':
a.cc:35:17: error: 'pow' was not declared in this scope
35 | cout << pow(2,n/2) << endl;
| ^~~
|
s957960215 | p03846 | C++ | #include <iostream>
#include <string>
#include <list>
using namespace std;
int OutNumList(list<int>::iterator itr,const int &i) {
if (i < 0) {
for (int k = 0; k > i; k--)
{
itr--;
}
}
else {
for (int k = 0; i > k; k++)
{
itr++;
}
}
return *itr;
}
int main() {
// 変数定義
list<int> lisN;
in... | a.cc: In function 'int main()':
a.cc:37:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
37 | scanf_s("%1d", &A);
| ^~~~~~~
| scanf
|
s350022019 | p03846 | C++ | #include <iostream>
#include <string>
#include <list>
using namespace std;
int OutNumList(list<int>::iterator itr,const int &i) {
if (i < 0) {
for (int k = 0; k > i; k--) {
itr--;
}
}
else {
for (int k = 0; i > k; k++) {
itr++;
}
}
return *itr;
}
int main() {
// 変数定義
list<int> lisN;
int resu... | a.cc: In function 'int main()':
a.cc:35:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
35 | scanf_s("%1d", &A);
| ^~~~~~~
| scanf
|
s010988646 | p03846 | C++ | #include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
#define fore(i,a) fo... | a.cc: In function 'int main()':
a.cc:51:31: error: unable to find numeric literal operator 'operator""N'
51 | else if (a != 0N % 2 == 0 && a % 2 == 1) {
| ^~
|
s236275599 | p03846 | C++ | include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
using namespace std;
long int chackFun(int A) {
A = A - 1;
long int buf = A;
while ((A - 2) >= 0) {
A = A - 2;
buf = buf + A;
}
return buf * 2;
}
int main() {
// 変数定義
vector<int> vN;
int result = 1;
in... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a typ... |
s724609309 | p03846 | C++ | /*
友利奈緒ぱわーでACしてくれ!!!!!!!!!!!!
Charlotteまだ見てない人は見ような!!!!!!!
/ /:/ \:ヽ \
/ / \ ヽ
\__L 彡 ヽ ',
フ / / / / , ヽ ', j
レ / / / ', ヽ j
//... | a.cc: In function 'int main()':
a.cc:127:21: error: no matching function for call to 'power(int, ll)'
127 | else cout << power(2,n/2) << endl;
| ~~~~~^~~~~~~
a.cc:99:10: note: candidate: 'template<class T> T power(T, T, T)'
99 | inline T power(T a,T n,T modu = 1e9+7){
| ^~~~~
... |
s917225546 | p03846 | C++ | #include <iostream>
#include <iomanip>
#include <stdio.h>
#include <math.h>
#include <string>
//#include <search.h>
#include <algorithm>
//#include <vector>
using namespace std;
int main()
{
int n,arr[100000],arr2[100000]={0},s=0,check=0;
cin>>n;
for(int i=0;i<n;i++){
cin>>arr[i];
if(arr2[arr[i]]==0 && arr[i... | a.cc: In function 'int main()':
a.cc:22:2: error: 'else' without a previous 'if'
22 | else{
| ^~~~
|
s030554311 | p03846 | Java | import java.util.Arrays;
import java.util.Scanner;
class Main{
static long mod=1000000007; // 10e9 + 7
static long pow(long a, long x){
if(x == 1) return a % mod;
else if(x % 2 == 0) return pow((a * a) % mod, x / 2) % mod;
else return (a * pow((a * a) % mod, x / 2)) % mod;
}
public static void main(String[] ... | Main.java:29: error: method pow in class Main cannot be applied to given types;
long ans = pow(2, (long)(N / 2), mod);
^
required: long,long
found: int,long,long
reason: actual and formal argument lists differ in length
1 error
|
s480053107 | p03846 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define irep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
int main(){
int n;
cin>>n;
vector<int> a(n);
re... | a.cc: In function 'int main()':
a.cc:35:30: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
35 | cout<<pow(2,(int)n/2)%1000000007<<endl;
| ~~~~~~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s077872470 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int n,a[100004];
bool ok=true;
int main(){
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-1;i+=2){
if(a[i]!=i+1||a[i+1]!=i+1){ok=false;break;}
}
}else{
if(a[0]!=0)ok=false;
for(int i=1;i<n-1;i+=2){
if(a[i]!=i+1... | a.cc: In function 'int main()':
a.cc:23:28: error: no matching function for call to 'pow(int [100004], int&)'
23 | long long ppap2=pow(a,ppap);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/valarray:605,
from /usr/include/x86_64-linux-gnu/c++/14/bits/s... |
s567707143 | p03846 | Java | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = sc.nextLong();
ret = (long) Math.pow(2, (long) N / 2);
ret = (long) ret % 1000000007;
System.out.println(ret);
}
} | Main.java:9: error: cannot find symbol
ret = (long) Math.pow(2, (long) N / 2);
^
symbol: variable ret
location: class Main
Main.java:10: error: cannot find symbol
ret = (long) ret % 1000000007;
^
symbol: variable ret
location: class Main
Main.java:10: error: cannot find symbol
ret = (long) ret % 1... |
s957541049 | p03846 | C++ | #include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cstdlib>
#include <iostream>
#include <list>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
int main() {
int N;
cin >> N;
vector<int> A(N);
int a;
for (int ... | a.cc: In function 'int main()':
a.cc:73:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
73 | cout << pow(2, N / 2) % 100000007 << endl;
| ~~~~~~~~~~~~~ ^ ~~~~~~~~~
| | |
| | ... |
s325819564 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<int> a(n),cnt(n,0);
for(int i=0;i<n;i++){
cin >> a[i];
}
for(int i=0;i<n;i++){
cnt[a[i]]++;
}
bool ok=true;
if(n%2==1){
if(cnt[0]!=1)ok=false;
for(int i=1;i<n;i++){
if(i%2==1){
if(cnt[i]!=0)ok=false;
}... | a.cc: In function 'int main()':
a.cc:26:33: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
26 | long long ans=pow(2,(n-1)/2)%1000000007;
| ~~~~~~~~~~~~~~^~~~~~~~~~~
| | |
| ... |
s817774763 | p03846 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1e9 + 7;
signed
main(){
int N;
cin >> N;
vector<int> a(N), is_same(N);
for(int i=0;i<N;i++)
cin >> a[i];
for(int l=0;l<=N-1;l++)
{
int r = (N - 1) - l;
is_same[i] = abs(l-r);
}
sort(a.begin(), a.end());
... | a.cc: In function 'int main()':
a.cc:18:41: error: 'i' was not declared in this scope
18 | is_same[i] = abs(l-r);
| ^
a.cc:41:27: error: 'is_smae' was not declared in this scope; did you mean 'is_same'?
41 | int key = is... |
s245764162 | p03846 | C++ | #include<stdio.h>
#include<math.h>
#include<stdlib.h>
int main()
{
long long int n,i,j,temp,b[100099]= {0},k,a[100099],count=0,p,x;
scanf("%lld",&n);
for(i=0; i<n; i++)
{
scanf("%lld",&a[i]);
}
for(i=n-1,k=0; i>=0; i--,k++)
{
b[k]=abs(i-k);
}
sort(a, a+n);
sort(b,... | a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
16 | sort(a, a+n);
| ^~~~
| sqrt
a.cc:33:21: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%'
33 | x=(... |
s284155540 | p03846 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vd(T) vector<vector<T>>
#define v(T) vector<T>
#define mod (ll)(1e9+7)
#define pp(T) pair<T,T>
#define pb push_back
#define mp make_pair
#define NN 100005
#define IO ios_base::sync_with_stdio(NULL),cin.tie(0),cout.tie(0)
#define loop(i,a,b) for(l... | a.cc: In function 'long long int setup_k(long long int*, long long int)':
a.cc:72:1: warning: no return statement in function returning non-void [-Wreturn-type]
72 | }
| ^
a.cc: In function 'int main()':
a.cc:90:14: error: 'i' was not declared in this scope
90 | if(a[i]!=0){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.