submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s651179176
p04046
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using ull = uint64_t; using uint = uint32_t; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template<class T> using pq = priorit...
a.cc:185:25: error: 'constexpr Modint operator""_M(ull)' has invalid argument list 185 | inline constexpr Modint operator""_M(ull x) noexcept { return Modint(x); } | ^~~~~~~~
s230458927
p04046
C++
#include <bits/stdc++.h> using namespace std; using ll = int64_t; using ld = long double; using ull = uint64_t; using uint = uint32_t; using pcc = pair<char, char>; using pii = pair<int, int>; using pll = pair<ll, ll>; using pdd = pair<double, double>; using tuplis = array<ll, 3>; template<class T> using pq = priority_...
a.cc:185:25: error: 'constexpr Modint operator""_M(ull)' has invalid argument list 185 | inline constexpr Modint operator""_M(ull x) noexcept { return Modint(x); } | ^~~~~~~~
s087850185
p04046
C++
#include<bits/stdc++.h> using namespace std; #define mod 1e9+7 int main() { int h,w,a,b; cin>>h>>w>>a>>b; int dp[h][w]; memset(dp,-1,sizeof(dp)); for (int i=h-a;i<h;i++) { for (int j=0;j<b;j++) { dp[i][j]=0; } } for (int i=0;i<h;i++) { if (dp[i][0]==-1) { dp[i][0]=1; ...
a.cc: In function 'int main()': a.cc:35:30: error: invalid operands of types 'int' and 'double' to binary 'operator%' 35 | dp[i][j]=((dp[i-1][j]%mod)+(dp[i][j-1]%mod))%mod; | ~~~~~~~~~~^ | | | int a.cc:35:47: error: ...
s863362045
p04046
C++
#include<bits/stdc++.h> using namespace std; int main() { int h,w,a,b; int dp[h][w]; memset(dp,-1,sizeof(dp)); for (int i=h-a;i<h;i++) { for (int j=0;j<b;j++) { dp[i][j]=0; } } for (int i=0;i<h;i++) { if (dp[i][0]==-1) { dp[i][0]=1; } } for (int i=0;i<w;i++) { ...
a.cc: In function 'int main()': a.cc:36:22: error: expected '}' at end of input 36 | cout<<dp[h-1][w-1]; | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s649583159
p04046
C
#include<cstdio> int maze[42][42]; bool flag[42][42]; int main() { int h,w,a,b; scanf("%d %d %d %d",&h,&w,&a,&b); if(h==a) // If you can not go and end points coincide, it outputs 0 { printf("0\n"); return 0; } flag[1][1]=1;// End Marker, that they can not go for(int i=h-a+1...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s993990003
p04046
C++
using System; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using static System.Math; using static System.Array; using static AtCoder.Tool; using static AtCoder.CalcL; namespace AtCoder { class AC { const int MOD = 1000000007; //const int MOD = 99824435...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s533377819
p04046
C++
#include "iostream" using namespace std; long long modfact(long long a) { long long res = 1; while (a-- > 0) { res = (res + a) % (10e9+7) } return res; } int main() { long long w, h, a, b; cin >> h >> w >> a >> b; long long total = modfact(w+h) / (modfact(w) * modfact(h)) % (10e9+7); ...
a.cc: In function 'long long int modfact(long long int)': a.cc:7:25: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 7 | res = (res + a) % (10e9+7) | ~~~~~~~~~ ^ ~~~~~~~~ | | | | | d...
s980547440
p04046
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; ll f[1000010],revf[1000010]; ll qpow(ll a,ll b) { ll ret=1; while(b) { if(b&1) ret=(ret*a)%mod; a=(a*a)%mod; b>>=1; } return ret; } void init() { f[0]=1; revf[0]=qpow(f[0],mod-2); for(ll i=1; i<1000010;...
a.cc: In function 'll qpow(ll, ll)': a.cc:13:37: error: 'mod' was not declared in this scope; did you mean 'modf'? 13 | if(b&1) ret=(ret*a)%mod; | ^~~ | modf a.cc:14:25: error: 'mod' was not declared in this scope; di...
s738915193
p04046
C++
#include <iostream> int main(){ std::cout << "a" << endl; return 0; }
a.cc: In function 'int main()': a.cc:4:23: error: 'endl' was not declared in this scope; did you mean 'std::endl'? 4 | std::cout << "a" << endl; | ^~~~ | std::endl In file included from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/incl...
s065798799
p04046
C++
ll H, W, A, B; ll calcpat(ll hp, ll wp){ if((hp == 1) && (wp == 1)){ return 1; } else{ if(hp == 1){ ll ret = calcpat(hp, wp - 1) % MOD; return ret; } else if((wp == 1) || ((hp > H - A) && (wp == B + 1))){ ll ret = calcpat(hp - 1, wp) % MOD; return ret; } else{ ll ret ...
a.cc:2:1: error: 'll' does not name a type 2 | ll H, W, A, B; | ^~ a.cc:4:1: error: 'll' does not name a type 4 | ll calcpat(ll hp, ll wp){ | ^~ a.cc: In function 'int main()': a.cc:24:3: error: 'cin' was not declared in this scope 24 | cin >> H >> W >> A >> B; | ^~~ a.cc:24:10: error: ...
s871451583
p04046
C++
// D - いろはちゃんとマス目 #include <bits/stdc++.h> using namespace std; typedef long long ll; // const int INF = 2147483647; // const ll INF = 9223372036854775807; const int MOD = 1e9 + 7; class Comb { private: int MOD; long long* fac; long long* finv; long long* inv; public: // 事前にテーブルを作成 Comb(int MAX, int MOD) { t...
a.cc: In function 'int main()': a.cc:58:21: error: expected primary-expression before '(' token 58 | Comb comb = Comb(H + W;, MOD); | ^ a.cc:58:27: error: expected ')' before ';' token 58 | Comb comb = Comb(H + W;, MOD); | ~ ^ | ...
s124201353
p04046
C++
#include <iostream> #include <string> #include <vector> using namespace std; int main(void){ int H,W,A,B cin >> H >> W >> A >> B; vector<vector<unsigned long long>> ans(H, vector<unsigned long long>(W)); for(int i = 0;i < H -A; ++i){ ans[i][0] = 1; } for(int i = H-A;i < H;++i){ ans[i][0] = 0; } for(int i =...
a.cc: In function 'int main()': a.cc:8:9: error: expected initializer before 'cin' 8 | cin >> H >> W >> A >> B; | ^~~ a.cc:16:30: error: 'B' was not declared in this scope 16 | for(int i = 0; i < W-B; ++i){ | ^ a.cc:19:23: error: 'B' was not declar...
s303980711
p04046
C++
#include<iostream> using namespace std; typedef long long ll; ll mod = 1e9 + 7, fac[1000000005], v[1000000005]; ll modRec(ll a, ll b) { if (b == 0)return 1; if (b % 2 == 0)return modRec((a * a) % mod, b / 2); return ((a % mod) * modRec((a * a) % mod, b / 2)); } int main() { fac[0] = 1, v[0] = 1; for (int i = 1...
/tmp/cc7xQJ3J.o: in function `main': a.cc:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc7xQJ3J.o a.cc:(.text+0x171): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cc7xQJ3J.o a.cc:(.text+0x24f): relocation tru...
s539550132
p04046
Java
package main.java.tasks; import java.util.Scanner; import java.io.PrintWriter; public class ABC042DIrohaandaGrid { public void solve(int testNumber, Scanner in, PrintWriter out) { int h = in.nextInt(); int w = in.nextInt(); int a = in.nextInt(); int b = in.nextInt(); ModComb mc = new ModComb(20...
Main.java:6: error: class ABC042DIrohaandaGrid is public, should be declared in a file named ABC042DIrohaandaGrid.java public class ABC042DIrohaandaGrid { ^ Main.java:13: error: cannot find symbol ModComb mc = new ModComb(200005); ^ symbol: class ModComb location: class ABC042DIrohaandaGrid Main.ja...
s472456288
p04046
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i=0; i<(n); ++i) #define chmin(x,y) x = min(x,y) #define chmax(x,y) x = max(x,y) using namespace std; using Graph = vector<vector<int>>; typedef long long ll; typedef pair<int, int> P; const int inf = INT_MAX; const ll INF = 1LL << 60; const ll mod = 1e9+7; struct com...
a.cc:14:12: error: 'mint' was not declared in this scope; did you mean 'uint'? 14 | vector<mint> fact, ifact; | ^~~~ | uint a.cc:14:16: error: template argument 1 is invalid 14 | vector<mint> fact, ifact; | ^ a.cc:14:16: error: template argument 2 is ...
s171962418
p04046
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #include <cmath> #include <vector> #include <queue> #include <set> #include <map> #include <functional> using namespace std; typedef long long ll; typedef vector<ll> vl; typedef vector<vector<ll>> vvl; typedef vector<vector<...
a.cc:39:9: warning: "rep" redefined 39 | #define rep(i, n) for(int i = 0; i < n; i++) | ^~~ a.cc:17:9: note: this is the location of the previous definition 17 | #define rep(i, n) for(ll i = 0; i < n; i++) | ^~~ a.cc:42:4: error: conflicting declaration 'll mod' 42 | ll mod = 100000...
s970117893
p04046
C++
#include<bits/stdc++.h> using namespace std; //#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define int long long typedef vector<int>Vl; typedef pair<int,int>PII; typedef vector<PII>Vll; typedef vector<pair<int,pair<int,int> > >Vlll; typedef priority_queue<int>PQL; typedef map<int,int>MP; #de...
/tmp/cckeV4re.o: in function `recur(long long, long long)': a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `R' defined in .bss section in /tmp/cckeV4re.o a.cc:(.text+0x20): relocation truncated to fit: R_X86_64_PC32 against symbol `C' defined in .bss section in /tmp/cckeV4re.o a.cc:(.text+...
s863641111
p04046
C++
factorial.resize(h + w, -1);
a.cc:1:5: error: 'factorial' does not name a type 1 | factorial.resize(h + w, -1); | ^~~~~~~~~
s087494609
p04046
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll MOD = 1000000007; ll INF = 100000000000000; double PI = 3.1415926535; template<typename T> void remove(std::vector<T>& vector, unsigned int index) { vector.erase(vector.begin() + index); } using Graph = vector<vector<ll>>; ll minv[100100];...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s119638711
p04046
C++
#include<iostream> using namespace std; #define MODE 1000000007 int factorial(int start, int end){ int answer = 1; if (end < start) return 1; for(int i=start; i <= end; i++){ answer *= i%MODE; answer = answer%MODE; } //cout << "answer =" << answer << endl; return answer; } int my_course(int h...
a.cc: In function 'int main()': a.cc:34:5: error: 'colisoion' was not declared in this scope; did you mean 'colision'? 34 | colisoion = colision%MODE; | ^~~~~~~~~ | colision
s711429083
p04046
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; bool path(vector<vector<int> > v, int a, int b) { vector<vector<bool> > vis( a , vector<int> (b, false)); queue<pair<int, int> > q; q.push(make_pair(0, 0)); int r[2] = {0, 1}; int c[2] = {1, 0}; int count = 0; while(!q.empty()) ...
a.cc: In function 'bool path(std::vector<std::vector<int> >, int, int)': a.cc:8:62: error: no matching function for call to 'std::vector<std::vector<bool> >::vector(int&, std::vector<int>)' 8 | vector<vector<bool> > vis( a , vector<int> (b, false)); | ...
s649732888
p04046
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; bool path(vector<vector<int> > v, a, b) { vector<vector<bool> > vis( a , vector<int> (b, false)); queue<pair<int, int> > q; q.push(make_pair(0, 0)); int r[2] = {0, 1}; int c[2] = {1, 0}; int count = 0; while(!q.empty()) { p...
a.cc:6:35: error: 'a' has not been declared 6 | bool path(vector<vector<int> > v, a, b) | ^ a.cc:6:38: error: 'b' has not been declared 6 | bool path(vector<vector<int> > v, a, b) | ^ a.cc: In function 'bool path(std::vector<std:...
s783879460
p04046
C++
#include <bits/stdc++.h> using namespace std; int kaijo(int x){ if (x>0) return x*kaijo(x-1); else return 1; } int main(){ int h,w,a,b; cin >> h >> w >> a >> b; vector<int>vec(100000) int ans; for(int i=0;i<w-b;i++){ vec.at(i) = kaijo(h-a+b+i)/kaijo(h-a-1)/kaijo(b+i+1); vec.at(i) = vec.at(i)*kai...
a.cc: In function 'int main()': a.cc:11:5: error: expected ',' or ';' before 'int' 11 | int ans; | ^~~ a.cc:15:5: error: 'ans' was not declared in this scope; did you mean 'abs'? 15 | ans += vec.at(i); | ^~~ | abs a.cc:17:11: error: 'ans' was not declared in this scope; did y...
s142254836
p04046
C++
#include <bits/stdc++.h> using namespace std; int !(int x){ if (x>0) return x*!(x-1); else return 1; } int main(){ cin >> h >> w >> a >> b; vector<int>vec(100000) int ans; for(int i=0;i<w-b;i++){ vec.at(i) = !(h-a+b+i)/!(h-a-1)/!(b+i+1); vec.at(i) = vec.at(i)*!(w+a-b-2-i)/!(w-b-1-i)/!(a-1); an...
a.cc:3:5: error: expected unqualified-id before '!' token 3 | int !(int x){ | ^ a.cc: In function 'int main()': a.cc:8:10: error: 'h' was not declared in this scope 8 | cin >> h >> w >> a >> b; | ^ a.cc:8:15: error: 'w' was not declared in this scope 8 | cin >> h >> w >> a >> b;...
s074160440
p04046
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:68:14: error: expected ';' before 'for' 68 | COMinit() for(int x = 0; x < W - B; x++) { | ^~~~ | ; a.cc:68:30: error: 'x' was not declared in this scope 68 | COMinit() for(int x = 0; x < W - B; x++) { | ...
s249275972
p04046
C++
#include <iostream> #include <vector> using namespace std; unsigned long long int D; int main(){ D = 1000000007LL; unsigned long long int W, H, A, B; cin >> W >> H >> A >> B; unsigned long long int G[H][W]// = {{0LL}}; for(long long int y = 0; y < H; y++){ for(long long int x = 0; x < W; x++){ ...
a.cc: In function 'int main()': a.cc:14:3: error: expected initializer before 'for' 14 | for(long long int y = 0; y < H; y++){ | ^~~ a.cc:14:28: error: 'y' was not declared in this scope 14 | for(long long int y = 0; y < H; y++){ | ^ a.cc:23:11: error: 'G' was not decl...
s678652906
p04046
C++
#include <iosteam> #include <vector> using namespace std; long long int D; int main(){ D = 1000000007LL int W, H, A, B; cin >> W >> H >> A >> B; long long int G[H][W] = {0}; for(int y = 0; y < H; y++){ for(int x = 0; x < W; x++){ if(x == 0 || y == 0) G[y][x] = 1LL; else if(x + 1 + A > W ...
a.cc:1:10: fatal error: iosteam: No such file or directory 1 | #include <iosteam> | ^~~~~~~~~ compilation terminated.
s774206518
p04046
C++
#include <bits/stdc++.h> using namespace std; int H, W, A, B; template<int MOD = 1000000007> struct ModInt { int val; ModInt(long long val_ = 0) : val(val_ >= 0 ? val_ % MOD : (MOD - (-val_) % MOD) % MOD) {} bool operator==(const ModInt &rhs) const { return val == rhs.val; } bool operator!=(const ModI...
a.cc: In function 'int main()': a.cc:91:20: error: expected primary-expression before '.' token 91 | ans += Comb.C(i + B - 2, B - 1) * Comb.C(H + W - B - i - 1, W - B - 1); | ^ a.cc:91:47: error: expected primary-expression before '.' token 91 | ans += Comb.C(i + B - 2, B ...
s536042311
p04046
C++
#include <bits/stdc++.h> #define REP(i, n) for(ll i = 0; i < (ll)n; i++) #define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++) #define ALL(obj) (obj).begin(), (obj).end() #define INF (1ll << 60) #define sz(x) int(x.size()) using namespace std; typedef long long ll; using vl = vector<ll>; using vvl = vector<vl>; typedef ...
a.cc: In function 'int main()': a.cc:86:10: error: 'tmp' was not declared in this scope; did you mean 'tm'? 86 | bf = tmp; | ^~~ | tm a.cc: At global scope: a.cc:90:1: error: 'cout' does not name a type 90 | cout << ans << endl; | ^~~~ a.cc:91:1: error: expected unqualified...
s874550786
p04046
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define F(i,a,b) for(int i = (int)(a); i <= (int)(b); i++) #define RF(i,a,b) for(int i = (int)(a); i >= (int)(b); i--) #define MOD 1000000007 int main() { int M,N,P,_i,_j; //Take input the number of rows, columns and blocked cells cin>...
a.cc: In function 'int main()': a.cc:12:16: error: 'A' was not declared in this scope 12 | cin>>M>>N>>A>>B; | ^ a.cc:12:19: error: 'B' was not declared in this scope 12 | cin>>M>>N>>A>>B; | ^
s097517497
p04046
C++
h, w, a, b = map(int, input().split()) res = 0 kai = min(w - b, h - a) mod = 10 ** 9 + 7 kaijo = [0] * (h + w + 1) kaijo[0] = 1 for i in range(1, h + w + 1): kaijo[i] = (kaijo[i - 1] * i) % mod gyaku = [0] * (h + w + 1) gyaku[h + w] = pow(kaijo[h + w], mod - 2, mod) for i in range(h + w, 0, -1): gyaku[i - 1] =...
a.cc:1:1: error: 'h' does not name a type 1 | h, w, a, b = map(int, input().split()) | ^
s351147914
p04046
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0; i<n; i++) typedef long long ll; typedef long long unsigned int llu; ll MOD = 1000000007; ll INF = 1000000009; ll dp[100010][100010]; const ll MAX=100010; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1...
/tmp/cclKbk9y.o: in function `COMinit()': a.cc:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `fac' defined in .bss section in /tmp/cclKbk9y.o a.cc:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `fac' defined in .bss section in /tmp/cclKbk9y.o a.cc:(.text+0x19): relocati...
s363736017
p04046
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0; i<n; i++) typedef long long ll; typedef long long unsigned int llu; ll MOD = 1000000007; ll INF = 1000000009; ll dp[100010][100010]; const ll MAX=100010; ll fac[MAX], finv[MAX], inv[MAX]; // テーブルを作る前処理 void COMinit() { fac[0] = fac[1] = 1...
/tmp/ccW99FZw.o: in function `COMinit()': a.cc:(.text+0x7): relocation truncated to fit: R_X86_64_PC32 against symbol `fac' defined in .bss section in /tmp/ccW99FZw.o a.cc:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `fac' defined in .bss section in /tmp/ccW99FZw.o a.cc:(.text+0x19): relocati...
s377265203
p04046
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,n) for(ll i=0; i<n; i++) typedef long long ll; typedef long long unsigned int llu; ll MOD = 1000000007; ll INF = 1000000009; ll dp[h+10][w+10]; void solve(){ int h,w,a,b; cin >> h >> w >> a >> b; /* ........... ........... ..............
a.cc:9:7: error: 'h' was not declared in this scope 9 | ll dp[h+10][w+10]; | ^ a.cc:9:13: error: 'w' was not declared in this scope 9 | ll dp[h+10][w+10]; | ^ a.cc: In function 'void solve()': a.cc:22:5: error: 'dp' was not declared in this scope; did you mean 'dup'? 22 | dp...
s192087530
p04046
C++
#include <bits/stdc++.h> using namespace std; typedef ll long long; #define For(i,n,k) for(ll i=(n);i<(k);i++) ll h,w,a,b; bool Main(){ cin>>h>>w>>a>>b; ll vec[100000][100000]; for(int i=0;i<h-a;i++){ vec[i][0]=1; } for(int i=h-a;i<h;i++){ vec[i][0]=0; } for(int j=0;j<w;j++){...
a.cc:3:9: error: 'll' does not name a type 3 | typedef ll long long; | ^~ a.cc:5:1: error: 'll' does not name a type 5 | ll h,w,a,b; | ^~ a.cc: In function 'bool Main()': a.cc:7:10: error: 'h' was not declared in this scope 7 | cin>>h>>w>>a>>b; | ^ a.cc:7:13: error: 'w...
s270715785
p04046
C++
#include <bits/stdc++.h> using namespace std; #define LL long long #define REP(i, n) for(LL i = 0; i < (int)(n); i++) #define FOR(i,a,b) for(LL i=(a);i<(b);++i) #define ALL(x) (x).begin(),(x).end() const int IINF = 1e9; const LL LINF = 1e18; const LL mod = 1e9+7; LL add(LL x, LL y) { return (x%mod) + (y%mod); } L...
a.cc: In function 'int main()': a.cc:42:13: error: 'res' was not declared in this scope 42 | cout << res << endl; | ^~~
s097398382
p04046
C++
#include <bits/stdc++.h> using namespace std; #define LL long long #define REP(i, n) for(LL i = 0; i < (int)(n); i++) #define FOR(i,a,b) for(LL i=(a);i<(b);++i) #define ALL(x) (x).begin(),(x).end() const int IINF = 1e9; const LL LINF = 1e18; const LL mod = 1e9+7; LL add(LL x, LL y) { return (x%mod) + (y%mod); } L...
a.cc: In function 'int main()': a.cc:50:42: error: 'd' was not declared in this scope; did you mean 'd2'? 50 | LL d2 = mul(mul(fact[H - i - 1 + d], inv(fact[H - i - 1])), inv(fact[W - B - 1])); | ^ | d2
s486307987
p04046
C++
#include <bits/stdc++.h> using namespace std; #define LL long long #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define ALL(x) (x).begin(),(x).end() const int IINF = 1e9; const LL LINF = 1e18; const LL mod = 1e9+7; LL md_add(LL x, LL y) { return (x%mod) + (y%mo...
a.cc:81:11: error: redefinition of 'const int IINF' 81 | const int IINF = 1e9; | ^~~~ a.cc:8:11: note: 'const int IINF' previously defined here 8 | const int IINF = 1e9; | ^~~~ a.cc:82:10: error: redefinition of 'const long long int LINF' 82 | const LL LINF = 1e18; | ...
s391597827
p04046
C++
#include<bits/stdc++.h> #define mode 1e9+7 using namespace std; int main(){ int n, m, a, b; cin >> n >> m >> a >> b; ll dp[n][m]; dp[0][0] = 0; for(int i=0; i<=n; i++) dp[i][0] = 0; for(int j=0; j<=m; j++) dp[0][j] = 0; for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ if(i > (n - a) && j <= b...
a.cc: In function 'int main()': a.cc:8:3: error: 'll' was not declared in this scope 8 | ll dp[n][m]; | ^~ a.cc:9:3: error: 'dp' was not declared in this scope; did you mean 'dup'? 9 | dp[0][0] = 0; | ^~ | dup a.cc:17:19: error: 'mod' was not declared in this scope; did you mean 'mo...
s711548774
p04046
C++
#include<bits/stdc++.h> #define mode 1e9+7 using namespace std; int main(){ int n, m, a, b; cin >> n >> m >> a >> b; int dp[n][m]; dp[0][0] = 0; for(int i=0; i<=n; i++) dp[i][0] = 0; for(int j=0; j<=m; j++) dp[0][j] = 0; for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ if(i > (n - a) && j <= ...
a.cc: In function 'int main()': a.cc:17:16: error: invalid operands of types 'int' and 'double' to binary 'operator%' 17 | dp[i][j] %= mode;} | ^ a.cc:17:16: note: in evaluation of 'operator%=(int, double)'
s266748682
p04046
C++
#include<bits/stdc++.h> #define mode 1e9+7 using namespace std; int main(){ int n, m, a, b; cin >> n >> m >> a >> b; int dp[n][m]; dp[0][0] = 0; for(int i=0; i<=n; i++) dp[i][0] = 0; for(int j=0; j<=m; j++) dp[0][j] = 0; for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ if(i > (n - a) && j <= ...
a.cc: In function 'int main()': a.cc:17:19: error: 'mod' was not declared in this scope; did you mean 'modf'? 17 | dp[i][j] %= mod;} | ^~~ | modf
s889116773
p04046
C++
#include "bits/stdc++.h" using namespace std; #define Rep(i,n) for(int i=0;i<(int)(n);i++) #define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++) #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--) #define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++) #define RFOR(i,n1,n2) fo...
a.cc:66:10: error: a parameter cannot be declared 'constexpr' 66 | template<constexpr uint_fast64_t Mod> | ^~~~~~~~~
s456654103
p04046
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <utility> #include <cmath> #include <vector> #include <queue> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; ll mod = 1000000007; int MAX = 200010; ll factorialTable[MAX]; ll inverseFactorialT...
a.cc:15:19: error: size of array 'factorialTable' is not an integral constant-expression 15 | ll factorialTable[MAX]; | ^~~ a.cc:16:26: error: size of array 'inverseFactorialTable' is not an integral constant-expression 16 | ll inverseFactorialTable[MAX]; | ^...
s597831244
p04046
C
#include <stdio.h> int x, y, W, H, a, b; long long dp[100000][100001]; long long dfs(int x, int y){ if(x > W || y < 1 || (x <= a && y <= B)) return 0; if(x == W, y == 1) return 1; if(dp[x][y] != 0) return dp[x][y]; dp[x][y] = dfs(x+1, y) + dfs(x,y+1); return dfs(x+1, y) + dfs(x,y+1); } int main(void){ scan...
main.c: In function 'dfs': main.c:5:40: error: 'B' undeclared (first use in this function) 5 | if(x > W || y < 1 || (x <= a && y <= B)) return 0; | ^ main.c:5:40: note: each undeclared identifier is reported only once for each function it appears in
s698862414
p04046
C++
#include <iostream> #include <string.h> using namespace std; #define int long long int N = 2e5+5, MOD = 1e9 + 7; int h, w, a, b; int fac[N], invFac[N + 1], inv[N + 1]; void calcInv() { inv[0] = inv[1] = 1; for (int i = 2; i <= N; i++) { inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD; } } void c...
a.cc:8:9: error: size of array 'fac' is not an integral constant-expression 8 | int fac[N], invFac[N + 1], inv[N + 1]; | ^ a.cc:8:22: error: size of array 'invFac' is not an integral constant-expression 8 | int fac[N], invFac[N + 1], inv[N + 1]; | ~~^~~ a.cc:8:34: error: s...
s136923896
p04046
C++
#include<bits/stdc++.h> using namespace std; // Shortcut //#define int long long #define endl '\n' #define eb emplace_back #define pb push_back #define pob pop_back #define mp make_pair #define upb upper_bound #define lwb lower_bound #define fi first #define se second #define For(i, l, r) for (int i = l; i < r; i++) ...
a.cc: In function 'int C(int, int)': a.cc:83:19: error: 'fact' was not declared in this scope; did you mean 'fac'? 83 | return (((fact[n] * inv[k]) % mod) * inv[n - k]) % mod; | ^~~~ | fac
s352375688
p04046
C++
#include "pch.h" #include <cstdio> typedef long long ll; const ll MOD = 1e9 + 7; ll fac[200001] = { 1 }; ll invfac[200001] = { 1 }; ll qpow(ll b, ll e) { ll c = 1; while (e) { if (e & 1LL) c = (c * b) % MOD; b = (b * b) % MOD; e /= 2LL; } return c; } ll comb(int n, int k) { ll tmp = fac...
a.cc:1:10: fatal error: pch.h: No such file or directory 1 | #include "pch.h" | ^~~~~~~ compilation terminated.
s201237064
p04046
C++
#include<bits/stdc++.h> using namespace std; const long N=2e5+5,M=1e9+7; register long h,w,a,b,fac[N],ifac[N],ans=0,up,i; inline long C(long n,long m){return fac[n]*ifac[m]%M*ifac[n-m]%M;} int main(){ cin>>h>>w>>a>>b,up=max(w,h),fac[0]=fac[1]=ifac[0]=ifac[1]=1; for(i=2;i<=up<<1;++i)fac[i]=fac[i-1]*i%M,ifac[i]=ifac[M%...
a.cc:4:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register long h,w,a,b,fac[N],ifac[N],ans=0,up,i; | ^ a.cc:4:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register long h,w,a,b,fac[N],ifac[N],ans=0,up...
s152055688
p04046
C++
#include<bits/stdc++.h> using namespace std; const long N=2e5+5,M=1e9+7; register long h,w,a,b,fac[N],ifac[N],ans=0,up,i; inline long C(long n,long m){return fac[n]*ifac[m]%M*ifac[n-m]%M;} int main(){ scanf("%d%d%d%d",&h,&w,&a,&b),up=max(w,h),fac[0]=fac[1]=ifac[0]=ifac[1]=1; for(i=2;i<=up<<1;++i)fac[i]=fac[i-1]*i%M,i...
a.cc:4:15: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register long h,w,a,b,fac[N],ifac[N],ans=0,up,i; | ^ a.cc:4:17: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 4 | register long h,w,a,b,fac[N],ifac[N],ans=0,up...
s983034382
p04046
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) long long inf=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } //typedef long long ll; long long po(long a, long b){ if(b==0){ return 1; } long long ...
a.cc: In function 'int main()': a.cc:53:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 53 | cin>>h>>w>>a>>b; | ^~~ | std::cin In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146, from a.cc:1: /usr/include/c++/14/iostream:62:18: not...
s287510661
p04046
C++
#include <bits/stdc++.h> #define REP(i,n) for(int i=0;i<n;i++) long long inf=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } //typedef long long ll; long long po(long a, long b){ if(b==0){ return 1; } long long ...
a.cc:26:1: error: 'SIZE' does not name a type 26 | SIZE=200010; | ^~~~ a.cc:27:15: error: 'SIZE' was not declared in this scope 27 | long long inv[SIZE+1];//各iの逆元を格納する配列。 | ^~~~ a.cc:28:15: error: 'SIZE' was not declared in this scope 28 | long long kai[SIZE+1];//i!のmodを格納する配列。 ...
s806902558
p04046
C++
#include <bits/stdc++.h> using namespace std; long long int par(int p){ long long int output = 1; while(p > 0){ output *= p; p--; } return output; } const int mod = 1e9+7; int main(){ int H, W, A, B; cin >> H >> W >> A >> B; long long long long long int all_c = (par(H + W ...
a.cc: In function 'int main()': a.cc:18:15: error: 'long long long' is too long for GCC 18 | long long long long long int all_c = (par(H + W - 2) / (par(H - 1) * par(W - 1))) % mod; | ^~~~ a.cc:18:20: error: 'long long long' is too long for GCC 18 | long long long long long int all_c =...
s254448480
p04046
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<string> #include<cmath> #include<cstdlib> #include<stack> #include<queue> #define ll long long using namespace std; const int maxn=1e5+7; const int mod=1e9+7; ll fac[maxn],inv_fac[maxn]; ll quick(ll a,ll n){ ll res=1,t=a; while(...
a.cc: In function 'int main()': a.cc:44:22: error: 'm1' was not declared in this scope; did you mean 'm'? 44 | for(int i=b+1;i<=m1;i++) ans=(ans+(C(n-a-1+i-1,i-1)%mod*C(a-1+m-i,m-i)%mod)%mod)%mod; | ^~ | m
s629294608
p04046
C++
#include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e5+7; const int mod=1e9+7; ll fac[maxn],inv_fac[maxn]; ll quick(ll a,ll n){ ll res=1,t=a; while(n){ if(n&1) res=(res*t)%mod; t=(t*t)%mod; n/=2; } return res; } void init(){ fac[0]=1; for(int...
a.cc: In function 'int main()': a.cc:36:22: error: 'm1' was not declared in this scope; did you mean 'm'? 36 | for(int i=b+1;i<=m1;i++) ans=(ans+(C(n-a-1+i-1,i-1)%mod*C(a-1+m-i,m-i)%mod)%mod)%mod; | ^~ | m
s482853824
p04046
C++
#include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e5+7; const int mod=1e9+7; ll fac[maxn],inv_fac[maxn]; ll quick(ll a,ll n){ ll res=1,t=a; while(n){ if(n&1) res=(res*t)%mod; t=(t*t)%mod; n/=2; } return res; } void init(){ fac[0]=1; for(int...
a.cc: In function 'int main()': a.cc:36:22: error: 'm1' was not declared in this scope; did you mean 'm'? 36 | for(int i=b+1;i<=m1;i++) ans=(ans+(C(n-a-1+i-1,i-1)%mod*C(a-1+m-i,m-i)%mod)%mod)%mod; | ^~ | m
s465144551
p04046
C++
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) #define REPR(i, n) for(int i = n - 1; i >= 0; i--) #define FOR(i, m, n) for(int i = m; i <= n; i++) #define FORR(i, m, n) for(int i = m; i >= n; i--) #define SORT(v, n) sort(v, v+n); #define VSORT(v) sort(v.begin(), v.end()); us...
a.cc: In lambda function: a.cc:45:61: error: inconsistent types 'int' and 'long long int' deduced for lambda return type 45 | else return (((pw[n] * inv[k]) % MOD) * inv[n - k]) % MOD; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
s982288162
p04046
C++
maxn+10]; void init(){ fac[0]=1; for(int i=1;i<=maxn;i++) fac[i]=(fac[i-1]*i)%mod; inv_fac[maxn]=ksm(fac[maxn],mod-2); for(int i=maxn-1;i>=0;i--) inv_fac[i]=(inv_fac[i+1]*(i+1))%mod; } ll C(int n,int m){ if(n < 0 || m < 0 || m > n) return 0; if(m == 0 || m =...
a.cc:1:1: error: 'maxn' does not name a type 1 | maxn+10]; | ^~~~ a.cc: In function 'void init()': a.cc:4:9: error: 'fac' was not declared in this scope 4 | fac[0]=1; | ^~~ a.cc:5:24: error: 'maxn' was not declared in this scope 5 | for(int i=1;i<=maxn;i++) fac[i]=(fac[i-...
s999989007
p04046
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; const int MAX_N=2e5+20; const int MOD = 1e9+7; ll fact[MAX_N]; int H,W,A,B; ll powmod(ll x, ll n) { ll res=1; while(n){ if(n&1) res = (res*x)%MOD; x = (x*x)%MOD; n >>=1; } return res; } ll C(ll n, ll m) { ll a=fact[n]; ll b=(fact[m]*fac...
a.cc: In function 'void solve()': a.cc:31:22: error: 'N' was not declared in this scope 31 | for(ll i=1;i<N;++i) fact[i]=(fact[i-1]*i)%MOD; | ^
s255080699
p04046
C++
#include <iostream> using namespace std; template <int p> struct Modint { int value; Modint() : value(0) {} Modint(long x) : value(x >= 0 ? x % p : (p + x % p) % p) {} inline Modint &operator+=(const Modint &b) { if ((this->value += b.value) >= p) this->value -= p; return (*this); } inline Modint &ope...
a.cc: In member function 'Modint<p> Modint<p>::inverse() const': a.cc:57:17: error: there are no arguments to 'assert' that depend on a template parameter, so a declaration of 'assert' must be available [-fpermissive] 57 | assert(this->value != 0); | ^~~~~~ a.cc:57:17: note: (if...
s495182206
p04046
C++
#include <iostream> #include <algorithm> using namespace std; const int MOD=1000*1000*1000+7; vector<long long> facts; vector<long long> fact_invs; vector<long long> invs; void comb_init(int n){ facts=vector<long long>(n+1); fact_invs=vector<long long>(n+1); invs=vector<long long>(n+1); facts[0]=fac...
a.cc:8:1: error: 'vector' does not name a type 8 | vector<long long> facts; | ^~~~~~ a.cc:9:1: error: 'vector' does not name a type 9 | vector<long long> fact_invs; | ^~~~~~ a.cc:10:1: error: 'vector' does not name a type 10 | vector<long long> invs; | ^~~~~~ a.cc: In function 'void comb_in...
s049961331
p04046
C
#include <bits/stdc++.h> using namespace std; #define int long long #define rep(i,n) for(int i=0;i<n;i++) #define mod 1000000007 int kaijo(int n){ int ans=1; for(int i=2;i<=n;i++){ ans*=i; ans%=mod; } return ans; } int modpow(int a,int b){ if(b==0)return 1; if(b%2)return modpow(a,b-1)*a%mod; return modpow(a,...
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory 1 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s512728766
p04046
C++
#pragma comment(linker, "/stack:20000000") #pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx") #include<bits/stdc++.h> /*#include<ext/pb_ds/assoc_container.hpp> #include<ext/pb_ds/tree_policy.hpp> #include<ext/pb_ds/detail/standard_policies.hpp>*/ #define sz(s) (int)(s.size()...
a.cc:30:25: error: narrowing conversion of '-1' from 'int' to 'long long unsigned int' [-Wnarrowing] 30 | const int dx[] = {0,0,1,-1}, dy[] = {1,-1,0,0}; | ^~ a.cc:30:40: error: narrowing conversion of '-1' from 'int' to 'long long unsigned int' [-Wnarrowing] 30 | const int dx[] = {0...
s256827876
p04046
C++
#include<cstdio> #include<cstring> #include<algorithm> #define mod 1e9+7 long long exgcd(long long a, long long b, long long &x, long long &y) { if (b == 0) { x = 1; y = 0; return a; } long long d = exgcd(b, a % b, y, x); y -= a / b * x; return d; } long long inv(long l...
a.cc: In function 'long long int lucas(long long int, long long int)': a.cc:30:15: error: invalid operands of types 'long long int' and 'double' to binary 'operator%' 30 | a = n % mod, b = m % mod; | ~ ^ | | | long long int a.cc:30:28: error: invalid oper...
s195503448
p04046
C++
#include <bits/stdc++.h> #define FOR(i, begin, end) for(int i=(begin);i<(end);i++) #define REP(i, n) FOR(i,0,n) #define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--) #define IREP(i, n) IFOR(i,0,n) #define SORT(a) sort(a.begin(), a.end()) #define REVERSE(a) reverse(a.begin(), a.end()) #define int long long #defi...
a.cc: In constructor 'Combination::Combination(long long int, long long int)': a.cc:45:21: error: 'i' was not declared in this scope 45 | invfact[i] = (invfact[i + 1] * (i + 1)) % mod; | ^
s018919644
p04046
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;++i) #define rep(i,n) REP(i,0,n) #define ALL(x) x.begin(),x.end() #define EPS (1e-8) #define equals(a,b) (fabs((a)-(b))<EPS) using namespace std; typedef long long ll; const int IINF = INT_MAX; const ll LLINF = LLONG_MAX; inline bool LT(double a,double b) {...
a.cc:39:13: error: unable to find numeric literal operator 'operator""\U0000ff10000' 39 | #define MAX 10010000 | ^~~~~~~~~ a.cc:40:9: note: in expansion of macro 'MAX' 40 | ll fact[MAX]; | ^~~ a.cc: In function 'int main()': a.cc:47:3: error: 'fact' was not declared in this scope ...
s215209117
p04046
C++
#include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdio> 5 #include <vector> 6 #include <cstdlib> 7 #include <iomanip> 8 #include <cmath> 9 #include <ctime> #include <map> #include <set> #include <queue> using namespace std; #define lowbit(x) (x&(-x)) #define max(x,y) (x>y?x:y) #defin...
a.cc:2:4: error: stray '#' in program 2 | 2 #include <algorithm> | ^ a.cc:3:4: error: stray '#' in program 3 | 3 #include <cstring> | ^ a.cc:4:4: error: stray '#' in program 4 | 4 #include <cstdio> | ^ a.cc:5:4: error: stray '#' in program 5 | 5 #include <vector> | ...
s739702958
p04046
C++
#include <bits/stdc++.h> using namespace std; long long mod=1e9+7; long long fact[100010]; long long poww(long long x,long long n) { if(n==0) return 1; else if(n%2==0) return poww(x,n/2) * poww(x,n/2) % mod; else if(n%2==1) return poww(x,n/2) * poww(x,n/2) % mod * x % mod; } long long C(long long k,long lo...
cc1plus: error: '::main' must return 'int' a.cc: In function 'long long int poww(long long int, long long int)': a.cc:11:1: warning: control reaches end of non-void function [-Wreturn-type] 11 | } | ^
s235996169
p04046
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <iostream> #include <algorithm> #include <string> #include <vector> using namespace std; int comb(long long int n, long long int k); int main(){ int h,w,a,b; long long int ans; cin >> h >> w >> a >> b; ans = comb(h,w) - comb(a,b); cou...
/usr/bin/ld: /tmp/ccWiTXGU.o: in function `main': a.cc:(.text+0x67): undefined reference to `comb(long long, long long)' /usr/bin/ld: a.cc:(.text+0x7f): undefined reference to `comb(long long, long long)' collect2: error: ld returned 1 exit status
s008389763
p04046
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:39:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 39 | ll fact[2e5]; | ^~~ a.cc:39:9: error: could not convert '2.0e+5' from 'double' to 'long unsigned int' 39 | ll fact[2e5]; | ^~~ | | | double a.cc:39:9: e...
s275857351
p04046
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<string> #include<algorithm> #include<stack> #include<map> #include<deque> #include<cstdio> using namespace std; #define rep(i,a) for(int i=0;i<a;i++) #define mp make_pair #define pb push_back #define ll __int64 //#define __int...
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll __int64 | ^~~~~~~ a.cc:20:7: note: in expansion of macro 'll' 20 | const ll M=1000000007; | ^~ a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'? 16 | #define ll _...
s649444742
p04046
C++
#include <stdio.h> #include <iostream> #include <string.h> #include <string> #include <algorithm> #include <queue> #include <map> #define INF 999999 using namespace std; int maing() { queue<pair<int, int> > qu; int h, w, a, b, ans = 0; cin >> h >> w >> a >> b; qu.push(make_pair(1, 1)); while (!qu.empty()) { p...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s336472021
p04046
C++
// 0529.cpp : 定义控制台应用程序的入口点。 // #ifndef ONLINE_JUDGE #define _CRT_SECURE_NO_WARNINGS #define gets(str) gets_s(str) #endif #include <stdio.h> #include <iostream> #include <string.h> #include <string> #include <algorithm> #include <queue> #include <map> #define INF 999999 using namespace std; int maing() { queue<pair<...
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s732356212
p04046
C++
#include <bits/stdc++.h> /* Karen {{{ ___ ____ |_ ||_ _| | |_/ / ,--. _ .--. .---. _ .--. | __'. `'_\ : [ `/'`\]/ /__\\[ `.-. | _| | \ \_ // | |, | | | \__., | | | | |____||____|\'-;__/[___] '.__.'[___||__] }}} */ /* cpp template {{{*/ using namespace std; #define endl '\n' #define REP...
g++: internal compiler error: File size limit exceeded signal terminated program as Please submit a full bug report, with preprocessed source (by using -freport-bug). See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
s146954323
p04046
C++
#include<iostream> #include<vector> #define MOD 1000000007 using namespace std; int fast_pow(int base, int n, int M){ if (n == 0) return 0; if (n == 1)return base; int halfn = fast_pow(base, n / 2, M); if (n % 2 == 0) return (long long(halfn)*halfn) % M; else return (((long long(halfn) * halfn) % M)*base) % M; } ...
a.cc: In function 'int fast_pow(int, int, int)': a.cc:9:34: error: expected primary-expression before 'long' 9 | if (n % 2 == 0) return (long long(halfn)*halfn) % M; | ^~~~ a.cc:9:34: error: expected ')' before 'long' 9 | if (n % 2 == 0) return (long long...
s309016624
p04046
C++
#include<iostream> #include<vector> #define MOD 1000000007 using namespace std; int fast_pow(int base, int n, int M){ if (n == 0) return 0; if (n == 1)return base; int halfn = fast_pow(base, n / 2, M); if (n % 2 == 0) return (long long(halfn)*halfn) % M; else return (((long long(halfn) * halfn) % M)*base) % M; } ...
a.cc: In function 'int fast_pow(int, int, int)': a.cc:9:34: error: expected primary-expression before 'long' 9 | if (n % 2 == 0) return (long long(halfn)*halfn) % M; | ^~~~ a.cc:9:34: error: expected ')' before 'long' 9 | if (n % 2 == 0) return (long long...
s532132377
p04046
C++
#include <vector> #include <iostream> #define MOD 1000000007 using namespace std; long long fast_pow(long long Base, long long n, long long M){ if (n == 0) return 1; if (n == 1) return Base; long long halfn = fast_pow(Base, n / 2, M); long long ans; if (n % 2 == 0) { ans = long long(halfn * halfn) % M; } else { ...
a.cc: In function 'long long int fast_pow(long long int, long long int, long long int)': a.cc:10:33: error: expected primary-expression before 'long' 10 | if (n % 2 == 0) { ans = long long(halfn * halfn) % M; } | ^~~~ a.cc:11:22: error: expected primary-expression before...
s914876973
p04046
C++
#include <vector> #include <iostream> #define MOD 1000000007 using namespace std; long long fast_pow(long long Base, long long n, long long M){ if (n == 0) return 1; if (n == 1) return Base; long long halfn = fast_pow(Base, n / 2, M); long long ans; if (n % 2 == 0) ans= long long(halfn * halfn) % M; else ans= lo...
a.cc: In function 'long long int fast_pow(long long int, long long int, long long int)': a.cc:10:30: error: expected primary-expression before 'long' 10 | if (n % 2 == 0) ans= long long(halfn * halfn) % M; | ^~~~ a.cc:11:19: error: expected primary-expression before 'long' ...
s614802844
p04046
C++
#include <vector> #include <iostream> #define MOD 1000000007 using namespace std; long long fast_pow(long long base, long long n, long long M){ if (n == 0) return 1; if (n == 1) return base; long long halfn = fast_pow(base, n / 2, M); long long ans; if (n % 2 == 0) ans= long long(halfn * halfn) % M; else ans= lo...
a.cc: In function 'long long int fast_pow(long long int, long long int, long long int)': a.cc:10:30: error: expected primary-expression before 'long' 10 | if (n % 2 == 0) ans= long long(halfn * halfn) % M; | ^~~~ a.cc:11:19: error: expected primary-expression before 'long' ...
s827615823
p04046
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MOD = 1000000007; // a, bの最大公約数と, ax+by=gcd(a, b)となるx,yを求める //拡張ユークリッドの互除法 ll extgcd(ll a, ll b, ll &x, ll &y) { ll g = a; if(b != 0) { g = Extgcd(b, a % b, y, x); y -= (a / b) * x; } else { x = 1; ...
a.cc: In function 'll extgcd(ll, ll, ll&, ll&)': a.cc:13:13: error: 'Extgcd' was not declared in this scope; did you mean 'extgcd'? 13 | g = Extgcd(b, a % b, y, x); | ^~~~~~ | extgcd a.cc: In function 'll mod_inverse(ll, ll)': a.cc:29:5: error: 'Extgcd' was not declared in...
s580659085
p04046
C++
using System; class NumberTheory { bool isFact; long[] fact; public NumberTheory(){ isFact = false; } public void FactTable(long n, long m){ isFact = true; fact = new long[n+1]; fact[0] = 1; for(long i=1;i<n+1;i++){ fact[i] = (fact[i-1]*i)%m...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:6:9: error: expected unqualified-id before '[' token 6 | long[] fact; | ^ a.cc:7:11: error: expected ':' before 'NumberTheory' 7 | public NumberTheory(){ | ^~~~~~...
s222832127
p04046
Java
import java.util.Scanner; import java.math.*; /** * http://abc042.contest.atcoder.jp/tasks/arc058_b * @author Cummin */ public class Main { public static void main(String[] args) { int H, W, A, B ; // データの読み込み Scanner sc = new Scanner(System.in); H = sc.nextInt(); W...
Main.java:40: error: reached end of file while parsing } ^ 1 error
s453101899
p04046
C++
#include <iostream> #include <string> #define int long long using namespace std; const int MOD = 1e9+7; int pot(int x, int p) { if (p == 0) return 1; int z = pot(x, p/2); z = (z*z)%MOD; if (p%2) z = (z*x) % MOD; return z; } int inv(int x) { return pot(x, MOD-2); } int pows[200000 + 10]; int powsinv[200000 + 10]; ...
a.cc: In function 'int main()': a.cc:36:14: error: 'b' was not declared in this scope 36 | for (int i = b+1; i <= w; i++) { | ^ a.cc:36:24: error: 'w' was not declared in this scope 36 | for (int i = b+1; i <= w; i++) { | ^ a.cc:37:16: error: 'h' was not declared in...
s407681242
p04046
C++
#include <iostream> #include <string> #define int long long using namespace std; const int MOD = 1e9+7; int pot(int x, int p) { if (p == 0) return 1; int z = pot(x, p/2); z = (z*z)%MOD; if (p%2) z = (z*x) % MOD; return z; } int inv(int x) { return pot(x, MOD-2); } int pows[20000 + 10]; int powsinv[20000 + 10]; int ...
a.cc: In function 'int main()': a.cc:36:14: error: 'b' was not declared in this scope 36 | for (int i = b+1; i <= w; i++) { | ^ a.cc:36:24: error: 'w' was not declared in this scope 36 | for (int i = b+1; i <= w; i++) { | ^ a.cc:37:16: error: 'h' was not declared in...
s363504018
p04046
C++
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0;i<n;i++) #define rep(i,n) for(int i=0;i<n;i++) #define INF INT_MAX/3 #define LINF LLONG_MAX/3 #define MP make_pair #define PB push_back #define EB emplace_back #define ALL(v) (v).begin(),(v).end() #define debug(x) cout<<#x<<":"<<x<<endl #define...
a.cc: In function 'void init()': a.cc:57:19: error: 'MAX_N' was not declared in this scope 57 | for(int i=1;i<MAX_N;i++) fact[i]=(fact[i-1]*i)%MOD; | ^~~~~ a.cc:58:19: error: 'MAX_N' was not declared in this scope 58 | for(int i=0;i<MAX_N;i++) fact_inv[i]=invp(fact[i],MOD); |...
s927875075
p04046
C++
#include<iostream> #include<string> #include<algorithm> using namespace std; #define mod 1e9+ 7 int main(){ int h, w, a, b; int dp[2][100000]; cin >> h >> w >> a >> b; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { if (i >= h - a && j >= w - b) break; else { dp[1][j] = dp[0][j]; if (j)...
a.cc: In function 'int main()': a.cc:19:33: error: expected primary-expression before '<' token 19 | for (int j = 0; < w; j++) { | ^
s979219426
p04046
C++
#include<iostream> #include<iomanip> #include<algorithm> #include<array> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #include<cstdio> #include<cstring> #include<functional> #include<limits> #include<list> #include<map> #include<numeric> #include<set> #include<stack> #include<string> #include<sst...
g++: internal compiler error: File size limit exceeded signal terminated program as Please submit a full bug report, with preprocessed source (by using -freport-bug). See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
s233366057
p04046
C++
#include <cstdio> #define mod 1000000007 using namespace std; int H, W, A, B, fact[222222], inv[222222], factinv[222222], z[222222], ret; inline int ncr(int xx, int yy) { if (xx < 0 || yy < 0 || xx < yy) return 0; return 1LL * fact[xx] * factinv[yy] % mod * factinv[xx - yy] % mod; } int main() { fact[0] = 1; for (i...
a.cc: In function 'int main()': a.cc:17:119: error: expected ')' before ';' token 17 | for (int i = 0; i < W - B; i++) ret = (ret + 1LL * ncr(A + i - 1, i) * ncr(W - i + H - A - 2, H - A - 1) % mod; | ~ ...
s666257462
p04047
Java
import java.util.Arrays; import java.util.Scanner; public class BBQ_Easy { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int k=sc.nextInt(), res=0; int[] s=new int[k*2]; for(int i=0; i<k*2; ++i) s[i]=sc.nextInt(); Arrays.sort(s); for(int i=k*2-1; i>=0; --i) if(i%2==0) re...
Main.java:4: error: class BBQ_Easy is public, should be declared in a file named BBQ_Easy.java public class BBQ_Easy { ^ 1 error
s932392466
p04047
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int a[2*n]; for(int i = 0; i < 2*n; ++i){ cin >> a[i]; } sort(a,a+2*n); int res = 0; for(int i = 0; i < 2*n; i += 2){ res += a[i] } cout << res << endl; }
a.cc: In function 'int main()': a.cc:14:16: error: expected ';' before '}' token 14 | res += a[i] | ^ | ; 15 | } | ~
s404279183
p04047
C++
#incldue <bits/stdc++.h> using namespace std; int main () { int n; cin >> n; vector <int> L(2*n); for (int i=0; i<L.size(); i++) cin >> L[i]; sort (L.begin(), L.end()); int res = 0; for (int i=0; i<L.size(); i+=2) { res += min (L[i], L[i+1]); } cout << res; }
a.cc:1:2: error: invalid preprocessing directive #incldue; did you mean #include? 1 | #incldue <bits/stdc++.h> | ^~~~~~~ | include a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> n; | ^~~ a.cc:1:1: note: 'std::cin' is defined i...
s209137770
p04047
C++
#include <iostream> #include <vector> using namespace std; int main() { int N; cin >> N; vector<int> L(2*N); for(int i = 0; i < 2 * N; i++){ cin >> L[i]; } sort(L.begin(),L.end()); int ans=0; for(int i = 0; i < 2 * N; i +=2){ ans+ = L[i]; } cout << ans << endl; }
a.cc: In function 'int main()': a.cc:12:3: error: 'sort' was not declared in this scope; did you mean 'short'? 12 | sort(L.begin(),L.end()); | ^~~~ | short a.cc:15:10: error: expected primary-expression before '=' token 15 | ans+ = L[i]; | ^
s750317498
p04047
Java
import java.util.*; public class Main{ public static void main(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0; int[] L=new int[n*2]; for(int i=0;i<L.length;i++){ L[i]=sc.nextInt(); } sort(L); for(int i=0;i<L.length;i+=2){ sum+=L[i]; } ...
Main.java:11: error: cannot find symbol sort(L); ^ symbol: method sort(int[]) location: class Main 1 error
s006519324
p04047
Java
import java.util.*; public class Main{ public static void main(){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0; int[] L=new int[n*2]; for(int i=0;i<L.length;i++){ L[i]=sc.nextInt(); } sort(L); for(int i=0;i<L.length;i+=2){ sum+=L[i]; } ...
Main.java:16: error: reached end of file while parsing } ^ 1 error
s633707604
p04047
C
import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) { // TODO Auto-generated method stub InputReader scn = new InputReader(System.in); OutputWriter out = new OutputWriter(System.out); int n = scn.nextInt(); int[] arr = new int[2 * n]; for (int i = 0; i < 2 * n;...
main.c:1:1: error: unknown type name 'import' 1 | import java.io.*; | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.io.*; | ^ main.c:2:1: error: unknown type name 'import' 2 | import java.util.*; | ^~~~~~ main.c:2:12...
s572566695
p04047
Java
import java.util.Arrays; import java.util.Scanner; public class Barbeque { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0; int arr[]=new int[2*n]; for(int i=0;i<2*n;i++) { arr[i]=sc.nextInt(); } Arrays.sort(arr); for(int j=0;j<2*n;j=...
Main.java:4: error: class Barbeque is public, should be declared in a file named Barbeque.java public class Barbeque { ^ 1 error
s735818609
p04047
Java
import java.util.Arrays; import java.util.Scanner; public class Barbeque { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int sum=0; int arr[]=new int[2*n]; for(int i=0;i<2*n;i++) { arr[i]=sc.nextInt(); } Arrays.sort(arr); for(int j=0;j<2*n;j=...
Main.java:4: error: class Barbeque is public, should be declared in a file named Barbeque.java public class Barbeque { ^ 1 error
s574265568
p04047
Java
import java.util.*; public class Traning { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt() * 2; int a[] = new int[n]; for (int i = 0; i < n; i++) { a[i] = in.nextInt(); } Arrays.sort(a); int sum...
Main.java:4: error: class Traning is public, should be declared in a file named Traning.java public class Traning { ^ 1 error
s182931600
p04047
C++
#include<iostream> using namespace std; #define int long long int int32_t main() { int n; cin>>n; int arr[2*n],j; for(j=0;j<2*n;j++) cin>>arr[j]; sort(arr,arr+2*n); int answer=0; for(j=0;j<2*n;j+=2) answer+=arr[j]; cout<<answer<<endl; }
a.cc: In function 'int32_t main()': a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(arr,arr+2*n); | ^~~~ | short
s404924929
p04047
C++
#include<bits/stdc.h++> #include<iostream> using namespace std; int main() { int N; cin>>N; vector<int> a(N*2); for(int i=0;i<N*2;i++) cin>>a[i]; sort(a.begin(),a.end()); long ans=0; for(int i=0;i<N;i++){ ans+= min(a[2*i],a[2*i+1]); } cout<<ans<<endl; }
a.cc:1:9: fatal error: bits/stdc.h++: No such file or directory 1 | #include<bits/stdc.h++> | ^~~~~~~~~~~~~~~ compilation terminated.
s375356833
p04047
C++
using namespace std; int main() { int N; cin>>N; vector<int> a(N*2); for(int i=0;i<N*2;i++) cin>>a[i]; sort(a.begin(),a.end()); long ans=0; for(int i=0;i<N;i++){ ans+= min(a[2*i],a[2*i+1]); } cout<<ans<<endl; }
a.cc: In function 'int main()': a.cc:6:1: error: 'cin' was not declared in this scope 6 | 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:7:1: error: 'vector' was ...