submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s901495601
p04013
C++
#include<iostream> using namespace std; typedef long long ll; const int N = 55; int n, A; int a[N]; ll mem[N][N][N * N]; ll dp(int i, int cnt, int sum) { if (i == n) { if (cnt == 0)return 0; if ((sum / cnt == A) && (sum % cnt == 0))return 1; return 0; } ll& ret = mem[i][cnt][sum]; cout << mem[i][cnt][s...
a.cc: In function 'int main()': a.cc:36:9: error: 'memset' was not declared in this scope 36 | memset(mem, -1, sizeof mem); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include<iostream> +++ |+#include <cs...
s466417738
p04013
C++
#include <bits/stdc++.h> using namespace std; void subsetsUtil(vector<int>& A, vector<vector<int> >& res, vector<int>& subset, int index) { res.push_back(subset); for (int i = index; i < A.size(); i++) { subset.push_back(A[i]); subsetsUtil(A, res, subset, i + 1); subset.pop_back(); } ...
a.cc: In function 'int main()': a.cc:49:38: error: expected primary-expression before '==' token 49 | if(sum/res[i].size())==a) cnt++; | ^~
s905067344
p04013
C++
#include <bits/stdc++.h> using namespace std; #define rep(i,N) for(int i=0,i##_max=(N);i<i##_max;++i) #define repp(i,l,r) for(int i=(l),i##_max=(r);i<i##_max;++i) #define per(i,N) for(int i=(N)-1;i>=0;--i) #define perr(i,l,r) for(int i=r-1,i##_min(l);i>=i##_min;--i) #define all(arr) (arr).begin(), (arr).end() #define S...
a.cc:67:2: error: 't' does not name a type; did you mean 'tm'? 67 | }t | ^ | tm
s802299079
p04013
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x)...
a.cc: In function 'int main()': a.cc:188:77: error: 's' was not declared in this scope 188 | else dp[i][j][k] = dp[i-1][j][k] + dp[i-1][j-1][s-x[i]]; | ^
s320894183
p04013
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x)...
a.cc: In function 'int main()': a.cc:183:20: error: no matching function for call to 'max(std::vector<int>&)' 183 | int X = max(x); | ~~~^~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s836984566
p04013
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x)...
a.cc: In function 'int main()': a.cc:183:20: error: no matching function for call to 'max(std::vector<int>&)' 183 | int X = max(x); | ~~~^~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s058699033
p04013
C++
#![allow(unused_mut)] #![allow(non_snake_case)] #![allow(unused_imports)] use std::collections::HashSet; use std::collections::HashMap; use std::collections::BTreeSet; use std::collections::VecDeque; use std::cmp::{max, min}; // https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 #[allow(unused_macros)] macro_rules! in...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #![allow(unused_mut)] | ^ a.cc:2:2: error: invalid preprocessing directive #! 2 | #![allow(non_snake_case)] | ^ a.cc:3:2: error: invalid preprocessing directive #! 3 | #![allow(unused_imports)] | ^ a.cc:10:2: error: invalid preproc...
s482297370
p04013
C++
typedef long long ll; int N, A; int x[50]; ll dp[51][51][3010]; //----------------------------------------------------------------- int main() { cin >> N >> A; rep(i, N) cin >> x[i]; dp[0][0][0] = 1; rep(i,N){ rep(j,N){ rep(k,2500){ if(dp[i][j][k]){ dp[i + 1][j][k] += dp[i]...
a.cc: In function 'int main()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> N >> A; | ^~~ a.cc:8:13: error: 'i' was not declared in this scope 8 | rep(i, N) cin >> x[i]; | ^ a.cc:8:9: error: 'rep' was not declared in this scope 8 | ...
s915410220
p04013
C++
87654 30
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 87654 | ^~~~~
s074311390
p04013
C++
einclude <algorithm> #include <bitset> #include <cmath> #include <functional> #include <iomanip> #include <iostream> #include <map> #include <numeric> #include <queue> #include <stack> #include <string> #include <utility> #include <vector> #define repd(i, a, b) for (ll i = (a); i < (b); i++) #define rep(i, n) repd(i, ...
a.cc:1:1: error: 'einclude' does not name a type 1 | einclude <algorithm> | ^~~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/bitset:49, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool _...
s146240879
p04013
C++
#include<bits/stdc++.h> using namespace std; int n,avg; vector<int> v; int main() { cin>>n>>avg; v.resize(n); for(int &i:v) cin>>i; vector<vector<long long int>> dp(n+1,vector<int>(2501)); dp[0][0]=1; for(int i=0;i<n;i++) { for(int j=i;j>=0;j--) { for(int k=0;k<=2500;k++) { if(dp[j][k]!=0...
a.cc: In function 'int main()': a.cc:11:56: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, std::vector<int>)' 11 | vector<vector<long long int>> dp(n+1,vector<int>(2501)); | ^ In file included from /usr/incl...
s399792984
p04013
C++
#include<bits/stdc++.h> using namespace std; #define FOR(i, a, b) for(int _b=(b),i=(a);i<=_b;++i) #define ROF(i, b, a) for(int _a=(a),i=(b);i>=_a;--i) #define REP(n) for(int _n=(n);_n--;) #define _1 first #define _2 second #define PB(x) push_back(x) #define SZ(x) int((x).size()) #define ALL(x) (x).begin(), (x).end() #d...
a.cc: In function 'int main()': a.cc:38:17: error: 'tot' was not declared in this scope 38 | tot += x[i]; | ^~~
s434225377
p04013
C++
#include<bits/stdc++.h> #include<math.h> using namespace std; int main(void){ int N,i,j,A,k; cin >> N >> A; int x[N]; for(i=0;i<N;i++){ cin >> x[i]; } bool dpbool[N+1][N+1][N*50+1]; long dp[N+1][N+1][N*50+1]; for(int i=0; i<N; i++) { for(int j=0; j<N1; j++) { for(int k=0; k<N*50+1; k++) { dp[i][j][k]...
a.cc: In function 'int main()': a.cc:14:32: error: 'N1' was not declared in this scope; did you mean 'N'? 14 | for(int j=0; j<N1; j++) { | ^~ | N
s440024945
p04013
C++
#include <bits/stdc++.h> #define pb push_back #define tam 310000 #define se second #define fi first #define forr(i,p,n) for(ll i=p;i<n;i++) using namespace std; typedef long long ll; const ll MOD=1e9+7; ll mult(ll a,ll b, ll p=MOD){return ((a%p)*(b%p))%p;} ll add(ll a, ll b, ll p=MOD){return (a%p + b%p)%p;} typedef pai...
a.cc: In function 'int main()': a.cc:51:46: error: conversion from 'std::unordered_map<int, long long int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, long long int>, std::allocator<std::pair<const int, long long int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__de...
s790707461
p04013
C++
#include <bits/stdc++.h> using namespace std; long long dp[60][60][2600]; int main() { long long N,A; cin >> N >> A; vector<long long> x(N+10); for(int i=1;i<=N;i++)cin >> x[i]; dp[0][0][0]=1; for(int i=1;i<=N;i++){ for(int j=1;j<=i;j++){ for(int k=1;k<=N*A;k++){ dp[i][j-1][k]=dp[i-1][j-...
a.cc: In function 'int main()': a.cc:27:23: error: expected '}' at end of input 27 | cout << cnt << endl; | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s910234877
p04013
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s116292147
p04013
C++
#define debug_interval ',' #define dump_interval ' ' #define debug_toggle 1 //{ #include<bits/stdc++.h> using namespace std; #define hi cerr<<"hi"<<endl; #define int long long #define INT_MAX LLONG_MAX #define rep(i,n) for(int i=0;i<(n);i++) #define rep1(i,n) for(int i=1;i<=(n);i++) #define pb push_back #define all(v) ...
a.cc:9:9: warning: "INT_MAX" redefined 9 | #define INT_MAX LLONG_MAX | ^~~~~~~ In file included from /usr/include/c++/14/climits:42, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:38, from a.cc:5: /usr/lib/gcc/x86_64-linux-gnu/14/include/limits.h:120:9: note:...
s660822560
p04013
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long long int llint; #define MM 1000000000 #define MOD MM+7 #define MAX 101000 #define MAP 110 #define initial_value -1 #define Pair pair<int,int> #define chmax(a,b) (a<b ? a=b:0) #define chmin(a,b) (a>b ? a=b:0) int dx[4] = {-1,0,1,0}; int dy[4...
a.cc: In function 'void dfs(int, int)': a.cc:23:21: error: 'i' was not declared in this scope 23 | dfs(num+1,sum+x[i]); | ^
s691216156
p04013
C++
#include <iostream> #include <vector> using namespace std; using ll = long long; int main() { int N, D; cin >> N >> D; vector<ll> A(N); for(int i = 0; i < N; i++) cin >> A[i]; vector<vector<vector<ll>>> dp(N + 1, vector<vector<ll>(N + 1, vector<ll>(2501))); dp[0][0][0] = 1; for(int i = 0; i < N; i++) { ...
a.cc: In function 'int main()': a.cc:11:81: error: no matching function for call to 'std::vector<long long int>::vector(int, std::vector<long long int>)' 11 | vector<vector<vector<ll>>> dp(N + 1, vector<vector<ll>(N + 1, vector<ll>(2501))); | ...
s455914095
p04013
C++
#include <iostream> #include <vector> using namespace std; int main() { long long N, D; cin >> N >> D; vector<long long> A(N); for(int i = 0; i < N; i++) { cin >> A[i]; A[i] -= D; } vector<map<long long, long long>> dp(N + 1); dp[0][0] = 1; for(int i = 0; i < N; i++) { for(auto e : dp[i]) ...
a.cc: In function 'int main()': a.cc:14:10: error: 'map' was not declared in this scope 14 | vector<map<long long, long long>> dp(N + 1); | ^~~ a.cc:3:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>' 2 | #include <vector> +++ |+#include <map...
s579229104
p04013
C++
#include <bits/stdc++.h> using namespace std; int main(){ int N,A; cin >> N >> A; vector<int> x(N); for(int i=0;i<N;i++)cin >> x[i]; for(int i=0;i<N;i++)x[i]-=A;
a.cc: In function 'int main()': a.cc:9:31: error: expected '}' at end of input 9 | for(int i=0;i<N;i++)x[i]-=A; | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s472633495
p04013
C++
#include <vector> #include <iostream> #include <cmath> #include <string> #include <cstring> #include <algorithm> #include <numeric> #include <climits> using namespace std; int main(){ ios::sync_with_stdio(false); long long n,a,c=0; cin >> n >> a; vector<long long>x(n); for(long long i=0;i<n;i++){ ...
a.cc: In function 'int main()': a.cc:20:22: error: 'max' cannot be used as a function 20 | long long max=max(x[n-1],a); | ~~~^~~~~~~~~~
s098635939
p04013
C++
cin >> n >> a; vector<int> x(n); rep(i, n) cin >> x[i]; dp[0][0][0] = 1; rep(i, n)rep(k, i+1)rep(j, 2501){ if(dp[i][k][j] > 0){ dp[i+1][k+1][j+x[i]] += dp[i][k][j]; dp[i+1][k][j] += dp[i][k][j]; } } LL ans = 0; rep1(i, n+1){ rep(j, 2501){ ...
a.cc:2:5: error: 'cin' does not name a type 2 | cin >> n >> a; | ^~~ a.cc:3:5: error: 'vector' does not name a type 3 | vector<int> x(n); | ^~~~~~ a.cc:4:8: error: expected constructor, destructor, or type conversion before '(' token 4 | rep(i, n) cin >> x[i]; | ...
s500219982
p04013
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #include<cstdio> using namespace std; long long dp[51][51][2500]; long long n, a, x[50]; int main() { cin >> n >> a; for (int i = 0; i < n; i++)cin >> x[i]; dp[0][0][0] = 1; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) {...
a.cc:35:11: error: redefinition of 'long long int dp [51][51][2500]' 35 | long long dp[51][51][2500]; long long n, a, x[50]; | ^~ a.cc:9:11: note: 'long long int dp [51][51][2500]' previously declared here 9 | long long dp[51][51][2500]; long long n, a, x[50]; | ^~ a.cc:35:39: err...
s621438465
p04013
C++
#include<bits/stdc++.h> #define MAX_N 100001 #define INF_INT 2147483647 #define INF_LL 9223372036854775807 #define REP(i,n) for(int i=0;i<(int)(n);i++) using namespace std; typedef long long int ll; typedef pair<ll,ll> P; void init(int n); int find(int n); void unite(int x,int y); bool same(int x, int y); ll bpow(ll,ll...
a.cc: In function 'int main()': a.cc:43:7: error: 'LL' was not declared in this scope; did you mean 'll'? 43 | for(LL j=1;A*j<=2599;j++) | ^~ | ll a.cc:43:16: error: 'j' was not declared in this scope 43 | for(LL j=1;A*j<=2599;j++) | ^
s877659001
p04013
C++
# encoding: utf-8 N, A = map(int, input().split()) x = list(map(int, input().split())) MAX_X = 50 x.sort() memo = [None] * (N * N * MAX_X * N) def get(pos, tmp, cnt): # print("#", pos, tmp, cnt) # end if pos == N: if cnt > 0 and cnt * A == tmp: # print("##", pos, tmp, cnt, "end\tret="...
a.cc:1:3: error: invalid preprocessing directive #encoding 1 | # encoding: utf-8 | ^~~~~~~~ a.cc:11:7: error: invalid preprocessing directive #print 11 | # print("#", pos, tmp, cnt) | ^~~~~ a.cc:12:7: error: invalid preprocessing directive #end; did you mean #endif? 12 | # end ...
s776127424
p04013
C++
#define _CRT_SECURE_NO_WARNINGS #include <limits.h> #include <math.h> #include <stdio.h> #include <iostream> #include <string> #include <vector> #include <deque> #include <set> #include <map> #include <algorithm> #include <bitset> #include <utility> #include <assert.h> using namespace std; typedef uint64_t uint; typed...
a.cc:17:9: error: 'uint64_t' does not name a type 17 | typedef uint64_t uint; | ^~~~~~~~ a.cc:15:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>' 14 | #include <assert.h> +++ |+#include <cstdint> 15 | using namespace std;
s022606089
p04013
C++
#include<bits/stdc++.h> using namespace std; int main(){ int dp[60][60][3000]; //i番目までの中からj個選んで総和になりうるか int N,A; cin>>N>>A; int x[N+1]; for(int i=0; i<N; i++){ cin>>x[i]; } dp[0][0][0]=1; for(int i=0; i<N; i++){ for(int j=0; j<=N; j++){ for(int k=0; k<=A*N; k++){ dp[i+1][jA+1][k+x[...
a.cc: In function 'int main()': a.cc:15:17: error: 'jA' was not declared in this scope; did you mean 'j'? 15 | dp[i+1][jA+1][k+x[i]]+=dp[i][j][k]; | ^~ | j
s831869847
p04013
C++
#include<iostream> #include<cstdio> #include<cstdlib> #define re register #define N 55 #define LL long long using namespace std; int n,A,a[N]; LL f[N][N][N*N],ans=0; int main(){ scanf("%d%d",&n,&A); for(re int i=1;i<=n;++i) scanf("%d",&a[i]); memset(f,0,sizeof(f)); f[0][0][0]=1ll; for(re int i=0;i<=n;++i){ for(re...
a.cc: In function 'int main()': a.cc:12:20: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 12 | for(re int i=1;i<=n;++i) scanf("%d",&a[i]); | ^ a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(f,0,sizeof(f)); f[0][0][...
s523155719
p04013
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(...
a.cc: In function 'int main()': a.cc:37:9: error: 'memset' was not declared in this scope 37 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cst...
s552779167
p04013
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(...
a.cc: In function 'int main()': a.cc:37:9: error: 'memset' was not declared in this scope 37 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cst...
s750690522
p04013
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(...
a.cc: In function 'int main()': a.cc:37:9: error: 'memset' was not declared in this scope 37 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cst...
s202847734
p04013
C++
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <vector> #include <iostream> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) typedef long long ll; typedef vector<long long> vll, vLL; bool check(const string& s,const string& t){ int n = s.size(...
a.cc: In function 'int main()': a.cc:35:9: error: 'memset' was not declared in this scope 35 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <functional> +++ |+#include <cst...
s198667228
p04013
C++
include <iostream> #include <vector> #include <string> #include <cmath> #include <set> #include <algorithm> #include <array> #include <complex> #include <utility> #include <map> #include <inttypes.h> int dx[4] = { -1,0,1,0 }; int dy[4] = { 0,1,0,-1 }; #define INF 1<<21 using pii = std::pair<int, int>; #define SORT(v) s...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu...
s612823647
p04013
C++
#include <bits/stdc++.h> using namespace std; int N,A,K,x[210000000]; int f[210000000],a[210000000]; int ans=0; void dfs(int dep) { if(dep==K+1) { int sum=0; for(int i=1;i<=K;i++) { sum+=x[a[i]]; } if(sum==K*A) { ans++; } } else { for(int i=1;i<=N;i++) { if(f[i]==0&&a[dep-1]<i) { ...
/tmp/ccP6qeX0.o: in function `dfs(int)': a.cc:(.text+0x80): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccP6qeX0.o a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccP6qeX0.o /tmp/ccP6qeX0.o: in functio...
s441572318
p04013
C++
#include<bits/stdc++.h> using namespace std; int n,a,k,x[17]; bool f[17]; int sum=0; void dfs(int dep) { if(dep==k+1) int ans=0; for(int i=1;i<=k;i++) { ans+=x[a[i]]; } if(ans==k*a) sum++; else { for(int j=i;j<=n;j++) { if(f[i]==0&&a[dep-1]<i) { a[dep]=i; f[i]=1; dfs(dep+1); f[i]=0;...
a.cc: In function 'void dfs(int)': a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 12 | ans+=x[a[i]]; | ^~~ | abs a.cc:12:25: error: invalid types 'int[int]' for array subscript 12 | ans+=x[a[i]]; | ...
s366108961
p04013
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()); #def...
a.cc: In function 'int main()': a.cc:18:17: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'std::vector<int>') 18 | REP(i, n) cin >> x[i]; | ~~~ ^~ ~~~~ | | | | | std::vector<int> | ...
s005463684
p04013
C++
// // Created by 童正阳 on 2018/9/14. // https://abc044.contest.atcoder.jp/tasks/arc060_a // 动态规划:dp[i][j]表示选i个数和为j的方法数 // 那么有:dp[i][j]=\sum{dp[i-1][j-a[k]], 1<=k<=N} // 最终结果为:\sum{dp[i][i*A]} // #include <iostream> using namespace std; typedef long long ll; int N, A, x[51], sum[51]; ll dp[51][2501]; int main() { cin ...
a.cc: In function 'int main()': a.cc:15:5: error: 'memset' was not declared in this scope 15 | memset(sum, 0, sizeof(sum)); | ^~~~~~ a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 8 | #include <iostream> +++ |+#include <cstring> ...
s510671866
p04013
C++
#include <iostream> using namespace std; int main(){ long long n,a; cin >> n >> a; long long x[n]; for (int i=0; i<n; i++){ cin >> x[i]; x[i]-=a; } if (n>=17){ long long dp[n][100*n+1]={{0,0}}; dp[0][x[0]+50*n]=1; dp[0][50*n]+=1; for (int i=1; i<n;...
a.cc: In function 'int main()': a.cc:38:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 38 | ans++; | ^~~ | abs a.cc:41:17: error: 'ans' was not declared in this scope; did you mean 'abs'? 41 | cout << ans <<endl; | ...
s884549868
p04013
Java
import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map.Entry; import java.util.Scanner; public class Abc044c2 { public static void main(String args[]) { @SuppressWarnings("resource") Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int a = scanne...
Main.java:7: error: class Abc044c2 is public, should be declared in a file named Abc044c2.java public class Abc044c2 { ^ 1 error
s685344354
p04013
C++
#include <iostream> #include <stdio.h> #include <string> #include <math.h> #include<algorithm> #include <numeric> using namespace std; int main(){ int N ,A; cin >> N >>A; int x[N]; for(int i=1;i<N+1;i++){ cin >> x[i]; } long long dp[51][2...
a.cc: In function 'int main()': a.cc:19:22: error: 'K' was not declared in this scope 19 | for(int j=0;j<K;j++){ | ^
s895677767
p04013
C++
from itertools import product N, A = map(int, input().split()) x = [int(xi) for xi in input().split()] x_max = max(max(x), A) dp = [[[0 for _ in range((N + 1) * x_max)] for _ in range(N + 1)] for _ in range(N + 1)] dp[0][0][0] = 1 for j, k, s in product(range(1, N + 1), range(N + ...
a.cc:1:1: error: 'from' does not name a type 1 | from itertools import product | ^~~~
s996846390
p04013
C++
#include <bits/stdc++.h> #include <assert.h> using namespace std; // 今,選んだ枚数,合計 long long dp[][51][2501]; int main() { int n, a, x[50]; cin >> n >> a; for (int i = 0; i < n; i++) cin >> x[i]; dp[0][0][0] = 1; dp[0][1][x[0]] = 1; for (int i = 1; i < n; i++) for (int j = 0; j < n + 1; j++) for (int k = 0;...
a.cc:7:11: error: storage size of 'dp' isn't known 7 | long long dp[][51][2501]; | ^~
s320371095
p04013
C++
#!/usr/bin/env python N, A = map(int, raw_input().split()) x = map(int, raw_input().split()) DP =[[0 for i in range(N * 50 + 1)] for j in range(N + 1)] DP[0][0] = 1 for i in range(N): for j in range(N, 0, -1): for k in range(x[i], N * 50 + 1): DP[j][k] += DP[j - 1][k - x[i]] ans = 0 for i in range(1, N + 1): ...
a.cc:1:2: error: invalid preprocessing directive #! 1 | #!/usr/bin/env python | ^ a.cc:2:1: error: 'N' does not name a type 2 | N, A = map(int, raw_input().split()) | ^
s333058005
p04013
C++
#include <iostream> #include <math.h> using namespace std; const int Nmax = 50; const int Amax = 50; const int Xmax = 50; long dp[Nmax+1][Nmax+1][Nmax*Xmax+1] = {}; long xarr[Xmax]; int main() { long N,A; cin >> N >> A; for (int i = 0; i < N; i++) cin >> xarr[i]; // end input long m = (long)max(A, *max_e...
a.cc: In function 'int main()': a.cc:20:26: error: 'max_element' was not declared in this scope 20 | long m = (long)max(A, *max_element(xarr, xarr+N)); | ^~~~~~~~~~~
s362048958
p04013
C++
#include <iostream> #include <math.h> using namespace std; const int Nmax = 50; const int Amax = 50; const int Xmax = 50; long dp[Nmax+1][Nmax+1][Nmax*Xmax+1] = {}; long xarr[Xmax]; int main() { long N,A; cin >> N >> A; for (int i = 0; i < N; i++) cin >> xarr[i]; // end input long m = (long)max(A, *max_e...
a.cc: In function 'int main()': a.cc:20:26: error: 'max_element' was not declared in this scope 20 | long m = (long)max(A, *max_element(xarr, xarr+N)); | ^~~~~~~~~~~
s156010952
p04013
C++
#include <stdio.h> #include <vector> #include <utility> #include <algorithm> #include <set> #include <iostream> using namespace std; #define Vi vector<int> #define ll long long #define Sort(a) sort(a.begin(),a.end()) #define rep(i,n) for(int i=0;i<n;++i) int main() { int n,a; cin>>n>>a; vector<ll>x(n); vec...
a.cc: In function 'int main()': a.cc:34:56: error: no match for 'operator*' (operand types are 'int' and 'std::vector<long long int>') 34 | if(t-y[j]<0||t-y[j]>2*n*x){ | ~~~^~ | ...
s479278860
p04013
C++
#include <stdio.h> #include <vector> #include <utility> #include <algorithm> #include <set> #include <iostream> using namespace std; #define Vi vector<int> #define ll long long #define Sort(a) sort(a.begin(),a.end()) #define rep(i,n) for(int i=0;i<n;++i) int main() { int N,a; cin>>N>>a; vector<ll>x(n); vec...
a.cc: In function 'int main()': a.cc:16:21: error: 'n' was not declared in this scope 16 | vector<ll>x(n); | ^ a.cc:34:56: error: no match for 'operator*' (operand types are 'int' and 'std::vector<long long int>') 34 | if(t-y[j]<0||t-y[j]>2*N*x)){ ...
s098426491
p04013
C++
#include <iostream> #include<cstdlib> #include<queue> #include<set> #include<vector> #include<stack> #include<map> #include<list> #include<string> #include<algorithm> #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 P pair<...
a.cc:17:12: error: '__int64' does not name a type; did you mean '__int64_t'? 17 | #define ll __int64 | ^~~~~~~ a.cc:23:1: note: in expansion of macro 'll' 23 | ll dp[51][5100]; | ^~ a.cc: In function 'int main()': a.cc:32:9: error: 'dp' was not declared in this scope; did you mean 'mp'? ...
s171311793
p04013
C++
#include <iostream> using namespace std; int main() { int n, a; cin >> n >> a; int x[60]; for (int i = 0; i < n; ++i) { cin >> x[i]; } long long dp[60][60][2510] = {0}; dp[0][0][0] = 1; for (int j = 0; j <= n; ++j) { for (int k = 0; k <= n; ++k) { for ...
a.cc: In function 'int main()': a.cc:24:21: error: 'd' was not declared in this scope 24 | d[j+1][k][s] = d[j][k][s] + d[j][k-1][s-x[j]]; | ^ a.cc:26:21: error: 'd' was not declared in this scope 26 | d[j+1][k][s] = d[j][k][s]; | ...
s141490515
p04013
C++
#include <bits/stdc++.h> #define P pair<int,int> using namespace std; const int INF = 1e9 + 7, MOD = 1e9 + 7; const long long LINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dp[60][60][2510]; int main() { int n, A; cin >> n >> A; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } dp...
a.cc: In function 'int main()': a.cc:29:30: error: 'j' was not declared in this scope 29 | ans += dp[n][j][j * A]; | ^
s915736695
p04013
C++
#include <bits/stdc++.h> #define P pair<int,int> using namespace std; const int INF = 1e9 + 7, MOD = 1e9 + 7; const long long LINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dp[60][60][2510]; int main() { int n, A; cin >> n >> A; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } dp...
a.cc: In function 'int main()': a.cc:20:49: error: invalid types 'int[int]' for array subscript 20 | a[i + 1][j][k] = a[i][j][k] + a[i][j - 1][k - a[j]]; | ^ a.cc:20:62: error: invalid types 'int[int]' for array subscript ...
s285691324
p04013
C++
#include <bits/stdc++.h> #define P pair<int,int> using namespace std; const int INF = 1e9 + 7, MOD = 1e9 + 7; const long long LINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dp[60][60][2510]; int main() { int n, A; cin >> n >> A; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } dp...
a.cc: In function 'int main()': a.cc:19:45: error: 'k' was not declared in this scope 19 | if (a[j] <= k && j >= 1) { | ^ a.cc:20:49: error: invalid types 'int[int]' for array subscript 20 | a...
s107460626
p04013
C++
#include <bits/stdc++.h> #define P pair<int,int> using namespace std; const int INF = 1e9 + 7, MOD = 1e9 + 7; const long long LINF = 1e18; const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1}; int dp[60][60][2510]; int main() { int n, a; cin >> n >> a; int a[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } dp...
a.cc: In function 'int main()': a.cc:11:13: error: conflicting declaration 'int a [n]' 11 | int a[n]; | ^ a.cc:9:16: note: previous declaration as 'int a' 9 | int n, a; | ^ a.cc:13:25: error: invalid types 'int[int]' for array subscript 13 | ...
s660107632
p04013
C++
#include<cstdio> #include<cstring> #include<vector> #include<queue> #include<stack> #include<algorithm> #include<cmath> #include<climits> #include<string> #include<set> #include<numeric> #include<map> #include<iostream> using namespace std; #define rep(i,n) for(int i = 0;i<((int)(n));i++) #define reg(i,a,b) for(int i =...
a.cc: In function 'int main()': a.cc:40:34: error: 'iterator' is not a member of 'mp' {aka 'std::pair<long long int, long long int>'} 40 | for (mp::iterator q=M.begin(); q!=M.end();++q) { | ^~~~~~~~ a.cc:40:56: error: 'q' was not declared in this scope ...
s523348397
p04013
C++
#include <iostream> #include <vector> #include <stdlib.h> using namespace std; int main() { int N, A; cin >> N >> A; cout << N << A << endl; int *ary = new int[N + 1]; for (int i = 1; i <= N; ++i) { cin >> ary[i]; } long memo[51][51][50 * 50 + 1]; memset(memo, 0, sizeof(me...
a.cc: In function 'int main()': a.cc:19:5: error: 'memset' was not declared in this scope 19 | memset(memo, 0, sizeof(memo)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <stdlib.h> +++ |+#include <cstring...
s088737705
p04013
C++
#include <iostream> #include <vector> #include <cstdlib> using namespace std; int main() { int N, A; cin >> N >> A; cout << N << A << endl; int *ary = new int[N + 1]; for (int i = 1; i <= N; ++i) { cin >> ary[i]; } long memo[51][51][50 * 50 + 1]; memset(memo, 0, sizeof(mem...
a.cc: In function 'int main()': a.cc:19:5: error: 'memset' was not declared in this scope 19 | memset(memo, 0, sizeof(memo)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <cstdlib> +++ |+#include <cstring>...
s659614000
p04013
C++
#include <iostream> #include <vector> using namespace std; int dp(int j, int k, int s, int[] X) { if (j == 0 && k == 0 && s == 0) { return 1; } else if (j >= 1 && s < X[j]) { return dp(j - 1, k, s); } else if (j >= 1 && s >= X[j]) { return dp(j - 1, k, s) + dp(j...
a.cc:6:35: error: expected ',' or '...' before 'X' 6 | int dp(int j, int k, int s, int[] X) | ^ a.cc: In function 'int dp(int, int, int, int*)': a.cc:12:28: error: 'X' was not declared in this scope 12 | else if (j >= 1 && s < X[j]) | ^...
s255210636
p04013
C++
#include "bits/stdc++.h" using namespace std; #define ll long long int #define rep(i,n) for( int i = 0; i < n; i++ ) #define rrep(i,n) for( int i = n; i >= 0; i-- ) #define REP(i,s,t) for( int i = s; i <= t; i++ ) #define RREP(i,s,t) for( int i = s; i >= t; i-- ) #define dump(x) cerr << #x << " = " << (x) << endl; #de...
a.cc: In function 'int main()': a.cc:12:13: error: 'long long long' is too long for GCC 12 | #define int long long int | ^~~~ a.cc:3:22: note: in expansion of macro 'int' 3 | #define ll long long int | ^~~ a.cc:37:5: note: in expansion of macro 'll' 37 | ll ans...
s652864179
p04013
C++
#include "bits/stdc++.h" using namespace std; #define ll long long int #define rep(i,n) for( int i = 0; i < n; i++ ) #define rrep(i,n) for( int i = n; i >= 0; i-- ) #define REP(i,s,t) for( int i = s; i <= t; i++ ) #define RREP(i,s,t) for( int i = s; i >= t; i-- ) #define dump(x) cerr << #x << " = " << (x) << endl; #de...
a.cc:12:23: error: '::main' must return 'int' 12 | #define int long long int | ^~~ a.cc:15:1: note: in expansion of macro 'int' 15 | int main(void) | ^~~ a.cc: In function 'int main()': a.cc:12:13: error: 'long long long' is too long for GCC 12 | #define int long long int ...
s082215673
p04013
C++
# include <iostream> # include <algorithm> # include <vector> # include <string> # include <set> # include <map> # include <cmath> # include <iomanip> # include <functional> # include <utility> # include <stack> # include <queue> # include <list> # include <tuple> # include <unordered_map> # include <numeric> # include...
a.cc:41:13: error: '::main' must return 'int' 41 | #define int LL | ^~ a.cc:46:1: note: in expansion of macro 'int' 46 | int main() { | ^~~
s824257769
p04013
C++
#include <stdio.h> #include <vector> int main(){ int N, A, tmp; int x[51]; scanf("%d %d", &N, &A); for(int i = 0; i < N; ++i){ scanf("%d", &tmp); x[i + 1] = tmp; } int X = std::max(*std::max_element(&x[1], &x[N]), A); long long int dp[N + 1][2 * N * X + 1]; for(int i ...
a.cc: In function 'int main()': a.cc:14:28: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'? 14 | int X = std::max(*std::max_element(&x[1], &x[N]), A); | ^~~~~~~~~~~ | tuple_element
s238196573
p04013
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <stack> #include <queue> #include <cctype> #define rep(i, m, n) for (int i = m; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define ll long long #define ull unsigned long long #define push(a) push_back(a) #define pop(a...
a.cc: In function 'int main()': a.cc:43:5: error: 'memset' was not declared in this scope 43 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <cctype> +++ |+#include <cstring> ...
s631342272
p04013
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <stack> #include <queue> #include <cctype> #define rep(i, m, n) for (int i = m; i < n; i++) #define repr(i, n) for (int i = n; i >= 0; i--) #define ll long long #define ull unsigned long long #define push(a) push_back(a) #define pop(a...
a.cc: In function 'long long int dfs(int, int, int)': a.cc:33:13: error: 'n' was not declared in this scope 33 | if (i==n){ | ^ a.cc:35:50: error: 'a' was not declared in this scope 35 | return (double)sum / cnt == (double)a; | ...
s342561670
p04013
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s857743091
p04013
C++
#include<fstream> #include<iostream> #include<cstdio> #include<cstdlib> #include<ctime> #include<string> #include<algorithm> #include<vector> #include<set> using namespace std; int m1=0,m2=0; int N,A,x[50],y[50],dp[1<<26]; vector<int> r[2][50]; long long res=0; int nb(int bits) { bits = (bits & 0x55555555) + (bits >...
a.cc: In function 'int main()': a.cc:50:9: error: 'memset' was not declared in this scope 50 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include<set> +++ |+#include <cstring> ...
s513904669
p04013
C++
#include <bits/stdc++.h> const long long INF = LLONG_MAX / 2; const long long MOD = 1000000007; const long double PI = 3.1415926; #define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) #define REP(i, n) FOR(i, (0), n) #define ALL(r) r.begin(), r.end() #define ll long long int using namespace std; vector<ll> v; vector...
a.cc: In function 'int main()': a.cc:61:54: error: no matching function for call to 'std::vector<long long int>::push_back()' 61 | div.push_back() | ~~~~~~~~~~~~~^~ In file included from /usr/include/c++/14/vector:66, ...
s000787677
p04013
C++
#include<bits/stdc++.h> using namespace std; #define ll long long ll dp[100][100][3100]; int main() { ll sum=0(ll); ll x,y,z; ll a[1000]; cin>>x>>z; for(int i=0;i<x;i++) { cin>>a[i]; } dp[0][0][0]=1(ll); for(int i=0;i<x;i++) { for(int j=0;j<=i;j++) { ...
a.cc: In function 'int main()': a.cc:3:12: error: expected primary-expression before 'long' 3 | #define ll long long | ^~~~ a.cc:7:14: note: in expansion of macro 'll' 7 | ll sum=0(ll); | ^~ a.cc:7:16: error: expression cannot be used as a function 7 | ll sum=0(ll...
s463173121
p04013
C++
long A,x[50],i,j,d[51][5001];main(n){for(scanf("%d%d",&n,&A);~scanf("%d",x+i);x[i++]-=A);d[0][A*=n]=1;for(i=-1;++i<n;)for(j=-1+x[i];j++<2*A+x[i];d[i+1][j]+=d[i][j])d[i+1][j]=d[i][j-x[i]];printf("%ld\n",d[n][A]-1);}
a.cc:1:34: error: expected constructor, destructor, or type conversion before '(' token 1 | long A,x[50],i,j,d[51][5001];main(n){for(scanf("%d%d",&n,&A);~scanf("%d",x+i);x[i++]-=A);d[0][A*=n]=1;for(i=-1;++i<n;)for(j=-1+x[i];j++<2*A+x[i];d[i+1][j]+=d[i][j])d[i+1][j]=d[i][j-x[i]];printf("%ld\n",d[n][A]-1);} | ...
s704496271
p04013
C++
/** * @Author Mehdi Maick * Created on 05/12/2016. */ import java.util.*; import java.io.*; import static java.lang.Math.*; public class Main { static int n; static int A; static int[] tab; static HashMap<String, Long> memo = new HashMap<>(); static long f(int i, long sum, int inset) { ...
a.cc:6:1: error: 'import' does not name a type 6 | import java.util.*; | ^~~~~~ a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:7:1: error: 'import' does not name a type 7 | import java.io.*; | ^~~~~~ a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:8:1: ...
s458590400
p04013
C++
#include<stdio.h> long long int n, c, d[50],f[51][51]; long long int as(long long int a, long long int b){ if(f[a][b]>0) return f[a][b]; if(a==n){ if(b==0){ return 1; } else return 0; } return f[a][b][e]=as(a+1,(b+d[a])%c)+as(a+1,b); } int main(){ scanf("%lld %lld",&n,&c); for(int i=0;i<n;i++) scanf("%ll...
a.cc: In function 'long long int as(long long int, long long int)': a.cc:11:24: error: 'e' was not declared in this scope 11 | return f[a][b][e]=as(a+1,(b+d[a])%c)+as(a+1,b); | ^ a.cc: In function 'int main()': a.cc:16:25: error: too many arguments to function 'long long int as(l...
s984855624
p04013
C++
#include<iostream> #include<vector> using namespace std; int memo[60][1000]; vector<int> X; long long solve(int i, long long j) { if (memo[i][j] != -1) return memo[i][j]; if (i == X.size()) return (j == 0); return memo[i][j] = (solve(i+1, j)+solve(i + 1, j + X[i])); } int main() { int n, a; cin >> n >> a; X...
a.cc: In function 'int main()': a.cc:22:9: error: 'memset' was not declared in this scope 22 | memset(*memo, -1, sizeof(memo)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<vector> +++ |+#include <...
s402544633
p04013
C++
#include <iostream> #include <array> #include <queue> #include <map> #include <list> #include <vector> #include <string> #include <limits> #include <cassert> #include <fstream> #include <cstring> #include <bitset> #include <iomanip> #include <algorithm> #include <functional> #include <cstdio> #include <ciso646> using ...
a.cc: In function 'int main()': a.cc:117:19: error: a function-definition is not allowed here before '{' token 117 | signed main(void) { | ^
s642089784
p04013
C++
//include //------------------------------------------ #include <vector> #include <list> #include <map> #include <set> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <...
a.cc: In function 'int main()': a.cc:101:8: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'int') 101 | cout >> ans >> endl; | ~~~~ ^~ ~~~ | | | | | int | std::ostream {aka std::basic_ostream<char>} a.cc:101:8: note...
s229767462
p04013
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <math.h> #include <algorithm> using namespace std; long long result; void comput(long long target, vector<int>& all, int level) { if (target == 0) { result++; return; } for (int a = level; a < all.size(); a++) { ...
a.cc:34:1: error: extended character   is not valid in an identifier 34 |   sort(all.begin(), all.end()); | ^ a.cc: In function 'int main()': a.cc:34:1: error: '\U000000a0' was not declared in this scope 34 |   sort(all.begin(), all.end()); | ^
s513693314
p04013
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <math.h> #include <algorithm> using namespace std; long long result; void comput(long long target, vector<int>& all, int level) { if (target == 0) { result++; return 0; } if (target < 0) { return; } for (int a = ...
a.cc: In function 'void comput(long long int, std::vector<int>&, int)': a.cc:15:24: error: return-statement with a value, in function returning 'void' [-fpermissive] 15 | return 0; | ^
s789150872
p04013
C++
#include <iostream> #include <string> #include <vector> #include <map> #include <math.h> #include <algorithm>   using namespace std;   long long result;   void comput(long long target, vector<int>& all, int level) { if (target == 0) { result++; } if (target < 0) { return; } for (int a = level; a < all.size(); ...
a.cc:7:1: error: extended character   is not valid in an identifier 7 |   | ^ a.cc:9:1: error: extended character   is not valid in an identifier 9 |   | ^ a.cc:11:1: error: extended character   is not valid in an identifier 11 |   | ^ a.cc:23:1: error: extended character   is not valid in ...
s807760070
p04013
C++
#include <iostream> #include <vector> #include <algorithm>   using namespace std;   long long result;   int main() { int N, A; cin >> N >> A; vector<int> all; for(int a = 0; a < N; a++) { int temp; cin >> temp; all.push_back(temp); }   sort(all);   for(int a = 1; a <= N; a++) { comput((lon...
a.cc:4:1: error: extended character   is not valid in an identifier 4 |   | ^ a.cc:6:1: error: extended character   is not valid in an identifier 6 |   | ^ a.cc:8:1: error: extended character   is not valid in an identifier 8 |   | ^ a.cc:18:1: error: extended character   is not valid in a...
s605653214
p04013
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; long long result; int main() { int N, A; cin >> N >> A; vector<long> all; for(int a = 0; a < N; a++) { long long temp; cin >> temp; all.push_back(temp); } sort(all); for(int a = 1; a <= N; a++) { comput(A*...
a.cc: In function 'int main()': a.cc:19:7: error: no matching function for call to 'sort(std::vector<long int>&)' 19 | sort(all); | ~~~~^~~~~ In file included from /usr/include/c++/14/algorithm:61, from a.cc:3: /usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _R...
s574714636
p04013
Java
import scala.collection.immutable.Range; import java.math.BigInteger; import java.util.Scanner; /** * Created by sonetsuyoshi on 2016/07/31. */ public class Main { static public void main(String[] args) { Scanner scanner = new Scanner(System.in); int N = scanner.nextInt(); int A = scan...
Main.java:2: error: package scala.collection.immutable does not exist import scala.collection.immutable.Range; ^ 1 error
s904102532
p04014
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int, int> ii; #define DEBUG freopen("in.txt", "r", stdin); struct fastio { fastio() { ios::sync_with_stdio(false); cout << setprecision(10) << fixed; cin.tie(0); } }; fastio _fast_io; ll n, s; bool c...
a.cc: In function 'int main()': a.cc:53:27: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>::__ostream_type' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 53 | cout << b << end; | ~~~~~~~~~~^~~~~~ In file included fro...
s775463546
p04014
C++
class Solution{ public: long long minbase(long long n, long long s){ if(s == 1ll) return n; long long b; for(b = 2ll; b * b <= n; b ++) if(sum(n, b) == s) return b; assert(b * b > n); if(s == n) return n + 1ll; // if(s > (b - 1) + (b - 1)) return -1; ...
a.cc: In member function 'long long int Solution::minbase(long long int, long long int)': a.cc:11:9: error: 'assert' was not declared in this scope 11 | assert(b * b > n); | ^~~~~~ a.cc:1:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'...
s233047529
p04014
C++
#include <iostream> #include <cstdio> using namespace std; class Solution{ public: long long minbase(long long n, long long s){ if(s == 1ll) return n; long long b; for(b = 2ll; b * b <= n; b ++) if(sum(n, b) == s) return b; assert(b * b > n); if(s > (b - 1)...
a.cc: In member function 'long long int Solution::minbase(long long int, long long int)': a.cc:17:9: error: 'assert' was not declared in this scope 17 | assert(b * b > n); | ^~~~~~ a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'...
s755306969
p04014
C++
#include <bits/stdc++.h> using namespace std; #define int long long #define ii pair<int,int> #define fi first #define sc second #define all(x) (x).begin(),(x).end() #include <conio.h> int f(int b, int n) { if (b > n) return n; return f(b, n / b) + n % b; } void solve() { int n, s; cin >> n >> s; for (in...
a.cc:12:10: fatal error: conio.h: No such file or directory 12 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s164985744
p04014
C++
//ヘッダー #include<bits/stdc++.h> using namespace std; //型定義 typedef long long ll; //定数 const int INF=1e+9; const int MOD=1e+9+7; //REPマクロ #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++) #define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--) // ...
a.cc: In function 'int main()': a.cc:57:26: error: no matching function for call to 'sqrt(ll&, int)' 57 | if(n>sqrt(b,2)) continue; | ~~~~^~~~~ In file included from /usr/include/c++/14/valarray:605, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:1...
s515682111
p04014
C++
//ヘッダー #include<bits/stdc++.h> using namespace std; //型定義 typedef long long ll; //定数 const int INF=1e+9; const int MOD=1e+9+7; //REPマクロ #define REP(i,n) for(ll i=0;i<(ll)(n);i++) #define REPD(i,n) for(ll i=n-1;i>=0;i--) #define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++) #define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--) // ...
a.cc: In function 'int main()': a.cc:55:22: error: 'p' was not declared in this scope 55 | if((n-s)%p==0){ | ^
s188629717
p04014
C++
#include <bits/stdc++.h> #define rep(i,n)for(long long i=0;i<(long long)(n);i++) #define all(a) a.begin(), a.end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll, ll> P; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } templa...
a.cc: In function 'int main()': a.cc:46:20: error: 'i' was not declared in this scope 46 | if(d%p==0 && d/i>0){ | ^
s516833592
p04014
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll f(ll b, ll n){ if (b == 1) return -1; else if (n < b) return n; else return f(b,n/b) + n % b; } ll ma(vector<ll> ANS){ if(ANS.size()==0) return -1; ll ans=1000000000000; for (ll i: ANS) ans=min(ans,i); return ans; } ll gcd(ll a, l...
a.cc: In function 'int main()': a.cc:34:33: error: no matching function for call to 'min(ll&, int)' 34 | if (f(i+1,n)==s) ans=min(ans,i+1); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits...
s849324015
p04014
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; #define MODSIZE 1000000007 ll f(ll b, ll n){ ll ans = 0; while(n > 0){ ans += n % b; n /= b; } return ans; } int main(){ ll n,s; scanf("%lld", &n); scanf("%lld", &s); ll i = 2; ...
a.cc: In function 'int main()': a.cc:38:9: error: 'f' cannot be used as a function 38 | if(f(i,n) == s){ | ~^~~~~ a.cc:45:6: error: redeclaration of 'll ans' 45 | ll ans = -1; | ^~~ a.cc:25:6: note: 'll ans' previously declared here 25 | ll ans; | ^~~ a.cc:50:19: erro...
s909559510
p04014
C++
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < n; ++i) using namespace std; typedef long long ll; #define MODSIZE 1000000007 int main(){ ll n,s; ll t; scanf("%lld", &n); scanf("%lld", &s); int i = 2; int f = 0; ll ans; if(s == n){ printf("%lld", n + 1); return 0; } int li...
a.cc: In function 'int main()': a.cc:49:7: error: redeclaration of 'int i' 49 | int i = 1; | ^ a.cc:14:7: note: 'int i' previously declared here 14 | int i = 2; | ^
s623942313
p04014
C++
#include<bits/stdc++.h> #define mod 1000000007 #define ll long long int #define ar array #define mp make_pair using namespace std; ll digitsum(ll n, ll b) { int y = log(n)/log(b) +1; ll ans = 0; for(int i = 0; i<y; i++) { ans += n%b; n /= b; } return ans; } int main() { ios::sync_with_stdio(false); cin.t...
a.cc: In function 'int main()': a.cc:47:25: error: 'y' was not declared in this scope 47 | y = digitsum(n+s,n/i+1); | ^
s229814419
p04014
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<utility> #include <functional> #include <set> #include <map> #include <queue> #include <math.h> #include <stack> using namespace std; int cou(long long int a,long long int b) { if (a > b) { return b; } else { return cou(a, b / a)...
a.cc: In function 'int main()': a.cc:38:36: error: expected primary-expression before ')' token 38 | if (cou(i, n) == s&) { | ^
s152090348
p04014
C++
// wakaran
/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
s681688226
p04014
C++
#include<bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++) #define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--) using namespace std; using ll = long long; using vl = vector<ll>; using vc = vector<char>; using vvl = vector<vl>; ...
a.cc: In function 'int main()': a.cc:45:18: error: 'b' was not declared in this scope 45 | if((n - s) % b != 0) continue; | ^
s367466815
p04014
C++
#include <bits/stdc++.h> using namespace std; long long f(long long b, long long n) { if (n < b) { return n; } else { return f(b, n/b) + n%b; } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long n, s; cin >> n >> s; if (n == s) { cout << n+1 << '\n'; return 0; ...
a.cc: In function 'int main()': a.cc:34:24: error: 'q' was not declared in this scope 34 | if ((n-q) % p != 0) { | ^
s668082583
p04014
C++
#include <bits/stdc++.h> using namespace std; long long f(long long b, long long n) { if (n < b) { return n; } else { return f(b, n/b) + n%b; } } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); long long n, s; cin >> n >> s; if (n == s) { cout << n+1 << '\n'; return 0; ...
a.cc: In function 'int main()': a.cc:35:69: error: 'b' was not declared in this scope 35 | if (q >= 0 && (n-q) % p == 0 && (n-q) / p >= 2 && p*b + q == n && f((n - q) / p, n) == s) { | ^
s644448475
p04014
C++
include <iostream> #include <string> #include <vector> #include <cmath> #include <queue> #include <map> #include <set> #include <stack> #include<algorithm> #include<sstream> #include<iomanip> #include<deque> #include<list> using namespace std; typedef long long ll; typedef pair<int, int> pii; const ll MOD_CONST = ...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ In file included from /usr/include/c++/14/bits/char_traits.h:42, from /usr/include/c++/14/string:42, from a.cc:2: /usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' does not name a typ...
s570812326
p04014
C++
#include <iostream> #include <algorithm> using namespace std; long long calc_sum(long long n, long long b) { if (n < b) return n; return calc_sum(n / b, b) + n % b; } int main() { long long n, s; cin >> n >> s; // 2≦b<sqrt(n) // sqrt(n)≦b≦n // b=n+1 long long ans = -1; long long sqrt_n = (long long)sqrt((...
a.cc: In function 'int main()': a.cc:21:39: error: 'sqrt' was not declared in this scope; did you mean 'sqrt_n'? 21 | long long sqrt_n = (long long)sqrt((double)n); | ^~~~ | sqrt_n
s806098506
p04014
C++
#include <iostream> #include <set> #include <queue> #include <vector> #include <algorithm> #include <cmath> #include <string> #include <cstring> #include <climits> #include <sstream> #include <iomanip> #include <map> #include <stack> #include <numeric> using namespace std; /*------------------------------------------...
a.cc: In function 'int main()': a.cc:99:26: error: expected primary-expression before '<<' token 99 | cout << << endl; | ^~ a.cc:101:40: error: 'i' was not declared in this scope 101 | cout << compExec(n, s, i + 1) << endl; | ...
s084657738
p04014
C
long n,s; f(long b) { long sum=0; long _n=n; while(_n) { sum+=_n%b; _n/=b; } return sum==s; } main() { scanf("%ld%ld",&n,&s); if(n==s) { printf("%ld\n",n+1); return 0; } for(long i=2;i*i<=n;i++) if(f(i)) { printf("%ld\n",i); return 0; } long minb=n+1; for(long i=1;i*i<=n;i++) { long ...
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | f(long b) | ^ main.c:13:1: error: return type defaults to 'int' [-Wimplicit-int] 13 | main() | ^~~~ main.c: In function 'main': main.c:15:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 15 | ...