submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s251675112
p04035
C++
#define _USE_MATH_DEFINES #include <cassert> #include <cstdio> #include <cstring> #include <iostream> #include <string> #include <sstream> #include <vector> #include <queue> #include <stack> #include <list> #include <set> #include <map> #include <unordered_set> #include <unordered_map> #include <algorithm> #include <co...
a.cc:21:10: fatal error: ../../new_algorithm/pretty_printer.h: No such file or directory 21 | #include "../../new_algorithm/pretty_printer.h" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s938145189
p04035
C++
import numpy as np n, l = map(int, input().split()) knot = list(map(int, input().split())) flg = 0 li = [] for i in range(0, int(n) - 1): if(knot[i] + knot[i + 1] >= l): flg = 1 print("Possible") li.append(i + 1) for j in range(i + 2, n): li.append(j) for j in ...
a.cc:1:1: error: 'import' does not name a type 1 | import numpy as np | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s644115469
p04035
C
/* Generated by Cython 0.21 */ #define PY_SSIZE_T_CLEAN #ifndef CYTHON_USE_PYLONG_INTERNALS #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 0 #else #include "pyconfig.h" #ifdef PYLONG_BITS_IN_DIGIT #define CYTHON_USE_PYLONG_INTERNALS 1 #else #define CYTHON_USE_PYLONG_INTERNALS 0 #endif #endif #endif #i...
main.c:8:10: fatal error: pyconfig.h: No such file or directory 8 | #include "pyconfig.h" | ^~~~~~~~~~~~ compilation terminated.
s128861958
p04035
C++
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(ll i=0; i<(ll)(n); i++) #define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++) #define pb push_back #define INF 1000000007LL #define all(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int,int> p; int dy[4]={-1,1,0,0}; int dx[4]={0,0,1,-1}; int...
a.cc:46:16: error: extended character   is not valid in an identifier 46 | cout << i+1 << endl; | ^ a.cc: In function 'int main()': a.cc:46:16: error: '\U00003000i' was not declared in this scope 46 | cout << i+1 << endl; | ^~~
s388117284
p04035
C++
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(ll i=0; i<(ll)(n); i++) #define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++) #define pb push_back #define INF 1000000007LL #define all(a) (a).begin(),(a).end() typedef long long ll; typedef pair<int,int> p; int dy[4]={-1,1,0,0}; int dx[4]={0,0,1,-1}; int...
a.cc:46:16: error: extended character   is not valid in an identifier 46 | cout << i+1 << endl; | ^ a.cc: In function 'int main()': a.cc:46:16: error: '\U00003000i' was not declared in this scope 46 | cout << i+1 << endl; | ^~~
s290809145
p04035
C++
#include <cstdio> #include <vector> #include <queue> #include <string> #include <cstring> #include <list> #include <map> #include <set> #include <stack> #include <bitset> #include <climits> #include <utility> #include <cstdlib> #include <algorithm> #include <iostream> #define REP(i,n) for(int (i)=0;i<(int)(n);++(i)) #d...
a.cc: In function 'int main(int, const char**)': a.cc:63:29: error: reference to 'tie' is ambiguous 63 | if(x>0 && x < n && !tie[x]) { | ^~~ In file included from /usr/include/c++/14/bits/memory_resource.h:47, from /usr/include/c++/14/vector:87, ...
s292325575
p04035
C++
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <string> #include <sstream> #include <map> #include <set> #include <vector> #include <cmath> #include <queue> #include <random> using namespace std; #define min(a,b) ((a)<(b) ? (a):(b)) #define max(a,b) ((a)>(...
a.cc: In function 'int main(int, const char**)': a.cc:160:16: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<XX>, XX>::value_type' {aka 'XX'} and 'int') 160 | if(a[i]!=0){ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++...
s014389162
p04035
C++
#include<iostream> using namespace std; int main() { int N ,L; int last=0; cin >> N >> L; int a[N+3]; cin >> a[0]; for(int i=0; i<N-1 ; i++) { cin >> a[i+1]; if(abs(a[i+1]-a[i]) >= L ) { last = i+1; break; } } if(last> 0) { cout << "Possible" << endl; for(int i=1;i<last;i++) { co...
a.cc: In function 'int main()': a.cc:35:39: error: expected primary-expression before '<<' token 35 | cout << "Impossible"; << endl; | ^~
s673242229
p04035
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; int main(void) { string imp = "Impossible"; string pos = "Possible"; int N, L; cin >> N >> L; vector<int> a(N + 1, 0); for(int i = 1; i < N + 1; i++) cin >> a[i]; vector<int> res(N - 1, 0); if(N == 1...
a.cc: In function 'int main()': a.cc:33:17: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>') 33 | cout << imp << end; | ~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr...
s853109314
p04035
C
ho
main.c:1:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 1 | ho | ^~
s103799202
p04035
C
#include <stdio.h> #define OPEN 0 #define CLOSE 1 #define NUM 100000 struct knot{ int state; int from; int to; long long int a; long long int sum; }; int func(); struct knot knot[NUM]; int n; long long int l; int order[NUM]; int main(void){ int i; scanf("%d %lld", &n, &l); for(i = 1; i <= n; i++){ knot[i]...
main.c:88:1: error: expected identifier or '(' before '}' token 88 | } | ^
s762540313
p04035
C++
#include <iostream> #include <stdio.h> #include <numeric> #include <queue> #include <string> #include <cmath> #include <vector> #include <deque> #include <iomanip> #include <set> #include <queue> #include <bitset> #include <iomanip> #include <map> #include <string.h> #include <stack> #include <algorithm> //#include <u...
a.cc:25:17: error: 'int index [100010]' redeclared as different kind of entity 25 | int index[100010]; // 第i个和哪个合并 | ^ In file included from /usr/include/string.h:462, from a.cc:15: /usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, in...
s948709380
p04035
C++
#include <iostream> #include <stdio.h> #include <math.h> #include <vector> #include <algorithm> using namespace std; long long int sum(int l,int r,vector<int> a){ long long int sum=0; for(int i=l;i<=r;i++){ sum += a[i]; } return sum; } int main(){ int n,l; cin >> n >> l; vector<int> a(n); for(int i=0;i<n;i...
a.cc:61:2: error: stray '#' in program 61 | }#include <iostream> | ^ a.cc:61:3: error: 'include' does not name a type 61 | }#include <iostream> | ^~~~~~~ a.cc:68:15: error: redefinition of 'long long int sum(int, int, std::vector<int>)' 68 | long long int sum(int l,int r,vector<int> a){ | ...
s584141684
p04035
C++
#include <iostream> #include <queue> using namespace std; int a[1000000005]; queue<int> q; int main(void) { int N, L; cin.tie(0); ios::sync_with_stdio(false); cin >> N >> L; for (int i = 0; i < N; i++) cin >> a[i]; int l = 0, r = N-1, ans = 0, k = 0; long long int sum = 0; for (int i = 0; i < N - 1; i++) {...
/tmp/ccIe6EWW.o: in function `main': a.cc:(.text+0x15d): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccIe6EWW.o a.cc:(.text+0x1c9): relocation truncated to fit: R_X86_64_PC32 against symbol `q' defined in .bss section in /tmp/ccIe6EWW.o a.cc:(.text+0x242): relocation tr...
s689835357
p04035
C++
#include <iostream> #include <vector> using namespace std; int main(){ long long n, len; cin >> n >> len; vector<long long> a(n + 1); vector<pair<long long, long long> > sum; for(int i = 1; i <= n; i++) { cin >> a[i]; if(i >= 2) { sum.push_back(make_pair(a[i - 1] + a[i], i - ...
a.cc: In function 'int main()': a.cc:36:5: error: 'sort' was not declared in this scope; did you mean 'short'? 36 | sort(sum.begin(), sum.end()); | ^~~~ | short
s888244123
p04035
C++
// AtCoder agc002 #include <bits/stdc++.h> #define ld long double #define ll long long int #define mod 1000000007 #define ll_inf 1000000000000000 #define int_inf 1000000000 #define pb push_back #define endl '\n' #define Endl '\n' #define eps 1e-9 #define PI acos(-1.0) #define ii pair<int,int> #define iii pair<int,ii> ...
a.cc: In function 'int main()': a.cc:68:9: error: 'else' without a previous 'if' 68 | else cout<<ans[i]<<endl; | ^~~~
s101645041
p04035
C++
// AtCoder agc002 #include <bits/stdc++.h> #define ld long double #define ll long long int #define mod 1000000007 #define ll_inf 1000000000000000 #define int_inf 1000000000 #define pb push_back #define endl '\n' #define Endl '\n' #define eps 1e-9 #define PI acos(-1.0) #define ii pair<int,int> #define iii pair<int,ii> ...
a.cc: In function 'int main()': a.cc:68:9: error: 'else' without a previous 'if' 68 | else cout<<ans[i]<<endl; | ^~~~
s987182544
p04035
C++
[yas] Loading for `fundamental-mode', just-in-time: (lambda nil (yas--load-directory-1 (quote /home/zhenyok/.emacs.d/elpa/yasnippet-20150811.1222/snippets/fundamental-mode) (quote fundamental-mode)))! File Edit Options Buffers Tools C++ YASnippet Help ...
a.cc:1:19: error: stray '`' in program 1 | [yas] Loading for `fundamental-mode', just-in-time: (lambda nil (yas--load-directory-1 (quote /home/zhenyok/.emacs.d/elpa/yasnippet-20150811.1222/snippets/fundamental-mode) (quote fundamental-mode)))! | ^ a.cc:1:36: warning: missing terminating ' ch...
s269424401
p04035
C++
#include <bits/stdc++.h> using namespace std; #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl 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 = b; return 1; } return 0; } template...
a.cc: In function 'int main()': a.cc:24:16: error: reference to 'prev' is ambiguous 24 | memset(prev, -1, sizeof(prev)); | ^~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:66, from /usr/include/c++/14/algorithm:60, from /usr/include/x86...
s467227943
p04035
C++
//両端からほどいていくのが最善。左端と右端のひものうち、長さの短いものを取り除くのが最善。O(N) #include <iostream> #include <cassert> #define int long long using namespace std; int n, length; int a[100000]; int ans[100000]; signed main() { int i; int rem = 0; cin >> n >> length; for (i = 0; i < n; i++) { cin >> a[i]; rem += a[i]; } int l = 0, r = n - ...
a.cc: In function 'int main()': a.cc:20:37: error: 'asssert' was not declared in this scope; did you mean 'assert'? 20 | if (rem < length) { asssert(0); cout << "Impossible" << endl; return 0; } | ^~~~~~~ | assert
s625889200
p04035
Java
/** * Created by abhishek on 7/31/2016. */ import java.util.*; import java.io.*; public class A { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int...
Main.java:6: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s338175667
p04035
C++
#include <cstdio> #include <cmath> #include <cstring> #include <iostream> #include <algorithm> #include <queue> #include <vector> #include <map> using namespace std; typedef long long LL; int n; int len,a[100005] LL s[100005]; int l,r; bool flag; int ans[100005]; int main() { scanf("%d%d",&n,&len); f...
a.cc:28:1: error: expected initializer before 'LL' 28 | LL s[100005]; | ^~ a.cc: In function 'int main()': a.cc:37:44: error: 'a' was not declared in this scope 37 | for (int i=1;i<=n;++i) scanf("%d",&a[i]); | ^ a.cc:38:9: error: 's' was not declared ...
s440924369
p04035
C++
#include <stdio.h> #include <algorithm> using namespace std; int x[200200]; int main() { int n,l; scanf("%d %d",&n,&l); for(i=1;i<=n;i++) { scanf("%d",&x[i]); } for(i=1;i<n;i++) { if(x[i]+x[i+1] >= l) break; } if(i == n) { printf("Impossible\n"); } else { printf("Possible\n"); for(j=1;j<i;j...
a.cc: In function 'int main()': a.cc:12:13: error: 'i' was not declared in this scope 12 | for(i=1;i<=n;i++) | ^ a.cc:16:13: error: 'i' was not declared in this scope 16 | for(i=1;i<n;i++) | ^ a.cc:21:12: error: 'i' was not declared in this scope 21 | ...
s769127599
p04035
C++
// VSCF.cpp : Defines the entry point for the console application. // #include <conio.h> #include <iomanip> #include <string> #include <ctime> #include <random> #include <functional> #include <cstdio> #include <iostream> #include <algorithm> #include <iterator> #include <string> #include <vector> #include <set> #includ...
a.cc:3:10: fatal error: conio.h: No such file or directory 3 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s935855797
p04035
C++
5 50 10 20 30 40 50
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 50 | ^
s405853909
p04036
C++
.
a.cc:1:1: error: expected unqualified-id before '.' token 1 | . | ^
s406803865
p04037
C
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,a[100005]; int main() { scanf("%d",&n); for(int i=1;i<=n;++i) scanf("%d",&a[i]); sort(a+1,a+n+1); for(int i=1;i<=n;++i) if((n-i+a[i])%2==0) return (n-i<=a[i])?(!printf("First")):(!printf("Second")); printf("Second"); return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s357291350
p04037
C++
#include <bits/stdc++.h> using namespace std; #define int long long const int maxn = 1e5 + 30; int a[maxn], maxx, Sum; signed main() { int n; n = read(); for (int i = 1; i <= n; i++) { a[i] = read(); maxx = max(maxx, a[i]); Sum += a[i]; } if ((n + Sum - maxx) % 2 == 1){ puts(...
a.cc: In function 'int main()': a.cc:8:13: error: too few arguments to function 'ssize_t read(int, void*, size_t)' 8 | 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+...
s374649619
p04037
C++
http://lahlahhaha.github.io/
a.cc:1:1: error: 'http' does not name a type 1 | http://lahlahhaha.github.io/ | ^~~~
s096712484
p04037
C++
#include <cstdio> #include <algorithm> using namespace std; int n , a[100005]; int main() { scanf("%d" , &n); for(int i = 1 ; i <= n ; ++i) scanf("%d" , a + i); sort(a + 1 , a + 1 + n , greater<int>()); for(int i = 1 ; i <= n ; ++i) if(a[i + 1] < i + 1) { int j = i; while(a[j + 1] == i) ...
a.cc: In function 'int main()': a.cc:8:30: error: 'greater' was not declared in this scope 8 | sort(a + 1 , a + 1 + n , greater<int>()); | ^~~~~~~ a.cc:8:38: error: expected primary-expression before 'int' 8 | sort(a + 1 , a + 1 + n , greater<int>()); | ...
s515475683
p04037
C++
#pragma GCC optimize ("O3") #pragma GCC target (sse, sse1, sse2, tune=native, popcnt) #include <bits/stdc++.h> /* const int MAX_MEM = 25e7; int mpos = 0; char mem[MAX_MEM]; inline void* operator new(size_t n) { char *res = mem + mpos; mpos += n; assert(mpos <= MAX_MEM); return (void *) res; } inline vo...
a.cc:2:21: warning: '#pragma GCC option' is not a string [-Wpragmas] 2 | #pragma GCC target (sse, sse1, sse2, tune=native, popcnt) | ^~~ a.cc:35:34: error: exponent has no digits 35 | const int inf = 1e9 + 47, MAXN = 2e 5 + 47, mod = 1e9 + 7, N = 20; | ...
s742449201
p04037
C++
#include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<ctime> #include<utility> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; int n,a[100010]; int main(){ scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+n...
a.cc: In function 'int main()': a.cc:15:20: error: 'greater' was not declared in this scope 15 | sort(a+1,a+n+1,greater<int>()); | ^~~~~~~ a.cc:15:28: error: expected primary-expression before 'int' 15 | sort(a+1,a+n+1,greater<int>()); | ^~~
s604267230
p04037
C++
inline int read() { int f=1,x=0; char c=getchar(); while (c<'0'||c>'9') { if (c=='-') f=-1; c=getchar(); } while (c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar(); } return x*f; } int a[MAXN]; int main() { int n=read(); for (int i=1;i<=n;i++) a[i]=read(); sort(a+1,a+n+1,greater<int>()); for (int i=0;i<=n;i...
a.cc: In function 'int read()': a.cc:3:29: error: 'getchar' was not declared in this scope 3 | int f=1,x=0; char c=getchar(); | ^~~~~~~ a.cc:1:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio...
s569021757
p04037
C++
#include <iostream> #include <vector> #include <queue> #include <math.h> #include <set> #include <random> #define FOR(i, n, m) for(ll i = n; i < (int)m; i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define pb push_back using namespace std; using ll = std::int_fast64_t; using P = pair<ll, ll>; c...
a.cc: In function 'int main()': a.cc:159:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 159 | sort(ALL(a)); | ^~~~ | sqrt
s236370027
p04037
C++
#include <iostream> #include <vector> #include <queue> #include <math.h> #include <set> #include <random> #define FOR(i, n, m) for(ll i = n; i < (int)m; i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define pb push_back using namespace std; using ll = std::int_fast64_t; using P = pair<ll, ll>; c...
a.cc: In function 'int main()': a.cc:159:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 159 | sort(ALL(a)); | ^~~~ | sqrt
s818434734
p04037
C++
#include <bits/stdc++.h> using namespace std; const int MOD=1e9+7; //const int MOD=998244353; const long long LINF=1e18; #define int long long //template template <typename T> void fin(T a){ cout<<a<<endl; exit(0); } /* 全体一個ずつだと小さい方から消えて行く 大きいの一山だと大きい方から消えて行く 残り一つにして相手に渡したら勝ち i番目が最後の時かかるターンは? v[i]+N-iターンで全部が消える v[i...
a.cc: In function 'int main()': a.cc:108:31: error: expected primary-expression before 'break' 108 | if(((k&1)+Fwin(k))==0)o++,break; | ^~~~~ a.cc:112:32: error: expected primary-expression before 'break' 112 | if(((k&1)+Fwin2(k))==0)o++,break; | ...
s726033492
p04037
C++
#include <bits/stdc++.h> using namespace std; const int MOD=1e9+7; //const int MOD=998244353; const long long LINF=1e18; #define int long long //template template <typename T> void fin(T a){ cout<<a<<endl; exit(0); } /* 全体一個ずつだと小さい方から消えて行く 大きいの一山だと大きい方から消えて行く 残り一つにして相手に渡したら勝ち i番目が最後の時かかるターンは? v[i]+N-iターンで全部が消える v[i...
a.cc: In function 'int main()': a.cc:110:21: error: no matching function for call to 'min(double, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)' 110 | for(int k=0;k<=min(3e7,v[0]);k++){ | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm...
s802623777
p04037
C++
#include <bits/stdc++.h> using namespace std; const int MOD=1e9+7; //const int MOD=998244353; const long long LINF=1e18; #define int long long //template template <typename T> void fin(T a){ cout<<a<<endl; exit(0); } /* 全体一個ずつだと小さい方から消えて行く 大きいの一山だと大きい方から消えて行く 残り一つにして相手に渡したら勝ち i番目が最後の時かかるターンは? v[i]+N-iターンで全部が消える v[i...
a.cc: In function 'int main()': a.cc:111:23: error: expected primary-expression before '==' token 111 | if((k&1)+Fwin2(k))==2)fin("First"); | ^~
s742369518
p04037
C++
#include <bits/stdc++.h> using namespace std; const int mxN=1e5; int n, a[mxN]; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i=0; i<n; ++i) cin >> a[i]; sort(a, a+n, greater<int>()); int i=0; for(; i<n&&i<a[i]; ++i); cout << (a[i-1]-i+1&1&&find(a, a+n, i-1, greater<int>())-a-i+1&1?"S...
a.cc: In function 'int main()': a.cc:17:36: error: no matching function for call to 'find(int [100000], int*, int, std::greater<int>)' 17 | cout << (a[i-1]-i+1&1&&find(a, a+n, i-1, greater<int>())-a-i+1&1?"Second":"First"); | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file incl...
s800803451
p04037
C++
#include<bits/stdc++.h> using namespace std; const int N=1e5+7; int n,ans,a[N]; int main(){ scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); sort(a+1,a+n+1,cmp); for(int i=1;i<=n;i++) if(i+1>a[i+1]){ for(int j=i+1;a[j]==i;j++) ans^=1; ans|=(a[i]-i)&1; if(ans) puts("First"); el...
a.cc: In function 'int main()': a.cc:6:20: error: 'cmp' was not declared in this scope; did you mean 'bcmp'? 6 | sort(a+1,a+n+1,cmp); | ^~~ | bcmp
s209969097
p04037
C++
#include <bits/stdc++.h> using namespace std; int n, ans, ans2= 1000000900; int main() { cin >> n; for (int i = 0; i < n; i++) { int a; cin >> a; ans = max(a, ans); ans2 = min(a, ans2); } if((ans + n - ans2) % 2 == ) return cout << "First",0; cout << "Second"; }
a.cc: In function 'int main()': a.cc:13:36: error: expected primary-expression before ')' token 13 | if((ans + n - ans2) % 2 == ) | ^
s082723506
p04037
C++
using namespace std; void read(int &x) { x=0;int f=1;char ch=getchar(); for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f; for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f; } void print(int x) { if(x<0) putchar('-'),x=-x; if(!x) return ;print(x/10),putchar(x%10+48); } void write(int x) {if(!x) p...
a.cc: In function 'void read(int&)': a.cc:5:25: error: 'getchar' was not declared in this scope 5 | x=0;int f=1;char ch=getchar(); | ^~~~~~~ a.cc:1:1: note: 'getchar' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> ...
s826612111
p04037
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; using pint = pair<int,int>; #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) { return s << '<' << P.first << ", " << P.second << '>...
a.cc: In function 'bool solve(std::vector<int>&)': a.cc:34:53: error: expected ']' before ')' token 34 | else return isodd(ps[i]) || isodd(ps[i+1); | ^ | ]
s709425696
p04037
C
//Zory-2019 #include<cmath> #include<ctime> #include<cstdio> #include<cstring> #include<cstdlib> #include<map> #include<set> #include<queue> #include<deque> #include<stack> #include<bitset> #include<vector> #include<algorithm> #include<iostream> #include<deque> // #include<unordered_map> using namespace std; int bin[40...
main.c:2:9: fatal error: cmath: No such file or directory 2 | #include<cmath> | ^~~~~~~ compilation terminated.
s313457624
p04037
C++
#include <bits/stdc++.h> using namespace std; using lint = long long int; using pint = pair<int, int>; using plint = pair<lint, lint>; struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i...
a.cc: In function 'int main()': a.cc:65:38: error: 'i' was not declared in this scope 65 | y -= (y - max<int>(A[i + 1] + 10, 2E5)) / 2 * 2; | ^
s968455954
p04037
C++
#include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int n,ans,a[100100]; 6 int main(){ 7 scanf("%d",&n); 8 for(int i=1;i<=n;i++) scanf("%d",&a[i]); 9 sort(a+1,a+n+1); 10 reverse(a+1,a+n+1); 11 for(int i=1;i<=n;i++){ 12 if(i+1>a[i+1]){ 13 ...
a.cc:2:4: error: stray '#' in program 2 | 2 #include<cstring> | ^ a.cc:3:4: error: stray '#' in program 3 | 3 #include<algorithm> | ^ a.cc:2:2: error: expected unqualified-id before numeric constant 2 | 2 #include<cstring> | ^ a.cc:5:2: error: expected unqualified-id before numer...
s069910591
p04037
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<string> vst; typedef vector<bool> vb; typedef vector<ld> vld; typedef vector<pii> vpii; typedef vecto...
a.cc: In function 'int main()': a.cc:99:21: error: no matching function for call to 'min(ll&, int&)' 99 | while (B[min(++pivot,N)] > bef+1) dis2++; | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/s...
s008196793
p04037
C++
#include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<cstdio> #include<climits> using namespace std; void File(){ freopen("AGC02E.in","r",stdin); freopen("AGC02E.out","w",stdout); } template<typename T>bool chkmax(T &_,T __){return _<__ ? (_=__,1) : 0;} template<typename T>bool chkmin(T &_...
a.cc: In function 'int main()': a.cc:39:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 39 | REP(i,1,n)scanf("%d",&a[i]); | ^ a.cc:14:37: note: in definition of macro 'REP' 14 | #define REP(i,a,b) for(register int i=a;i<=b;++i) | ...
s992214429
p04037
C++
#include<iostream> #include<algorithm> #include<cstring> #include<cmath> #include<cstdio> #include<climits> using namespace std; void File(){ freopen("AGC02E.in","r",stdin); freopen("AGC02E.out","w",stdout); } template<typename T>bool chkmax(T &_,T __){return _<__ ? (_=__,1) : 0;} template<typename T>bool chkmin(T &_...
a.cc: In function 'int main()': a.cc:40:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 40 | REP(i,1,n)scanf("%d",&a[i]); | ^ a.cc:14:37: note: in definition of macro 'REP' 14 | #define REP(i,a,b) for(register int i=a;i<=b;++i) | ...
s451208556
p04037
C++
#include <iostream> #include <algorithm> using namespace std; long long n, a[(1<<20)]; pair < long long, long long > proj ( long long y, long long x ) { long long c = min( x, y ); return make_pair( y-c, x-c ); } void printS( long long c ) { if ( c%2 ) { cout << "First\n"; } else { cout << "Second\n";...
a.cc: In function 'int main()': a.cc:75:27: error: redeclaration of 'std::pair<int, int> tx' 75 | pair < int, int > tx = proj( tx.first, tx.second ); | ^~ a.cc:59:27: note: 'std::pair<int, int> tx' previously declared here 59 | pair < int, int > tx, rx; | ...
s831678616
p04037
C++
#include<cstdio> #include<cstring> #include<algorithm> #include<cstdlib> #include<ctime> #include<utility> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; int a[100010]; int main() { #ifdef DEBUG freopen("b.in","r",stdin); freopen("b.out","w",stdout); #endif int ...
a.cc: In function 'int main()': a.cc:23:24: error: 'greater' was not declared in this scope 23 | sort(a+1,a+n+1,greater<int>()); | ^~~~~~~ a.cc:23:32: error: expected primary-expression before 'int' 23 | sort(a+1,a+n+1,greater<int>()); | ...
s952553441
p04037
C++
#include <cstdio> #include <functional> const int N = 100000; int n, a[N]; bool win(int x, int y) { while (x + 1 < n && y + 1 < a[x + 1]) { x ++, y ++; } int up = a[x] - y & 1; int rt = true; while (x + 1 < n && y < a[x + 1]) { x ++, rt ^= 1; } return !(up && rt); } int m...
a.cc: In function 'int main()': a.cc:27:10: error: 'sort' is not a member of 'std' 27 | std::sort(a, a + n, std::greater<int>()); | ^~~~
s365611748
p04037
C++
#include <cstdio> #include <iostream> using namespace std; const int N = 1e5 + 5; int a[N], n; int main() { scanf("%d", &n); for (int i = 1; i <= n; i ++) scanf("%d", &a[i]); sort(a + 1, a + n + 1, greater <int> ()); int i, j; for (i = 1; i < n && a[i + 1] >= i + 1; i ++); if ((a[i] - i) & 1) return !put...
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(a + 1, a + n + 1, greater <int> ()); | ^~~~ | short
s792615659
p04037
C++
#include<bits/stdc++.h> using namespace std; inline char nchar() { static const int bufl=1<<20; static char buf[bufl],*a,*b; return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++; } inline int read() { int x=0,f=1; char c=nchar(); for (;!isdigit(c);c=nchar()) if (c=='-') f=-1; for (;isdigit(c);c=nchar...
a.cc: In function 'int main()': a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)' 24 | generate(a+1,a+(n=read())+1,read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s847784235
p04037
C++
#include<bits/stdc++.h> using namespace std; inline char nchar() { static const int bufl=1<<20; static char buf[bufl],*a,*b; return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++; } inline int read() { int x=0,f=1; char c=nchar(); for (;!isdigit(c);c=nchar()) if (c=='-') f=-1; for (;isdigit(c);c=nchar...
a.cc: In function 'int main()': a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)' 24 | generate(a+1,a+(n=read())+1,read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s366443291
p04037
C++
#include<bits/stdc++.h> using namespace std; inline char nchar() { static const int bufl=1<<20; static char buf[bufl],*a,*b; return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++; } inline int read() { int x=0,f=1; char c=nchar(); for (;!isdigit(c);c=nchar()) if (c=='-') f=-1; for (;isdigit(c);c=nchar...
a.cc: In function 'int main()': a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)' 24 | generate(a+1,a+(n=read())+1,read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s406321124
p04037
C++
#include<bits/stdc++.h> using namespace std; inline char nchar() { static const int bufl=1<<20; static char buf[bufl],*a,*b; return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++; } inline int read() { int x=0,f=1; char c=nchar(); for (;!isdigit(c);c=nchar()) if (c=='-') f=-1; for (;isdigit(c);c=nchar...
a.cc: In function 'int main()': a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)' 24 | generate(a+1,a+(n=read())+1,read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s836967014
p04037
C++
#include<bits/stdc++.h> using namespace std; inline char nchar() { static const int bufl=1<<20; static char buf[bufl],*a,*b; return a==b && (b=(a=buf)+fread(buf,1,bufl,stdin),a==b)?EOF:*a++; } inline int read() { int x=0,f=1; char c=nchar(); for (;!isdigit(c);c=nchar()) if (c=='-') f=-1; for (;isdigit(c);c=nchar...
a.cc: In function 'int main()': a.cc:24:17: error: no matching function for call to 'generate(int*, int*, <unresolved overloaded function type>)' 24 | generate(a+1,a+(n=read())+1,read); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:61, ...
s401371807
p04037
C++
#include <iostream> #include <cmath> #include <algorithm> using namespace std; int a[100005]; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { cin >> a[i]; } sort (a + 1, a + 1 + n); int ans = 0; bool b = 0; for (int i = n; i >= 1; i--) { if (a[i] == (n - i + 1) { ans = i; break; } if ...
a.cc: In function 'int main()': a.cc:16:40: error: expected ')' before '{' token 16 | if (a[i] == (n - i + 1) { | ~ ^~ | ) a.cc:24:9: error: expected primary-expression before '}' token 24 | } | ...
s023788724
p04037
C++
inline bool find(int x,int y) { if(a[x]<=y || a[x-1]<y) return 0; else if(!find(x-1,y) && !find(x,y+1)) return 1; return 0; } int main() { n=read(); for(int i=1;i<=n;i++) a[i]=read(); sort(a+1,a+n+1); int medge=1; while(a[n-medge+1]>medge+1) medge++; if(medge>1) medge--; printf("%s\n",find(n-medge...
a.cc: In function 'bool find(int, int)': a.cc:3:12: error: 'a' was not declared in this scope 3 | if(a[x]<=y || a[x-1]<y) | ^ a.cc: In function 'int main()': a.cc:12:9: error: 'n' was not declared in this scope 12 | n=read(); | ^ a.cc:12:11: error: 'read' was not de...
s374073819
p04037
C++
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <cassert> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <functional> #include <iostream> #include <map> #include <set> #include <cassert> #include <bits/stdc++.h> usin...
a.cc: In function 'int main()': a.cc:66:39: error: expected ';' before '}' token 66 | puts(w[x]==0?"Second":"First") | ^ | ; 67 | } | ~
s236452184
p04037
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <numeric> #include <cstring> #include <ctime> #include <cstdlib> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <list> #include <cmath> #include <bitset> #include <cassert> #...
a.cc: In function 'bool border(int, int)': a.cc:41:21: error: no matching function for call to 'size()' 41 | if (X > size()) return true; | ~~~~^~ In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, fr...
s172866084
p04037
C++
#include <bits/stdc++.h> #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,a,b) for(int i=(a);i>=(b);i--) #define forE(i,x) for(int i=head[x];i!=-1;i=ne[i]) using namespace std; typedef long long i64; typedef unsigned long long u64; typedef unsigned u32; typedef pair<int,int> pin; #define mk(a,b) make_pair(a,b...
a.cc: In function 'int main()': a.cc:38:32: error: expected primary-expression before ')' token 38 | sort(a,a+n,greater<int>); | ^
s731952456
p04037
C++
include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <cassert> #include <vector> using namespace std; #define TRACE(x) cerr << #x << " = " << x << endl typedef long long ll; typedef pair<int, int> P; #define X first #define Y second const int MAX = 1<<17; int p[MAX]; int jelnul[...
a.cc:1:1: error: 'include' does not name a type 1 | include <cstdio> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gn...
s229772834
p04037
C++
#include <iostream> using namespace std; const int N = 100005; int a[N], b[N]; int main() { int n; scanf("%d", &n); for (int i = 0; i < n; i++) scanf("%d", &a[i]); sort(a, a+n); reverse(a, a+n); for (int i = 0; i < n; i++) b[min(a[i], n)-1]++; for (int i = n-1; i >= 0; i--) b[i] += b[i+1]; int m = 0; ...
a.cc: In function 'int main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a, a+n); reverse(a, a+n); | ^~~~ | short a.cc:11:17: error: 'reverse' was not declared in this scope 11 | sort(a, a+n); reverse(a, a+n); | ^~~~~~~
s588615117
p04037
C++
w#include <algorithm> #include <cassert> #include <cstring> #include <iostream> using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define REP(i, n) FOR(i, 0, n) #define TRACE(x) cout << #x << " = " << x << endl #define _ << " _ " << typedef long long llint; const int MAX = 100100; int a[MAX...
a.cc:1:2: error: stray '#' in program 1 | w#include <algorithm> | ^ a.cc:1:1: error: 'w' does not name a type 1 | w#include <algorithm> | ^ In file included from /usr/include/c++/14/iosfwd:42, from /usr/include/c++/14/ios:40, from /usr/include/c++/14/ostream:40, ...
s513404886
p04037
Java
import java.io.*; import java.util.*; public class E { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; void solve() throws IOException { int n = nextInt(); int[] a = new int[n]; Random rng = new Random(); for (int i = 0; i < n; i++) { int j = rng.nextInt(i + 1); a[j] = a[i]; ...
Main.java:4: error: class E is public, should be declared in a file named E.java public class E { ^ 1 error
s860349000
p04037
C++
#include<stdio.h> #include<algorithm> #include<vector> #include<functional> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) int (A); scanf("%d",&(A)); #define DBG if(1) #define NDBG if(0) typedef long long ll; typedef pair<int,int> pii; const int MN = 100000 + 1; int N; int A[MN]; int end[M...
a.cc: In function 'int val(int, int)': a.cc:24:16: error: reference to 'end' is ambiguous 24 | return end[x]^((A[x]-1-y)&1); | ^~~ In file included from /usr/include/c++/14/vector:69, from a.cc:3: /usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'tem...
s115480600
p04037
C++
#include<stdio.h> #include<algorithm> #include<vector> #include<functional> using namespace std; #define all(A) (A).begin(), (A).end() #define II(A) int (A); scanf("%d",&(A)); #define DBG if(1) #define NDBG if(0) typedef long long ll; typedef pair<int,int> pii; const int MN = 100000 + 1; int N; int A[MN]; int end[M...
a.cc: In function 'int val(int, int)': a.cc:24:16: error: reference to 'end' is ambiguous 24 | return end[x]^((A[x]-1-y)&1); | ^~~ In file included from /usr/include/c++/14/vector:69, from a.cc:3: /usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'tem...
s211497124
p04037
C++
#include <cstdint> #include <iostream> #include <algorithm> typedef int64_t i64; static const auto NMAX = 100001; static int N; static int L; static int A[NMAX]; int main() { std::ios_base::sync_with_stdio(false); std::cin >> N; for(auto i = 1; i <= N; i++) std::cin >> A[i]; std::sort(A + 1, A + N + ...
a.cc: In function 'int main()': a.cc:25:62: error: expected ';' before '{' token 25 | if(lt == A[i] && ( v % 2 == 1 || v2 % 2 == 1) { | ^~ | ; a.cc:29:22: error: expec...
s290904165
p04037
C++
#include <bits/stdc++.h> using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x<(to);x++) #define FORR(x,arr) for(auto& x:arr) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define ALL(a) (a.begin()),(a.end()) #define ZER...
a.cc: In function 'void solve()': a.cc:26:47: error: expected ')' before '{' token 26 | FOR(i,N) if((A[i]<=i+1 || A[i+1]<=i+1) { | ~ ^~ | ) a.cc:34:1: error: expected primary-expression before '}' token 3...
s517354599
p04038
C++
#include<bits/stdc++.h> using namespace std; #define mod 1000000007 long long f[2005][2005],ny[4000005],s[4000005],t[4000005]; long long f(long long n,long long m) { return s[n]*t[m]%mod*t[n-m]%mod; } int main() { long long n,k,i,j; cin>>n>>k; if(k==1) { puts("1"); return 0; } ny[1]=1; for(i=2;i<=4000000;i+...
a.cc:5:36: error: 'long long int f(long long int, long long int)' redeclared as different kind of entity 5 | long long f(long long n,long long m) | ^ a.cc:4:11: note: previous declaration 'long long int f [2005][2005]' 4 | long long f[2005][2005],ny[4000005],s[4000005],t...
s808613562
p04038
C
#include<cstdio> #define C(x,y) (fct[x]*ifct[y]%TT*ifct[(x)-(y)]%TT) using namespace std; const int maxn=2005,TT=1e9+7; int n,K,m,F[maxn][maxn]; long long fct[maxn*maxn],ifct[maxn*maxn]; inline int read(){ int ret=0;bool f=0;char ch=getchar(); while(ch>'9'||ch<'0') f^=ch=='-',ch=getchar(); while(ch<='9'&&ch>='0') re...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s666498792
p04038
C++
/* 设f[i][j]表示当前有i个白球,一共放完了j种球 显然有j <= i * 放白球 从f[i-1][j]转移 * 放没有出现过的球 (n - j + 1) * f[i][j - 1] * C(k - 2, n * k - i - (j - 1) * (k - 1) - 1) */ #include <bits/stdc++.h> using namespace std; typedef long long int; const int N = 2020; const int mod = 1e9 + 7; int inv[N * N], fac[N * N]; int f[N][N]; int n, k; int po...
a.cc:10:19: error: declaration does not declare anything [-fpermissive] 10 | typedef long long int; | ^~~
s540061707
p04038
C
#include <iostream> using namespace std; #define LL long long const int maxN = 2e3 + 2; const int MOD = 1e9 + 7; int N, K; int F[maxN][maxN], fac[maxN * maxN]; LL qpow(LL a, LL b) { LL ans = 1; while (b) { if (b & 1) { ans = ans * a % MOD; } a = a * a % MOD; b >>...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s775721675
p04038
C
#include <iostream> using namespace std; #define LL long long const int maxN = 2e3 + 2; const int MOD = 1e9 + 7; int N, K; int F[maxN][maxN], fac[maxN * maxN]; LL qpow(LL a, LL b) { LL ans = 1; while (b) { if (b & 1) { ans = ans * a % MOD; } a = a * a % MOD; b >>...
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s784507477
p04038
C++
#include<cstdio> #include<iostream> #include<algorithm> #include<cstring> #include<map> #include<cmath> using namespace std; #define int long long void read(int &x) { char ch; bool ok; for(ok=0,ch=getchar(); !isdigit(ch); ch=getchar()) if(ch=='-') ok=1; for(x=0; isdigit(ch); x=x*10+ch-'0',ch=getchar()); if(ok) x=-x;...
a.cc: In function 'int main()': a.cc:19:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 19 | for(rg int i=1;i<=n;i++)read(a[i]),w[++tot]=a[i]; | ^ a.cc:21:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 21...
s368092657
p04038
C++
#include <iostream> #include <algorithm> using namespace std; const long long MOD = (long long)(1e9 + 7); const int kK = (int)(2049 * 2049); long long fac[kK + 5], inv[kK + 5]; long long qpow(long long base,int power) { long long ret = 1; for(; power; power >>= 1) { if(power & 1) ret = ret * base % MOD; base ...
a.cc: In function 'int main()': a.cc:50:35: error: expected primary-expression before '=' token 50 | f[i][j] % =MOD; | ^
s531880453
p04038
C++
//Relive your past life. //Face your demons. //The past is never dead,it is not even past. //The memories are not only the key to the past but...also to the future. //coded in Rusty Lake #include<cmath> #include<math.h> #include<ctype.h> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<c...
a.cc:66:9: error: expected unqualified-id before ';' token 66 | int n,k,; | ^
s719949082
p04038
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int mod=1e9+7; inline int add(int a,int b){a+=b;return a>=mod?a-mod:a;} inline int sub(int a,int b){a-=b;return a<0?a+mod:a;} inline int mul(int a,int b){return (ll)a*b%mod;} inline int qpow(int a,int b){int ret=1;for(;b;b>>=1,a=mul(a,a))if(b&1)re...
a.cc: In function 'int main()': a.cc:32:9: error: 'f' was not declared in this scope 32 | f[0][0]=1; | ^
s229410325
p04038
C++
#include<bits/stdc++.h> using namespace std; const int N=2005,mod=1000000007; int n,k,dp[N][N],fac[N*N],ifac[N*N]; int pw(int a,int b){int r=1;for(;b;b>>=1,a=1ll*a*a%mod)if(b&1)r=1ll*r*a%mod;return r;} int C(int a,int b){return a<0||b<0||a<b?0:1ll*fac[a]*ifac[b]%mod*ifac[a-b]%mod;} int main() { for(int i=fac[0]=1;i<N*...
a.cc: In function 'int main()': a.cc:18:86: error: expected ')' before ';' token 18 | if(j)dp[i][j]=(dp[i][j]+1ll*dp[i][j-1]*C(n*k-i-(j-1)*(k-1)-1,k-2)%mod; | ~ ^ | ...
s339731728
p04038
C++
// Leftmost Ball // * frank_c1 // * 2017 / 09 / 29 #include <bits/stdc++.h> using namespace std; typedef long long LL; LL pow_mod(LL b, LL p, LL k) { LL ret = 1; for (; p; p >>= 1) { if (p & 1) ret = ret * b % k; b = b * b % k; } return ret; } const int maxn = 3005; const int mo = (int)(1e9) + 7; LL fac[maxn ...
a.cc: In function 'int main()': a.cc:46:41: error: 'ret' was not declared in this scope 46 | } return printf("%lld\n", 1LL * ret * fac[n] % mo), 0; | ^~~
s237596190
p04038
C++
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) using...
a.cc: In function 'int main()': a.cc:35:12: error: 'N' was not declared in this scope 35 | if(N==2&&K==2){ | ^ a.cc:35:18: error: 'K' was not declared in this scope 35 | if(N==2&&K==2){ | ^
s742290876
p04038
Java
import java.io.*; import java.util.*; public class F { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; static final int P = 1_000_000_007; void solve() throws IOException { int n = nextInt(); int k = nextInt(); if (k == 1) { out.println(1); return; } ModuloCombinatorics ...
Main.java:4: error: class F is public, should be declared in a file named F.java public class F { ^ 1 error
s549789512
p04038
C++
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <ctime> #include <cassert> #include <algorithm> #include <vector> #include <set> #include <map> #include <bitset> #include <unordered_map> #include <unordered_set> #include <tuple> #include <queue> using namespace std; #define pb push_...
a.cc: In function 'int solve()': a.cc:62:5: error: 'memset' was not declared in this scope 62 | memset(f, 0, sizeof(f)); | ^~~~~~ a.cc:16:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 15 | #include <queue> +++ |+#include <cstring> 16...
s712076902
p04039
C++
//BISMILLAHIR RAHMANIR RAHIM //BY THE NAME OF ALLAH //FAISAL AHAMMED SHAWON #include<bits\stdc++.h> #include<iostream> #include<algorithm> #include<cmath> #include<string> #include...
a.cc:4:9: fatal error: bits\stdc++.h: No such file or directory 4 | #include<bits\stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s544854978
p04039
C
#include<bits/stdc++.h> using namespace std; int digit(long long n) { int f1,d1; d1=((int)(log10(n))); f1=(int) (n/(int)(pow(10,d1))); return f1; } int main() { long long n,i,j,k=0,p; cin>>n; int a[10][10]={0}; for(i=1;i<=n;i++) { if(i%10==0)continue; else ...
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory 1 | #include<bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s067648202
p04039
C++
#include <stdio.h> #include <math.h> #define MAX_N 10000 #define MAX_K 9 int N, k; int D[MAX_k]; int check(int a){ int i, j, n, m; n=a; while(n!=0){ m = n%10; for (j=0; j<k; j++) if (m==D[j]) return 1; n/=10; } return 0; } int main(){ int i; scanf("%d%d", &N, &k);...
a.cc:6:7: error: 'MAX_k' was not declared in this scope; did you mean 'MAX_K'? 6 | int D[MAX_k]; | ^~~~~ | MAX_K a.cc: In function 'int check(int)': a.cc:13:20: error: 'D' was not declared in this scope 13 | if (m==D[j]) return 1; | ^ a.cc: In function...
s575658742
p04039
C++
#include <iostream> #include <vector> #include <string> using namespace std; typedef long long ll; #define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0); int main() { fastInp; ll k; string n; cin >> n >> k; vector<ll> bd(k); vector<bool> hate(10); ll lst = -1; for (i...
a.cc: In function 'int main()': a.cc:45:34: error: 'j' was not declared in this scope 45 | if (hate[j]) continue; | ^
s997028110
p04039
C++
#include<bits/stdc++.h> using namespace std; typedef double db; typedef long long ll; //typedef pair<int, int> pii; //#define fi first //#define se second #define lbd(a, x) lower_bound(all(a), x) const int mod = 1e9 + 7; const int M = 10100; const int N = 2100; struct pii { int fi, se; pii(int x=0, int y=0):fi(x),se(...
a.cc:20:11: error: size of array 'q' is not an integral constant-expression 20 | pii q[2][S+N]; | ~^~
s044310642
p04039
Java
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); Set<Integer> set = new HashSet<Integer>(); for(int i=0;i<k;i++){ set.add(sc.nextInt()); } while(true){ boolean has = contain(n, set);...
Main.java:2: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s913358461
p04039
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; #define Abs(x)((x) < 0 ? (x) * -1 : (x)) #define rep(x, y) for ((x) = 0; (x) < (y); (x)++) #define repin(x, y) for ((x) = 0; (x) <= (y); (x)++) #define nep(x, y) for ((x) = (y) - 1; 0 <= (x); (x)--) #define nepi(x, y...
a.cc: In function 'int main()': a.cc:226:60: error: no matching function for call to 'Str(char)' 226 | s = s + Str((char)(i + '0', len)); | ~~~^~~~~~~~~~~~~~~~~~~~~~ a.cc:116:15: note: candidate: 'std::string...
s670133728
p04039
C++
#include"bits/stdc++.h" #include<boost/multi_array.hpp> #include<boost/optional.hpp> #include<boost/range/irange.hpp> #include<boost/range/algorithm.hpp> #include<boost/range/adaptors.hpp> using namespace std; namespace adaptor = boost::adaptors; #define rep(i,n) for(int (i)=0;(i)<(n);(i)++) #define rep3(i,m,n) for(i...
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory 2 | #include<boost/multi_array.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s582182070
p04039
C++
#include <bits/stdc++.h> using namespace std; bool t[10]; bool dfs(int n) { while(n>0) { if(t[n%10]) return false; n/=10; } return true; } int main() { int n,k,a; cin>>n>>k; for(int i=0;i<k;i++) { cin>>a; t[a]=true; } while(!dfsn)) n++; cout<<n; return 0; }
a.cc: In function 'int main()': a.cc:24:16: error: 'dfsn' was not declared in this scope; did you mean 'dfs'? 24 | while(!dfsn)) | ^~~~ | dfs a.cc:24:21: error: expected primary-expression before ')' token 24 | while(!dfsn)) | ^
s714547971
p04039
C++
MAX_N = 10005 n, _ = input().split(' ') n = int(n) dislikes = set(map(int, input().split(' '))) for num in range(n, MAX_N): num_set = set(str(num)) if len(dislikes & num_set) > 0: continue print(num) break
a.cc:1:1: error: 'MAX_N' does not name a type 1 | MAX_N = 10005 | ^~~~~
s217722590
p04039
C++
#include <bits/stdc++.h> #define l_b lower_bound #define u_b upper_bound using namespace std; typedef long long ll; int n, k; set<int> s; int main() { for (int i = 0; i < 10; i++) s.insert(i); cin >> n >> k; { int d; for (int i = 0; i < k; i++) cin >> d, s.erase(d); } string t = to_string(n), ...
a.cc: In function 'int main()': a.cc:33:17: error: expected ',' or ';' before 'for' 33 | for (int i = 0; i < t.size(); i++) | ^~~ a.cc:33:33: error: 'i' was not declared in this scope 33 | for (int i = 0; i < t.size(); i++) | ...
s460227450
p04039
C++
#include <bits/stdc++.h> #define l_b lower_bound #define u_b upper_bound using namespace std; typedef long long ll; int n, k; set<int> s; int main() { for (int i = 0; i < 10; i++) s.insert(i); cin >> n >> k; { int d; for (int i = 0; i < k; i++) cin >> d, s.erase(d); } string t = to_string(n), ...
a.cc: In function 'int main()': a.cc:48:30: error: expected ';' before 'for' 48 | z = s.begin() | ^ | ; 49 | for (int j = i + 1; j < t.size(); j++) | ~~~ a.cc:49:37: error: 'j' wa...
s014189155
p04039
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; int a[k]; bool like[10]; for(int i=0;i<10;i++){ like[i]=true; } for(int i=0;i<k;i++){ cin>>a[i]; like[a[i]]=false; } bool flag=false; for(int i=1;i<=n*10;i*=10){ if(flag==true){ i/=10; flag=false; } if(like[n/i%10]...
a.cc:35:3: error: stray '#' in program 35 | } #include<bits/stdc++.h> | ^ a.cc:69:3: error: stray '#' in program 69 | } #include<bits/stdc++.h> | ^ a.cc:103:3: error: stray '#' in program 103 | } #include<bits/stdc++.h> | ^ a.cc:35:4: error: 'include' does not name a type 35 | } #incl...
s039274970
p04039
C++
#include <bits/stdc++.h> using namespace std; int main() { int N, K; cin >> N >> K; vector<int> d(10); for (int i = 0; i < K; ++i) { int num; cin >> num; ++d[num]; } vector<int> use; for (int i = 0; i < 10; ++i) { if (d[i] == 0) { use.push_back(i); } } vector<int> ans(pow(8,...
a.cc: In function 'int main()': a.cc:21:3: error: expected ',' or ';' before 'for' 21 | for (int i = 0; i < use.size(); ++i) { | ^~~ a.cc:21:19: error: 'i' was not declared in this scope 21 | for (int i = 0; i < use.size(); ++i) { | ^
s018775563
p04039
Java
import java.util.*; public class A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); String no = ""; for( int i = 0; i < k; i++ ) { no += in.nextInt(); } String testString = "^[^"+no+"]+$"; while(!Integer.toString(n).matches(...
Main.java:3: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error