submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s192808955
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 103 #define MMAX 103 //コメントアウトするとdebug()を実行しない #define DEBUG using namespace std; templ...
a.cc: In function 'int main()': a.cc:77:9: error: 'c' was not declared in this scope 77 | c = solve(); | ^
s005858061
p03846
C++
#include <algorithm> #include <cstdio> #include <iostream> #include <map> #include <cmath> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <vector> #include <stdlib.h> #include <stdio.h> using namespace std; #define ll long long #define PI acos(-1.0) #defi...
a.cc: In function 'int main()': a.cc:37:26: error: expected primary-expression before ')' token 37 | if(N%2==0 && d[0]!=0)){ | ^
s471461085
p03846
C++
/************************************************************************* > File Name: test.cpp > Author: Akira > Mail: qaq.febr2.qaq@gmail.com ************************************************************************/ #include<bits/stdc++.h> typedef long long LL; typedef unsigned long long ULL; typedef...
a.cc: In lambda function: a.cc:43:43: error: expected '{' before 'return' 43 | sort(diff+1, diff+1+N, [](int x,int y)return{x>y;}); | ^~~~~~ a.cc: In function 'int main()': a.cc:43:43: error: expected ')' before 'return' 43 | sort(diff+1, diff+1+N, [](int x,...
s522430769
p03846
C++
import java.util.*; // ABC 50-C // http://abc050.contest.atcoder.jp/tasks/arc066_a public class Main { static int n; static int max; static int answer = 0; static int MOD = 1000000007; public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); int[] diff = new int...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:6:1: error: expected unqualified-id before 'public' 6 | public class Main { | ^~~~~~
s700118922
p03846
C++
#include"sort.h" #include<stdio.h> #include<iostream> using namespace std; int power(int n){ if(n == 0){ return 1; } if(n % 2 == 1){ return (2 * power(n - 1)) % 1000000007; }else{ return power(n / 2) * power(n / 2) % 1000000007; } } int main(){ int n; bool flag = true; cin >> n; int a[n]; for(in...
a.cc:1:9: fatal error: sort.h: No such file or directory 1 | #include"sort.h" | ^~~~~~~~ compilation terminated.
s675459549
p03846
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; #define int ll #define FOR(i,a,b) for(int i=int(a);i<int(b);i++) #define REP(i,b) FOR(i,0,b) int read(){ int i; scanf("%lld",&i); return i; } signed main(){ // your code goes here int N=read(); vector<int> A; REP(i,N) A.push_back(read()); sor...
a.cc: In function 'int main()': a.cc:36:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 36 | cout << pow(2,N/2)%(100000000+7); | ~~~~~~~~~~^~~~~~~~~~~~~~ | | | | ...
s125352147
p03846
C++
#include <bits/stdc++.h> #define REP(i, n) for(int i = 0;i < n;i++) // ex)REP(i,10) i=0~i=9 #define REPR(i, n) for(int i = n;i >= 0;i--) // ex)REPR(i,10) i=10~i=0 #define FOR(i, m, n) for(int i = m;i < n;i++) //ex)FOR(i,3,10) i=3~i=9 #define FORR(i, m, n) for(int i = m;i >= n;i--) #define SORT(v, n) sort(v, v+n); #def...
a.cc:9:27: error: extended character   is not valid in an identifier 9 | #define pb(a) push_back(a)  | ^ a.cc: In function 'int main()': a.cc:23:29: error: expected primary-expression before ';' token 23 | int count[100000] = ; | ^
s752723954
p03846
C++
#define _USE_MATH_DEFINES #define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string> #include<iostream> #include<cctype> #include<cstdio> #include<vector> #include<stack> #include<queue> #include <algorithm> #include<math.h> #include<set> #include<map> #include<iomanip> //#include<bits/stdc++.h> using namesp...
a.cc: In function 'int main()': a.cc:85:40: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 85 | cout << pow(2, (double)(n / 2))%1000000007 << endl; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ | | ...
s798329748
p03846
C
#include<stdio.h> #include<string.h> int main(void) { int kazu, number[100000], flag = 0, count[100000] = { 0 }, i, n, t; const int MOD = 1e9 + 7; scanf("%d", &kazu); for (i = 0; i < kazu; i++) { scanf("%d", &number[i]); count[number[i]]++; } for (i = 0; i < kazu; i++) { /*if (kazu % 2 == 0) { if (i...
main.c: In function 'main': main.c:37:1: error: 'retrun' undeclared (first use in this function) 37 | retrun 0; | ^~~~~~ main.c:37:1: note: each undeclared identifier is reported only once for each function it appears in main.c:37:7: error: expected ';' before numeric constant 37 | retrun 0; | ^...
s636817218
p03846
C
#include<stdio.h> #include<string.h> int main(void) { int kazu, number[100000], flag = 0, count[100000] = { 0 }, i, n, t; const int MOD = 1e9 + 7; scanf("%d", &kazu); for (i = 0; i < kazu; i++) { scanf("%d", &number[i]); count[number[i]]++; } for (i = 0; i < kazu; i++) { if (kazu % 2 == 0) { if (i %...
main.c: In function 'main': main.c:37:1: error: 'retrun' undeclared (first use in this function) 37 | retrun 0; | ^~~~~~ main.c:37:1: note: each undeclared identifier is reported only once for each function it appears in main.c:37:7: error: expected ';' before numeric constant 37 | retrun 0; | ^...
s308763866
p03846
C
#include<stdio.h> #include<string.h> int main(void) { int kazu, number[100000],flag=0, count[100000] = { 0 }, i, n, t; const int MOD = 1e9 + 7; scanf("%d", &kazu); for (i = 0; i < kazu; i++) { scanf("%d", &number[i]); count[number[i]]++; } for (i = 0; i < kazu; i++) { if (kazu % 2 == 0) { if (i % 2 ...
main.c: In function 'main': main.c:37:9: error: 'return0' undeclared (first use in this function) 37 | return0; | ^~~~~~~ main.c:37:9: note: each undeclared identifier is reported only once for each function it appears in
s136618796
p03846
Java
package pac01; import java.util.Arrays; import java.util.Scanner; public class LiningUp { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); //人数 int N = sc.nextInt(); int[] A = new int[N]; //絶対値の入力 int[] a = new int[N]; double P; for(int i...
Main.java:6: error: class LiningUp is public, should be declared in a file named LiningUp.java public class LiningUp { ^ 1 error
s977530485
p03846
Java
public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ System.out.print(" "); Scanner sc = new Scanner(System.in); //人数 int N = sc.nextInt(); int[] A = new int[N]; //絶対値の入力 int[] a = new int[N]; double P; for(int i = 0; i < N ;i++){ a[i] = sc.nextInt(); A[i] = Math.abs((2 * i...
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) 1 error
s558175880
p03846
Java
package pac01; import java.util.Arrays; import java.util.Scanner; public class LiningUp { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ System.out.print(" "); Scanner sc = new Scanner(System.in); //人数 int N = sc.nextInt(); int[] A = new int[N]; //絶対値の入力 int[] a = new int[N]; ...
Main.java:6: error: class LiningUp is public, should be declared in a file named LiningUp.java public class LiningUp { ^ 1 error
s284780770
p03846
C++
#include<iostream> #include<cmath> #include<vector> #include<algorithm> using namespace std; int main(){ int N; cin>>N; vector<int> v; for(int i=0;i<N;i++){ int tmp; cin>>tmp; v.push_back(tmp); } v.sort(); bool bl=true; if(N%2==0){ for(int i=1;i<N;i+=2){ if(v[i] != i){ bl=false; break; } ...
a.cc: In function 'int main()': a.cc:16:11: error: 'class std::vector<int>' has no member named 'sort' 16 | v.sort(); | ^~~~
s053461164
p03846
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; if(N%2==0){ cout<<(2^(N/2))/(10^9 + 7)<<endl; }else{ cout<<(2^((N-1)/2)/(10^9 + 7)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:46: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<' 10 | cout<<(2^((N-1)/2)/(10^9 + 7)<<endl; | ~~~~~~~~~~~~~~~~~~~~^~~~~~ a.cc:10:52: error: expected ')' before ';' token ...
s502566091
p03846
C++
long M=1e9+7,s[1<<17],a,i,f; long p(long a,int b){return b?b%2?p(a*a%M,b/2)*a%M:p(a*a%M,b/2)%M:1;} main(n) { for(scanf("%d",&n);~scanf("%d",&a);s[a]++); if(n%2)for(f|=*s-1;++i<n;)f|=(i%2?s[i]:s[i]-2)?1:0; else for(f|=*s;++i<n;)f|=(i%2?s[i]-2:s[i])?1:0; printf("%d\n",f?0:p(2,n/2)); }
a.cc:3:5: error: expected constructor, destructor, or type conversion before '(' token 3 | main(n) | ^
s486892106
p03846
C++
using namespace std; int main() { int n; cin >> n; int *a = new int[n]; for (int i = 0; i < n; i++)cin >> a[i]; //解の存在確認 int *ax = new int[(n + n % 2) / 2]; for (int i = 0; i < (n + n % 2) / 2; i++) ax[i] = 0; bool check = true; if (n % 2) { ax[0] = 1; for (int i = 0; i < n; i++) ax[a[i] / 2]++; for (int...
a.cc: In function 'int main()': a.cc:4:9: error: 'cin' was not declared in this scope 4 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:37:17: ...
s595648334
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int N = 0; long long result = 0.0, p1; cin >> N; p1 = (pow(10, 9) + 7); if(N % 2 == 0){ N /= 2; result = pow(2 , N) % p1; } else { N = (N-1) / 2; result = pow(2, N) % p1; } return 0; }
a.cc: In function 'int main()': a.cc:15:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%' 15 | result = pow(2 , N) % p1; | ~~~~~~~~~~ ^ ~~ | | | | | lo...
s418016206
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int N = 0; cin >> N; if(N % 2 == 0){ N /= 2; cout << pow(2 , N) % (pow(10, 9) + 7); } else { N = (N-1) / 2; cout << pow(2, N) % (pow(10, 9) + 7); } return 0; }
a.cc: In function 'int main()': a.cc:12:24: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 12 | cout << pow(2 , N) % (pow(10, 9) + 7); | ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~ | ...
s618903257
p03846
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <algorithm> #include <cmath> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <stack> #include <queue> //ranker using namespace std; #define REPS(i, a, n) for (int i = (a); i < (n); ++i) #define R...
a.cc: In function 'void sort2vectors(std::vector<int>&, std::vector<int>&)': a.cc:69:9: error: 'iota' was not declared in this scope 69 | iota(p.begin(), p.end(), 0); | ^~~~ a.cc: In function 'int main()': a.cc:199:25: error: invalid operands of types 'long long int' and 'double' to binary 'ope...
s361861404
p03846
C++
#include <iostream> #include <cstdio> #include <cmath> #include <string> #include <vector> #include <set> #include <map> #include <algorithm> using namespace std; long long MOD = 1000000007; int main() { int N, A[100005]; cin>>N; for(int i=0; i<N; i++) cin>>A[i]; /* int m[100005]; fill(m, m+N, 0); ...
a.cc: In function 'int main()': a.cc:91:20: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%' 91 | cout<<pow(2,N/2) % MOD<<endl; | ~~~~~~~~~~ ^ ~~~ | | | | | long long int ...
s761611897
p03846
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,temp; cin>>n; vector<int> x; for(int i=0;i!=n;++i){ cin>>temp; x.push_back(temp); } bool test=true; if(n%2){ if(count(x.begin(),x.end(),0)!=1) test=false; for(int i=2;i<n;i+=2){ if(count(x.begin(),x.end(),i)!=2) test=false; } } ...
a.cc: In function 'int main()': a.cc:30:48: error: expected ';' before 'a' 30 | ret=(ret*a)%mod | ^ | ; 31 | a=(a*a)%mod | ...
s588058738
p03846
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,temp; cin>>n; vector<int> x; for(int i=0;i!=n;++i){ cin>>temp; x.push_back(temp); } bool test=true; if(n%2){ if(count(x.begin(),x.end(),0)!=1) test=false; for(int i=2;i<n;i+=2){ if(count(x.begin(),x.end(),i)!=2) test=false; } } ...
a.cc: In function 'int main()': a.cc:28:17: error: expected ',' or ';' before 'while' 28 | while(e>0){ | ^~~~~
s162483657
p03846
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,temp; cin>>n; vector<int> x; for(int i=0;i!=n;++i){ cin>>temp; x.push_back(temp); } bool test=true; if(n%2){ if(count(x.begin(),x.end(),0)!=1) test=false; for(int i=2;i<n;i+=2){ if(count(x.begin(),x.end(),i)!=2) test=false; } } ...
a.cc: In function 'int main()': a.cc:30:44: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 30 | ret=(ret*a)%(1E9+7); | ~~~~~~~^~~~~~~~ | | | | ...
s839701646
p03846
C++
$
a.cc:2:1: error: '$' does not name a type 2 | $ | ^
s054101176
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[] an = new int[n]; int sameNum = 0; for( int i=0; i<n; i++ ){ an[i]=sc.nextInt(); } Arrays.sort(an); if( n%2 == 1 && an[n-1] != 0 ) System.out.println...
Main.java:19: error: illegal start of type for( int i=(n-1)-n%2; i>0; i-=2 ){ ^ Main.java:19: error: <identifier> expected for( int i=(n-1)-n%2; i>0; i-=2 ){ ^ Main.java:19: error: <identifier> expected for( int i=(n-1)-n%2; i>0; i-=2 ){ ^ Main.java:26: err...
s776254354
p03846
C
#include<stdio.h> int main(void){ int N,i,j,tmp[50010],hoge,ans; int A[100001]; ans =1; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } for(i=0;i<N;i++){ tmp[A[i]]++; } if(N%2){ for(i=1;i<N;i++){ if(i%2 == 0){ if(tmp[i] == 2){ ans *=2; }else{ ans *=0; ...
main.c: In function 'main': main.c:31:6: error: expected '}' before 'else' 31 | }else{ | ^~~~ main.c:50:1: error: expected declaration or statement at end of input 50 | } | ^
s749076862
p03846
C
#include<stdio.h> #include<limits.h> int main(){ int diff[100000]={0}; int n,i,temp; int max=0; int isEven=0; scanf("%d",&n); scanf("%d",&temp); diff[temp]++; if(temp>max){ max=temp; } if(temp%2==0){ isEven=1; } for(i=1;i<n;i++){ scanf("%d",&temp); diff[temp]++; if(temp>max){ max=temp; } ...
main.c: In function 'main': main.c:72:26: error: expected ';' before '}' token 72 | puts("0") | ^ | ; 73 | }else{ | ~ main.c: At top level: main.c:90:9: error: expected identifier or '(' before 're...
s462256770
p03846
C++
int N; int A[10001]={}; int B[10001][2]={}; int ans; int main(){ scanf("%d",&N); for(int i=1;i<=N;i++){ scanf("%d",&A[i]); B[i][1]=(N+A[i]+1)/2; B[i][2]=(N-A[i]+1)/2; } if(N%2==0){ ans==(1<<(N/2))/1000000007; }else{ ans==(1<<((N-1)/2))/1000000007; } for(int i=1;i<=N;i++){ if(B[i][1]+B[i][2]!=N-1){ ...
a.cc: In function 'int main()': a.cc:7:9: error: 'scanf' was not declared in this scope 7 | scanf("%d",&N); | ^~~~~ a.cc:23:9: error: 'printf' was not declared in this scope 23 | printf("%d\n",ans); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; thi...
s346744667
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int i, j, zcnt = 0; int N, a[100001], ncnt[100001] = {0}; int ans = 0; bool flag = 0; cin >> N; for(i = 0; i < N; ++i){ cin >> a[i]; if(a[i] == 0) ++zcnt; else ++ncnt[a[i]]; if(N % 2 == 1 && a[i] % 2 == 1) flag = 1; else if(N % 2 ==...
a.cc: In function 'int main()': a.cc:40:51: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 40 | if(flag == 0) cout << pow(2, N/2) % (pow(10, 9) + 7) << endl; | ...
s837354578
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int n; cin >> n; int d[n]; int m; for(int i = 0; i < n; i++) d[i] = 0; for(int i = 0; i < n; i++){ cin >> m; d[m]++; // 同じ絶対値は2だけ if(3 == d[m]){ cout << "0" << endl; return 0; } ...
a.cc: In function 'int main()': a.cc:73:22: error: invalid operands of types 'double' and 'double' to binary 'operator%' 73 | cout << int(answer % c) << endl; | ~~~~~~ ^ ~ | | | | double double
s742959759
p03846
Java
import java.util.Scanner; public class LiningUp { 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()]++; } for (int i = 0; i < n; i++) { if (n % 2 == 0) { if (i % 2 == 1 && a[i] ...
Main.java:3: error: class LiningUp is public, should be declared in a file named LiningUp.java public class LiningUp { ^ 1 error
s424850640
p03846
Java
import java.util.Scanner; 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()]++; } for (int i = 0; i < n; i++) { if (n % 2 == 0) { if (i % 2 == 1 && a[i] != 2...
Main.java:31: error: reached end of file while parsing } ^ 1 error
s676908872
p03846
Java
import java.util.Scanner; 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()]++; } for (int i = 0; i < n; i++) { if (n % 2 == 0) { if (i % 2 == 1 && a[i] != 2...
Main.java:31: error: reached end of file while parsing } ^ 1 error
s328699736
p03846
C++
8 7 5 1 1 7 3 5 3
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 8 | ^
s101978646
p03846
C++
#include <iostream> #include <cmath> using namespace std; int main(){ int n; cin >> n; int d[n]; int m; for(int i = 0; i < n; i++) d[i] = 0; for(int i = 0; i < n; i++){ cin >> m; d[m]++; if(3 == d[m]){ cout << "0" << endl; break; } // 偶数 if(0 == n % 2){ ...
a.cc: In function 'int main()': a.cc:69:3: error: expected ',' or ';' before 'for' 69 | for(int i = 0; i < (n / 2); i++){ | ^~~ a.cc:69:18: error: 'i' was not declared in this scope 69 | for(int i = 0; i < (n / 2); i++){ | ^
s235578879
p03846
C++
#include <bits/stdc++.h> using namespace std; int main(){ int i, j, zcnt = 0, ans = 0; int N, a[100001], ncnt[100001] = {0}; bool flag = 0; cin >> N; for(i = 0; i < N; ++i){ cin >> a[i]; if(a[i] == 0) ++zcnt; else ++ncnt[a[i]]; if(a[i] >= N) flag = 1; if(N % 2 == 1 && a[i] % 2 == 1) flag = 1; else if...
a.cc: In function 'int main()': a.cc:40:43: error: invalid operands of types 'int' and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 40 | if(flag == 0) cout << ans % (pow(10, 9) + 7) << endl; | ~~~ ^ ~~~~~~~~~~~~~~~~ | ...
s363675498
p03846
C++
1#include <iostream> #include <vector> using namespace std; const unsigned long long int MAX=1000000000+7; int cnt[100001]; int main(){ int N; cin>>N; unsigned long long int total=1; for(int i=0;i<N/2;i++) total*=2; bool flag=true; for(int i=0;i<N;i++){ int a; cin>>a; cnt[a]++; if(N<=...
a.cc:1:2: error: stray '#' in program 1 | 1#include <iostream> | ^ a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1#include <iostream> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, fr...
s725647524
p03846
C++
#include <iostream> #include <cstdio> using namespace std; long long cnt = 1; int n; bool v; int b[100005]; void f(int p) { for(int i = 0; i < p; i++) { cnt = 2 * cnt % (1e9+7); } } int main() { scanf("%d", &n); for(int i = 0; i < n; i++) { int t; scanf("%d", &t); ...
a.cc: In function 'void f(int)': a.cc:15:23: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 15 | cnt = 2 * cnt % (1e9+7); | ~~~~~~~ ^ ~~~~~~~ | | | | | double | long ...
s198087514
p03846
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> #include <string> #include <cstdio> #include <stack> using namespace std; #define rep(i,n) for (int i=0 ; i<(n);i++) #define INF 1e9+7 int main(){ int n; bool f = false; cin >> n; vector <int> a(n); rep(i, n) cin >> a[i]; sort(a.begin()...
a.cc: In function 'int main()': a.cc:26:53: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 26 | cout << (pow(2, a.size()/2))%1000000007; | ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ | ...
s069102555
p03847
C++
.
a.cc:1:1: error: expected unqualified-id before '.' token 1 | . | ^
s017947702
p03847
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>d; inline int solve(int x){ if(d[x]!=0) return d[x]; else return d[x]=((solve(x/2)+solve((x-1)/2)+solve((x-2)/2)))%mod; } signed main(){ d[0]=1;d[1]=2; int n; cin>>n; n=read(); int ans=so...
a.cc: In function 'int main()': a.cc:15:11: error: too few arguments to function 'ssize_t read(int, void*, size_t)' 15 | n=read(); | ~~~~^~ In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24, from /usr/include/signal.h:328, from /usr/include/c++/1...
s439409084
p03847
C++
#include<bits/stdc++.h> using namespace std; #define ll long long const ll m=1e9+7; map<int,int>d; ll p(l x){ if(d[x]!=0)return d[x]; else return d[x]=((p(x/2)+p((x-1)/2)+p((x-2)/2)))%m; } int main(){ d[0]=1;d[1]=2; int n; scanf ("%d",&n); int ans=p(n); printf("%lld\n",ans); return 0;}
a.cc:6:6: error: 'l' was not declared in this scope 6 | ll p(l x){ | ^ a.cc: In function 'int main()': a.cc:14:10: error: 'p' cannot be used as a function 14 | int ans=p(n); | ~^~~
s275839451
p03847
C++
#include<iostream> #include<map> using namespace std; const long long mod=1e9+7; map<long long,long long> d; long long dx(long long x) { if(d[x]!=0){ return d[x]; } else{ return d[x]=((solve(x>>1)+solve((x-1)>>1)+solve((x-2)>>!)))%mod; } } int main() { d[0]=1; d[1]=2; long lo...
a.cc: In function 'long long int dx(long long int)': a.cc:12:23: error: 'solve' was not declared in this scope 12 | return d[x]=((solve(x>>1)+solve((x-1)>>1)+solve((x-2)>>!)))%mod; | ^~~~~ a.cc:12:65: error: expected primary-expression before ')' token 12 | return d[x]=...
s372770556
p03847
C++
#include<iostream> #include<map> using namespace std; const long long mod=1e9+7; map<long long,long long> d; long long dx(long long n) { if(d[x]!=0){ return d[x]; } else{ return d[x]=((solve(x>>1)+solve((x-1)>>1)+solve((x-2)>>!)))%mod; } } int main() { d[0]=1; d[1]=2; long lo...
a.cc: In function 'long long int dx(long long int)': a.cc:8:10: error: 'x' was not declared in this scope 8 | if(d[x]!=0){ | ^ a.cc:12:23: error: 'solve' was not declared in this scope 12 | return d[x]=((solve(x>>1)+solve((x-1)>>1)+solve((x-2)>>!)))%mod; | ^...
s717421787
p03847
C++
#include<bits/stdc++.h> #define ll long long using namespace std; map<ll,ll>dp; ll mod=1e9+7; ll f(ll x) { if(x==0)return dp[0]=1; else if(x==1)return dp[1]=2; else if(dp[x])return dp[x]; else { return dp[x]=(f(x/2)+f((x-1)/2)+f((x-2)/2))%mod; } } int main() { ll x; cin>>x; cout<...
a.cc:22:1: error: extended character — is not valid in an identifier 22 | ———————————————— | ^ a.cc:22:1: error: extended character — is not valid in an identifier a.cc:22:1: error: extended character — is not valid in an identifier a.cc:22:1: error: extended character — is not valid in an identifier a.cc:22:1...
s601762718
p03847
C++
// luogu-judger-enable-o2 #include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>d; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); ret...
a.cc:15:24: error: expected initializer before '/' token 15 | inline int solve(int x)/ | ^ a.cc: In function 'int main()': a.cc:28:13: error: 'solve' was not declared in this scope 28 | int ans=solve(n); | ^~~~~
s987703685
p03847
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>d; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); return x*q; } inline int solve(int x) { if(d...
cc1plus: error: '::main' must return 'int'
s084681341
p03847
C++
#include<cstdio> using namespace std; int n,m,sum1,sum2,a[110],p,x; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&a[i]); sum1+=a[i]; } scanf("%d",&m); sum2=sum1; while(m--) { scanf("%d%d",&p,&x); if(x>=a[p-1]) sum1+=x-a[p-1];拟 el...
a.cc: In function 'int main()': a.cc:17:38: error: '\U000062df' was not declared in this scope 17 | if(x>=a[p-1]) sum1+=x-a[p-1];拟 | ^~
s546262719
p03847
C++
#include<iostream> #include<cstdio> #include<string> using namespace std; typedef __int64 ll; const int INF = 1<<30; const int MAXN = (int) 7e6+11; const int MAX_SIZE = 40; struct Node { ll val; int ch[2]; } Trie[MAXN]; int use; ll S[MAX_SIZE]; int n, m; int New() { Trie[use].val = Trie[use].ch[0] = Trie[use].ch[1] ...
a.cc:5:9: error: '__int64' does not name a type; did you mean '__int64_t'? 5 | typedef __int64 ll; | ^~~~~~~ | __int64_t a.cc:10:9: error: 'll' does not name a type 10 | ll val; | ^~ a.cc:14:1: error: 'll' does not name a type 14 | ll S[MAX_SIZE]; | ^~ a...
s656418502
p03847
C++
#include <algorithm> #include <iostream> #include <cstring> #include <cstdio> #include <string> #include <vector> #include <queue> #include <stack> #include <cmath> #include <map> #include <set> #define mm(i,v) memset(i,v,sizeof i); using namespace std; typedef long long ll; const int mod=1e9+7; //map<ll,ll> v; ll f(i...
a.cc: In function 'int main()': a.cc:29:9: error: 'v' was not declared in this scope 29 | v[0]=1; | ^
s970216712
p03847
C++
#include<map> #include<iostream> using namespace std; typedef unsigned long long inter; const inter m=1e9+7; map<inter,inter> dick; inter f(inter x) { if(dick[x]) return dick[x]; else return dick[x]=((f(x/2)+f((x-1)/2)+f((x-2)/2)))%m; } int main() { dick[0]=1; dick[1]=2; inter n; cin...
a.cc: In function 'int main()': a.cc:22:5: error: 'work' was not declared in this scope 22 | work(); | ^~~~
s372326653
p03847
C++
#include<bits/stdc++.h> using namespace std; const long long mod=1e9+7; map<long long,long long>dp; long long Dp(long long x) { if(dp[x]) return dp[x]; else return dp[x]=((Dp[x/2])+Dp[(x-1)/2]+Dp[(x-2)/2])%mod; } int main(){ Dp[0]=1; Dp[1]=2; long long n; cin>>n; cout<<Dp[n]; return 0; }
a.cc: In function 'long long int Dp(long long int)': a.cc:10:30: warning: pointer to a function used in arithmetic [-Wpointer-arith] 10 | return dp[x]=((Dp[x/2])+Dp[(x-1)/2]+Dp[(x-2)/2])%mod; | ^ a.cc:10:43: warning: pointer to a function used in arithmetic [-Wpointer-arith...
s942824415
p03847
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>f; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); return x*q; } inline int solv...
cc1plus: error: '::main' must return 'int'
s546105949
p03847
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>f; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); return x*q; } inline int solv...
cc1plus: error: '::main' must return 'int'
s913832465
p03847
C++
#include<bits/stdc++.h> using namespace std; long long f[2000000001]; long long n; long long ans; long long s=1000000007; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); return x...
/tmp/ccY6SglS.o: in function `main': a.cc:(.text+0x24): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccY6SglS.o a.cc:(.text+0x2b): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccY6SglS.o a.cc:(.text+0x3b): relocation trunc...
s020804627
p03847
C++
#include<bits/stdc++.h> using namespace std; long long n; int dfs(u){ if(u==1) return 2; if(u==2) return 4;//+2 if(u==3) return 5;//+1 if(u==4) return 8;//+3 if(u==5) return 10;//+2 if(u==6) return 13;//+3 if(u==7) return 14;//+1 if(u==8) return 18;//+4 if(u==9) return 21;//+3 if(u==10) return 26;//+5 } int m...
a.cc:4:9: error: 'u' was not declared in this scope 4 | int dfs(u){ | ^ a.cc: In function 'int main()': a.cc:18:18: error: 'dfs' cannot be used as a function 18 | int m=dfs(n); | ~~~^~~
s001592419
p03847
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod=1e9+7; map<int,int>d; inline int read() { char ch=getchar(); int x=0,q=1; while(ch>'9' || ch<'0')q=ch==45?-1:q,ch=getchar(); while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=getchar(); return x*q; } inline int sol...
a.cc: In function 'int main()': a.cc:29:29: error: expected ';' before 'return' 29 | printf("%lld\n",ans) | ^ | ; 30 | return 0; | ~~~~~~ a.cc:30:18: error: expected '}' at end of input 30 | ...
s304559762
p03847
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; typedef pair<ll,P> PP; typedef vector<ll> Vector; typedef vector<Vector> DVector; typedef priority_queue<PP, vector<PP>, greater<PP>> PPQueue; #define fi first #define se secon...
a.cc: In function 'll f(ll, ll)': a.cc:39:6: error: 'memo' was not declared in this scope; did you mean 'memp'? 39 | if(memo.count(m))return memo[m]; | ^~~~ | memp a.cc:41:3: error: 'memo' was not declared in this scope; did you mean 'memp'? 41 | memo[m] = f(s/2, x/2) + f((s-1)/2, (x^1)/...
s142887540
p03847
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final long N = sc.nextLong(); long cnt = 0; long u, v, a, x; for(u = 0; u <= N; u++) { for(v = u; v <= N; v++) { for(a = 0; a <= v / 2; a++) { x = a ^ v - a; if(x == u) { ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s102273567
p03847
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //final long N = sc.nextLong(); final long N = 1000000000000000000l; long cnt = 0; long u, v, a, x; for(u = 0; u <= N; u++) { for(v = u; v <= N; v++) { for(a = 0; a <= v / 2; a++) ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s770668295
p03847
C++
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); //final long N = sc.nextLong(); final long N = 1000000000000000000l; long cnt = 0; long u, v, a, x; for(u = 0; u <= N; u++) { for(v = u; v <= N; v++) { for(a = 0; a <= v / 2; a++) ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s008133434
p03847
C++
#include <algorithm> #include <bitset> #include <cassert> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <ctime> #include <deque> #include <fstream> #include <iomanip> #include <iostream> #include <limits> #include <list> #include <map> #include <numeric> #include <...
a.cc: In function 'll call(int)': a.cc:59:5: error: 'dp' was not declared in this scope; did you mean 'np'? 59 | dp[i][np][nq] += dp[i-1][p][q]; | ^~ | np a.cc:62:10: error: 'dp' was not declared in this scope; did you mean 'd'? 62 | return dp[len][0][0]; | ^~ | ...
s179200047
p03847
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<ll, ll> pll; const ll MOD = 1e9 + 7; map<pll, ll> dp; ll f(ll s, ll x) { if (dp.count(pll(s, x))) return dp[pll(s, x)]; if (s == 0 && x == 0) return 1; ll res = f(s/2, x/2) % MOD; if (s >= 1 && x >= 1) { res = (res + f((s-1)...
a.cc:28:1: error: extended character   is not valid in an identifier 28 |   | ^ a.cc:23:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 23 | main() { | ^~~~ a.cc:28:1: error: '\U000000a0' does not name a type 28 |   | ^
s694781805
p03847
C++
#include <stdio.h> #include <iostream> #include <map> #include <bits/stdc++.h> #define LL long long using namespace std; const LL mod=1e9 + 7; map<LL, LL> mp; /* int dp[N]; bool check[N]; */ LL dfs(LL N){ if(N==0) return 1; if(N==1) return 2; if(mp[N] > 0) return mp[N]; return mp[N] = (dfs(N/2) + d...
a.cc: In function 'long long int dfs(long long int)': a.cc:22:65: error: expected ')' before ';' token 22 | return mp[N] = (dfs(N/2) + dfs((N-1)/2) + dfs((N-2)/2) % mod; | ~ ^ | ...
s793140669
p03847
C++
#include <iostream> using namespace std; int main() { int N; int b; int uuu; long MOD = pow(10,9) + 7; long cnt = 0; cin >> N; for(int uu=0;uu<=N;uu++) { for(int vv=0;vv<=N;vv++) { for(int a=0;a<=vv;a++) { b = vv-a; //a+b=vv uuu = a^b; if(b >= 0 && uuu == uu) { cerr << uu << vv ...
a.cc: In function 'int main()': a.cc:10:20: error: 'pow' was not declared in this scope 10 | long MOD = pow(10,9) + 7; | ^~~
s822821276
p03848
C++
#include <iostream> using namespace std; int main(){ int N, flg = 0; long long ans = 1, t = 1000000007; cin >> N; int A[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; i+=2){ if(A[i]!=i+1 || A[i+1]!=i+1){ flg = 1; brea...
a.cc: In function 'int main()': a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(A, A+N); | ^~~~ | short
s199588447
p03848
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> iint; typedef pair<ll,ll> llll; #define ALL(x) (x).begin(),(x).end() const ll zero = 0; const ll one = 1; const ll INF = 9223372036854775807; //10^18 const int inINF = 2147483647; //10^9 const ll MO...
a.cc: In function 'int main()': a.cc:62:24: error: 'n' was not declared in this scope 62 | ll ans = modpow(2, n/2); | ^
s242530770
p03848
C++
#include <bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int n, m, a[maxn]; multiset<int, greater<int>> prices; int32_t main() { cin >> n >> m; for(int i = 0; i < n; i++) { cin >> a; prices.insert(a); } for(int i = 0; i < m; i++) { int largest = *prices.b...
a.cc: In function 'int32_t main()': a.cc:13:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [100005]') 13 | cin >> a; | ~~~ ^~ ~ | | | | | int [100005] | std::istream {aka std::b...
s205792159
p03848
C++
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int,int> P; int INF = 1e9+7; int mod = 1e9+7; int dx[4] = {1, 0, -1, 0}; int dy[4] = {0, 1, 0, -1}; signed main() { int N; cin >> N; vector<int>A(N); map<int,int>Mp; for(int i = 0; i < N; i++) { cin >> A[i]; ...
a.cc: In function 'int main()': a.cc:27:27: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'long long int' to binary 'operator%' 27 | cout << pow(2,N/2)%INF << endl; | ~~~~~~~~~~^~~~ | | | | ...
s355563119
p03848
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; #define rep(i,n) for(ll i=0;i<n;i++) #define repl(i,l,r) for(ll i=(l);i<(r);i++) #define per(i,n) for(ll i=n-1;i>=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define all(x)...
a.cc: In function 'int main()': a.cc:112:20: error: expected primary-expression before 'break' 112 | if(m[i]!=2){ ca++, break;} | ^~~~~
s312165232
p03848
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<n;i++) using namespace std; typedef long long ll; typedef pair<int,int> P; typedef vector<int> vi; const int m=1000000007; int main(){ int n; cin >> n; vi a(n); rep(i,n) cin >> a[i]; sort(a.begin(),a.end()); int f=n%2; ll ans=1; if(f==1){ if(a...
a.cc: In function 'int main()': a.cc:23:33: error: expected ';' before '}' token 23 | rep(i,(n-1)/2){ans*=2;ans%=m} | ^ | ; a.cc:29:29: error: expected ';' before '}' token 29 | rep(i,n/2){ans*=2;ans%=m} | ...
s540829617
p03848
C++
#include<bits/stdc++.h> using anemspace std; int main(){ int n; cin>>n; vector<int> a(n); for(auto& ai:a)cin>>ai; map<int,int64_t> mp; for(auto const& ai:a)mp[ai]++; constexpr int64_t mod = 1e9+7; if(n&1){ bool ok = true; if(mp[0]!=1)ok=false; for(auto& [k,v]:mp){ if(k%2!=0)ok...
a.cc:2:7: error: expected nested-name-specifier before 'anemspace' 2 | using anemspace std; | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:5:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 5 | cin>>n; | ^~~ | std::cin In file included from /usr/include/x8...
s351446194
p03848
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; const ll mod = 1e9+7; //繰り返し二乗法 ll EX(ll x,ll n){ if(n == 0) return 1; else if(n%2 == 1) return EX(x,n-1)*x%mod; else return EX(x*x%mod,n/2)%mod; }; int main(){ ll n; cin >> n; vector<ll> a(n); ll tmp = n/2+1; vect...
a.cc: In function 'int main()': a.cc:29:11: error: cannot resolve overloaded function 'end' based on conversion to type 'bool' 29 | if(end){ | ^
s413852447
p03848
C++
#include <bits/stdc++.h> using namespace std; #define ll long long ll MOD = 10 ** 9 + 7; int main() { }
a.cc:6:14: error: invalid type argument of unary '*' (have 'int') 6 | ll MOD = 10 ** 9 + 7; | ^~~
s254106046
p03848
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'int main()': a.cc:34:17: error: expected initializer before '++' token 34 | ll cnt[a[i]]++; | ^~ a.cc:45:10: error: expected ';' before '}' token 45 | i -=2 | ^ | ; 46 | } | ~
s544669328
p03848
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'll modpow(ll, ll)': a.cc:24:28: error: 'MDO' was not declared in this scope; did you mean 'MOD'? 24 | return n*modpow(n,a-1)%MDO; | ^~~ | MOD a.cc: In function 'int main()': a.cc:34:17: error: expected initializer before '++' to...
s453390513
p03848
C++
#include <bits/stdc++.h> using namespace std; using ll=long long; const ll MOD=1000000007; const double PI=3.14159265358979; const ll INF= pow(10,18); typedef pair<ll,ll> P; typedef vector<ll> vl; typedef vector<vl> vvl; #define FOR(i,a,b) for(ll i=a;i<b;i++) #define rep(i,n) FOR(i,0,n) string abc="abcdefghijklmnopqrst...
a.cc: In function 'll modpow(ll, ll)': a.cc:24:28: error: 'MDO' was not declared in this scope; did you mean 'MOD'? 24 | return n*modpow(n,a-1)%MDO; | ^~~ | MOD a.cc: In function 'int main()': a.cc:34:17: error: expected initializer before '++' to...
s968974520
p03848
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:85:35: error: invalid operands of types 'll' {aka 'long long int'} and 'double' to binary 'operator%' 85 | ans = ans % (1e9 + 7); | ~~~ ^ ~~~~~~~~~ | | | | ...
s633417039
p03848
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:75:33: error: 'retun' was not declared in this scope 75 | retun 0; | ^~~~~ a.cc:91:33: error: 'retun' was not declared in this scope 91 | retun 0; | ...
s186602878
p03848
C++
#include<bits/stdc++.h> #define rep(i,n)for(int i=0;i<n;++i) #include<string> #include<vector> using namespace std; typedef long long ll; typedef pair<int, int>P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a ...
a.cc: In function 'int main()': a.cc:61:9: error: 'vvector' was not declared in this scope 61 | vvector<int>b(n); | ^~~~~~~ a.cc:61:17: error: expected primary-expression before 'int' 61 | vvector<int>b(n); | ^~~ a.cc:64:17: error: 'b' was not declared in this s...
s113740946
p03848
C++
#include<bits/stdc++.h> #include<deque> #include<iostream> #include<algorithm> using namespace std; #define ll long long const int maxn = 3e5 + 5; int n, m; ll t[maxn], p[maxn], f[maxn], g[maxn], F[maxn], G[maxn], h[maxn]; pair<int, ll> drink[maxn]; struct node { ll x, y; }; long double k(const node &a, const node &...
a.cc: In function 'long double k(const node&, const node&)': a.cc:19:16: error: expected primary-expression before 'long' 19 | return long double(a.y - b.y) / long double(a.x - b.x); | ^~~~ a.cc:19:15: error: expected ';' before 'long' 19 | return long double(a.y - b.y) / long...
s355972885
p03848
C
# include <cstdio> # include <map> # include <cmath> using namespace std; const int mod = 1e9+7; int main() { int n; int a[100005]; map<int,int> m; scanf("%d",&n); for(int i = 0;i < n;i++) { scanf("%d",&a[i]); m[a[i]]++; } int flag = 0; if(n%2) //奇数 { ...
main.c:1:11: fatal error: cstdio: No such file or directory 1 | # include <cstdio> | ^~~~~~~~ compilation terminated.
s663595798
p03848
C++
from collections import defaultdict n = int(input()) l = input().split(" ") l1=defaultdict(int) for i in range(len(l)): l[i]=int(l[i]) l1[l[i]]+=1 if l1[0]>=1 and n%2==0: print(0) elif l1[0]>1 and n%2==1: print(0) else: prod=1 for key in l1.keys(): prod*=l1[key] print(prod%(100000000...
a.cc:1:1: error: 'from' does not name a type 1 | from collections import defaultdict | ^~~~
s140113532
p03848
C++
import math n=input() mod = int(1e9) + 7 a=list(map(int,raw_input().split())) if(len(a)%2==0 and a.count(0)>0): print(0) elif(len(a)%2!=0 and a.count(0)>1): print(0) else: res=0 b=set(a) if(a.count(0)): print(pow(2,len(b)-1,mod)) else: print(pow(2,len(b),mod))
a.cc:1:1: error: 'import' does not name a type 1 | import math | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s848254097
p03848
C++
#include<bits/stdc++.h> using namespace std; #define int long long const int mod = 1000000007; signed main(){ int n; cin >> n; map<int,int> a; for(int i = 0; i < n; i++){ int b; cin >> b; a[b]++; } if(n % 2 == 1){ for(int i = 0; i < n; i+=2){ bool ans ...
a.cc: In function 'int main()': a.cc:43:36: error: expected ';' before ')' token 43 | for(int i = 1 < i <(n / 2); i++){ | ^ | ;
s137071637
p03848
C++
#include<bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep2(i,a,b) for(int i=a;i<b;i++) #define each(it,v) for(auto it : v) #define mod 1000000007 #define all(v) (v).begin(),(v).end() #define ll long long #define vi vector<int> #define vll vector<ll> #define vpii vector<pair<int,int>> #define vv v...
a.cc:14:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 14 | main() | ^~~~ a.cc: In function 'int main()': a.cc:42:21: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'int' to binary 'operator%' 42 | cout<<pow(2,n/2)%mod<<endl; ...
s713158374
p03848
C++
N = int(input()) A = list(map(int, input().split())) data = [0] * N possible = True MOD = 10**9+7 for a in A: data[a] += 1 if N % 2 == 0: for i in range(1,N,2): if data[i] != 2: possible = False break else: if data[0] == 1: for i in range(2,N,2): if data[i] != 2: possible = False break else...
a.cc:1:1: error: 'N' does not name a type 1 | N = int(input()) | ^
s207787446
p03848
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn=1e5+10; const ll mm=1e9+7; int sp[maxn],vis[maxn]; int main() { int n; cin>>n; int flag=0; memset(vis,0,sizeof(vis)); for(int i=1;i<=n;++i){ cin>>sp[i]; vis[sp[i]]++; } if(n%2==1) { ...
a.cc: In function 'int main()': a.cc:42:33: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and 'const ll' {aka 'const long long int'} to binary 'operator%' 42 | cout<<pow(2,(n-1)/2)%mm<<endl; | ~~~~~~~~~~~~~~^~~ | ...
s920435960
p03848
C++
#include<cstdio> #include<iostream> using namespace std; typedef long long ll; const int mod = 10e9 + 7; const int maxn = 10e5 + 5; int a[maxn]; ll fast_mod(ll base, ll n) { ll res = 1; while (n > 0) { if (n & 1) res = res * base % mod; base = base * base % mod; n >>= 1; } return res % mod; } int main() ...
a.cc:7:22: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000007e+10' to '2147483647' [-Woverflow] 7 | const int mod = 10e9 + 7; | ~~~~~^~~ a.cc: In function 'int main()': a.cc:25:9: error: 'memset' was not declared in this scope 25 | memset(a, 0, s...
s765190717
p03848
C++
#include <bits/stdc++.h> #define int long long using namespace std; const int mod=1e9+7; const int Max=100005; int n,m,s; int sum[Max]; inline int ksm(int a,int b) { int ans=1; while(b) { if(b&1) ans=(ans*a)%mod; b>>=1; a=(a*a)%mod; } return ans; } signed main() { scanf("%d",&n); for(int i=1;i<=n;...
a.cc: In function 'int main()': a.cc:30:1: error: '\U0000ff5d' was not declared in this scope 30 | } | ^~ a.cc:30:3: error: expected '}' at end of input 30 | } | ^ a.cc:23:1: note: to match this '{' 23 | { | ^
s155856433
p03848
C++
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 100005; const int mod = 1e9+7; int a[N]; int num[N]; ll qpow(ll a,ll b,ll p) { ll ans=1%p; while(b) { if(b&1) ans=(ans*a)%p; b>>=1; a=(a*a)%p; } return ans; } int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i+...
a.cc: In function 'int main()': a.cc:79:1: error: '\U0000ff5d' was not declared in this scope 79 | } | ^~ a.cc:79:3: error: expected '}' at end of input 79 | } | ^ a.cc:21:1: note: to match this '{' 21 | { | ^
s256996326
p03848
C++
#include <bits/stdc++.h> using namespace std; #define ll long long const int N = 100005; const int mod = 1e9+7; int a[N]; int num[N]; ll qpow(ll a,ll b,ll p) { ll ans=1%p; while(b) { if(b&1) ans=(ans*a)%p; b>>=1; a=(a*a)%p; } return ans; } int main() { int n; scanf("%d",&n); for(int i=1;i<=n;i+...
a.cc: In function 'int main()': a.cc:79:1: error: '\U0000ff5d' was not declared in this scope 79 | } | ^~ a.cc:79:3: error: expected '}' at end of input 79 | } | ^ a.cc:21:1: note: to match this '{' 21 | { | ^
s833785990
p03848
C++
#include <bits/stdc++.h> #define int long long using namespace std; const int mod=1e9+7; const int Max=100005; int n,m,s; int sum[Max]; inline int ksm(int a,int b) { int ans=1; while(b) { if(b&1) ans=(ans*a)%mod; b>>=1; a=(a*a)%mod; } return ans; } signed main() { scanf("%d",&n); for(int i=1;i<=n...
a.cc: In function 'int main()': a.cc:31:1: error: '\U0000ff5d' was not declared in this scope 31 | } | ^~ a.cc:31:3: error: expected '}' at end of input 31 | } | ^ a.cc:24:1: note: to match this '{' 24 | { | ^
s938108980
p03848
Java
import java.util.*; class Main{ // static final int DIV = 100000007L; static final int MAX = 2000000000; public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ary = new int[n]; for(int i = 0;i < n;i++)ary[i] = sc.ne...
Main.java:5: error: incompatible types: possible lossy conversion from long to int static final int DIV = 100000007L; ^ 1 error
s501228183
p03848
C++
#include <bits/stdc++.h> using namespace std; int calc(int x){ if(x==1) return 2; x--; int a=calc(x)%1000000007; a*=2; return a; } int main(){ int n; cin>>n; vector<int> num(n); for(int i=0;i<n;i++){ cin>>num[i]; }sort(num.begin(),num.end()); if(n==1&&num[0]==0){ cout<<1<<endl; return 0;...
a.cc: In function 'int main()': a.cc:44:10: error: 'ans' was not declared in this scope; did you mean 'abs'? 44 | }cout<<ans<<endl; | ^~~ | abs
s862120746
p03848
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; } sort(A.begin(), A.end()); int i; bool flg; if (A[0] == 0) { i = 2; flg = true; } else { i = 1; flg = false; } l...
a.cc: In function 'int main()': a.cc:37:25: error: invalid operands of types '__gnu_cxx::__promote<double>::__type' {aka 'double'} and '__gnu_cxx::__promote<double>::__type' {aka 'double'} to binary 'operator%' 37 | cout << pow(2, cnt) % (pow(10, 9) + 7) << endl; | ~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~...
s709002664
p03848
C++
n=int(input()) a=list(map(int,input().split())) a.sort() cnt=0 ans=1 if n%2==0: for i in range(n//2): if a[2*i]==a[2*i+1]==2*i+1: cnt+=1 ans=(ans*2)%(10**9+7) else: break if cnt==n//2: print(ans) else: print(0) else: if a[0]!=0: print(0) exit() for i in range(n//2): if a[2*i+1]==a[2*i+2]==2*...
a.cc:1:1: error: 'n' does not name a type 1 | n=int(input()) | ^
s962341131
p03848
C++
#include <bits/stdc++.h> using namespace std; #define dlog(str) cout << "====" << str << endl; #define INF 999999999 #define MOD 1000000007 #define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++) #define REP2(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++) #define LLI long long int #define _min(a, b) ((a < ...
a.cc: In function 'int main()': a.cc:60:27: error: too many arguments to function 'long long int modpow(int)' 60 | cout << modpow(2, N / 2); | ~~~~~~^~~~~~~~~~ a.cc:21:5: note: declared here 21 | LLI modpow(int p){ | ^~~~~~