submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s885728492 | p04014 | C | long n,s;
bool 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++)
{
... | main.c:2:1: error: unknown type name 'bool'
2 | bool f(long b)
| ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
+++ |+#include <stdbool.h>
1 | long n,s;
main.c:13:1: error: return type defaults to 'int' [-Wimplicit-int]
13 |... |
s278783088 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
ll const M = 1e11;
int main(){
ll n, s, b = 1e9;
scanf("%lld%lld", &n, &s);
for(ll i = 10; i<=M; i *= 10){
ll sm = 0, x = n;
while(x){
sm += (x % i);
x /= i;
... | a.cc: In function 'int main()':
a.cc:29:15: error: 'an' was not declared in this scope; did you mean 'n'?
29 | if(n == s)an = n+1;
| ^~
| n
|
s542947613 | p04014 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll f(ll b, ll n) {
if(n < b)return n;
return f(b,n/b) + n % b;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
ll n,s; cin >> n >> s;
ll sq = sqrt(n);
for(ll i = 2; i <= sq; i++) {
if(f(i,n) == s) {
cout << i << '... | a.cc: In function 'int main()':
a.cc:41:36: error: expected ';' before 'return'
41 | cout << x << '\n';s
| ^
| ;
42 | return 0;
| ~~~~~~
|
s660807424 | p04014 | C++ | #include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
#define ll long long
#define rn(i,n) for(int i=1;i<=n;i++)
#define N 1000;
#define INF 1000000007
ll f(ll b, ll n){
if(n<b)return n;
else return f(b,floor(n/b))... | a.cc: In function 'int main()':
a.cc:26:13: error: 'b' was not declared in this scope
26 | cout<<b<<endl;
| ^
|
s816100514 | p04014 | C++ | #include <cstdio>
#include <cmath>
#include <iostream>
typedef long long ll;
ll n, s;
ll f(ll b, ll n) { return n < b ? n : f(b, n / b) + n % b; }
int main() {
scanf("%lld%lld", &n, &s);
if (s > n) return puts("-1"), 0;
if (s == n) return printf("%lld\n", n + 1);
ll bl = sqrt(n) + 1;
for (ll i =... | a.cc: In function 'int main()':
a.cc:17:14: error: 'LONG_LONG_MAX' was not declared in this scope
17 | ll ans = LONG_LONG_MAX;
| ^~~~~~~~~~~~~
|
s319276947 | p04014 | C++ | #include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | a.cc: In function 'int main()':
a.cc:43:20: error: uninitialized 'const n' [-fpermissive]
43 | const lint n, s;
| ^
a.cc:43:23: error: uninitialized 'const s' [-fpermissive]
43 | const lint n, s;
| ^
a.cc:44:13: error: no match for 'operator>>' ... |
s083436207 | p04014 | C++ | #include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | a.cc: In function 'int main()':
a.cc:64:51: error: no match for call to '(main()::<lambda(lint&)>) (int&)'
64 | for (int i = 2; i < 320000; i++) if (check(i)) end(i);
| ~~~~~^~~
a.cc:46:22: note: candidate: 'main()::<lambda(lint&)>' (near match)
46 | ... |
s757061147 | p04014 | C++ | #include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | a.cc: In function 'int main()':
a.cc:67:26: error: no match for call to '(main()::<lambda(lint&&)>) (lint&)'
67 | if (check(b)) end(b);
| ~~~~~^~~
a.cc:46:22: note: candidate: 'main()::<lambda(lint&&)>' (near match)
46 | auto check = [&](lint &&b) {
| ... |
s811854171 | p04014 | C++ | #include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>
using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constex... | a.cc: In function 'int main()':
a.cc:61:23: error: no match for call to '(main()::<lambda(lint&)>) (int)'
61 | if (n < s) end(-1);
| ~~~^~~~
a.cc:56:20: note: candidate: 'main()::<lambda(lint&)>' (near match)
56 | auto end = [&](lint &b) {
| ^
a.cc... |
s351904153 | p04014 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
set<string> c;
const ll mod=1000000007;
const ll mod2=998244353;
const ll inf=100000000000000000;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){... | a.cc: In function 'int main()':
a.cc:32:29: error: expected ';' before ')' token
32 | tmp.push_back((n-s)/i+1));
| ^
| ;
|
s755037022 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i, a, b) for(ll i = (a); i < (b); ++i)
#define FORR(i, a, b) for(ll i = (a); i > (b); --i)
#define REP(i, n) for(ll i = 0; i < (n); ++i)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOREACH(x, a) for(auto &(x) : (a))
#define VECC... | a.cc:83:4: error: redefinition of 'll N'
83 | ll N,S;
| ^
a.cc:80:4: note: 'll N' previously declared here
80 | ll N;
| ^
|
s241716896 | p04014 | C++ | import sequtils,algorithm
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc getchar(): char {.header: "<stdio.h>", varargs.}
proc nextInt(): int = scanf("%lld",addr result)
proc nextFloat(): float = scanf("%lf",addr result)
proc nextString(): string =
var get = false
result = ""
while true:
... | a.cc:52:16: error: stray '#' in program
52 | elif T == 0: # n == s
| ^
a.cc:60:47: error: stray '#' in program
60 | if b < 100000000 and b * b <= n: continue # already listed
| ^
a.cc:1:1: error: 'import' does not name a type
1 | i... |
s731098144 | 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,floor(n/b))+(n%b);
}
long long n,s;
long long answ=9999999999999999999;
int main()
{
scanf("%lld %lld",&n,&s);
long long maxb=sqrt(n);
for(long long b=2; b<=maxb; b++)
if(f(b,n)==s)
{
p... | a.cc:11:16: warning: integer constant is so large that it is unsigned
11 | long long answ=9999999999999999999;
| ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:51:36: error: expected ';' before 'else'
51 | printf("%lld",answ)
| ... |
s760209717 | p04014 | C++ | #include <iostream>
using namespace std;
long long f(long long b, long long n) {
if (b < 2) return -1;
long long ans = 0;
while (n > 0) {
ans += n % b;
n /= b;
}
return ans;
}
int main() {
long long n, s;
cin >> n >> s;
if (s > n) return cout << "-1\n", 0;
if (n == s) return cout << n + 1 <<... | a.cc: In function 'int main()':
a.cc:28:15: error: redeclaration of 'long long int x'
28 | long long x = s / i;
| ^
a.cc:26:15: note: 'long long int x' previously declared here
26 | long long x = n / i;
| ^
a.cc:30:15: error: redeclaration of 'long long int x'
30... |
s583168117 | p04014 | C++ | #include<bits/stdc++.h>
using namespace std;
long long fb(long long b,long long n) {
if(n<b)return n;
return f(b,floor(n/b))+(n%b)
}
int main() {
long long n,s,a;
cin>>n>>s;
if(s>n) {
cout<<-1<<endl;
}
if(s==n) {
cout<<n+1<<endl;
}
for(int i=2; i<=sqrt(n)+1; i++) {
if(fb(i,n)==s) {
cout<<i<<endl;
r... | a.cc: In function 'long long int fb(long long int, long long int)':
a.cc:5:16: error: 'f' was not declared in this scope
5 | return f(b,floor(n/b))+(n%b)
| ^
a.cc:5:37: error: expected ';' before '}' token
5 | return f(b,floor(n/b))+(n%b)
| ... |
s070526612 | p04014 | C++ | #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#includ... | a.cc: In function 'int main()':
a.cc:365:28: error: expected ';' before 'q'
365 | b = (n-r)q;
| ^
| ;
a.cc:369:32: error: expected ')' before 'q'
369 | b = min((n-r)q,b);
| ~ ^
... |
s475782911 | p04014 | C++ | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
int f(long long n, long long b) {
long long sum = 0;
while (n > 0) {
sum += n % b;
n /= b;
}
return sum;
}
int main(int argc, char* argv[]) {
std::cin.tie(0);
std::ios... | a.cc: In function 'int main(int, char**)':
a.cc:47:27: error: 'b' was not declared in this scope
47 | std::printf("%lld\n", b);
| ^
|
s289030221 | p04014 | C++ | #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<unordered_map>
#include<math.h>
using namespace std;
typedef long long ll;
ll Decimal(ll b, ll n){
if(n == 0)return 0;
return Decimal(b, n / b) + n % b;
}
int main(){
ll n, s;
cin>>n>>s;
if(s == 1){
cout<<n<<endl;
return 0;
}
... | a.cc: In function 'int main()':
a.cc:32:36: error: 'p' was not declared in this scope
32 | ll b = (n - s)/(ll)p+1;
| ^
|
s084563280 | p04014 | Java | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long s = sc.nextLong();
long ans = Long.MAX_VALUE;
if(n==s){
System.out.println(n+1);
return;
}
long a=Math.sqrt(n);
for(long i = 2; i<=a; i++){
if(... | Main.java:12: error: incompatible types: possible lossy conversion from double to long
long a=Math.sqrt(n);
^
1 error
|
s496403888 | p04014 | C++ | #include "bits/stdc++.h"
#define int long long
using namespace std;
int f(int b, int n) {
if (n < b) {
return n;
} else {
return n % b + f(b, n / b);
}
}
void main()
{
int n, s;
cin >> n >> s;
if (n == s) {
cout << n + 1 << endl;
} else {
int minb = 99999999999999;
for (int i = 2; i <= sqrt(n); i++) ... | a.cc:13:1: error: '::main' must return 'int'
13 | void main()
| ^~~~
|
s842486781 | p04014 | Java | import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong();
long s = sc.nextLong();
if (s == n) {
System.out.println(n + 1);
return;
}
for (long i = 2; i * i <= n... | Main.java:26: error: cannot find symbol
ans = Math.min(min, b);
^
symbol: variable min
location: class Main
Main.java:34: error: cannot find symbol
System.out.println(min);
^
symbol: variable min
location: class Main
2 errors
|
s374310206 | p04014 | Java | n = int(input())
s = int(input())
d = 0
k = 1
while k*k <= n-s:
if (n-s)%k > 0:
k += 1
continue
l = (n-s)//k
if (l+1)*(l+1) > n:
b = l+1
if n//b + n%b == s:
d = b
b = k+1
a = 0
r = n
while r > 0:
a += r%b
r = r//b
if a == s:
print(b)
exit()
k += 1
if n == s:
pri... | Main.java:1: error: class, interface, enum, or record expected
n = int(input())
^
1 error
|
s314572827 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
long long m, s, ans = 1e12;
long long f(long long b, long long n){
if(b == 1) return 0;
if(n < b) return n;
else return f(b, n / b) + n % b;
}
int main(){
cin.tie(0), ios::sync_with_stdio(0);
cin >> m >> s;
if(m == s){
cout << m + 1;
... | a.cc: In function 'int main()':
a.cc:20:27: error: 'n' was not declared in this scope
20 | for(int i = 2; i*i <= n; i++){
| ^
a.cc:22:23: error: no matching function for call to 'min(long long int&, int&)'
22 | ans = min (ans,i);
| ~~~~^~~~~~... |
s463820390 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
long long m, s;
long long f(long long b, long long n){
if(n < b) return n;
else return f(b, n / b) + n % b;
}
int main(){
cin.tie(0), ios::sync_with_stdio(0);
cin >> m >> s;
for(int i = 2; i <= 1e6; i++){
if(f(i, m) == s){
cout <<... | a.cc: In function 'int main()':
a.cc:29:8: error: 'n' was not declared in this scope; did you mean 'yn'?
29 | if(n > s){
| ^
| yn
|
s832056229 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
long long m, s;
long long f(long long b, long long n){
if(n < b) return n;
else return f(b, n / b) + n % b;
}
int main(){
cin.tie(0), ios::sync_with_stdio(0);
cin >> m >> s;
for(int i = 2; i <= 1e6; i++){
if(f(i, m) == s){
cout <<... | a.cc: In function 'int main()':
a.cc:23:25: error: expected primary-expression before '==' token
23 | if(f(i, m)) == s){
| ^~
a.cc:27:29: error: expected primary-expression before '==' token
27 | if(f(s / i, m)) == s){
| ^~
|
s124333270 | p04014 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e9;
const int inf = 1e18;
const int MOD = 1e9 + 7;
int f(int b, int n){
if (n < b){
return n;
}
return f(b, n / b) + (n % b);
}
int main(){
int n, s, b;
cin >> n >> s;
if (n == s){
cout << n + 1;
return 0;
}
int ans = i... | cc1plus: error: '::main' must return 'int'
|
s836535343 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int LLI;
LLI n;
LLI s;
LLI f(LLI b, LLI n) {
if (b == 1) return -1;
if (n < b) return n;
return n%b + f(b, n/b);
}
int main() {
scanf("%lld%lld", &n, &s);
LLI low = -1;
LLI high = 1000000;
while (high - low > 1) {
LLI mid = (high+low... | a.cc: In function 'int main()':
a.cc:49:23: error: no matching function for call to 'max(int, LLI&)'
49 | ans = min(ans, max(2, n));
| ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s722408836 | p04014 | C++ | #include<iostream>
#include<algorithm>
#define LL long long
LL n, s;
int main() {
std::cin >> n >> s;
int q = std::sqrt(n);
if (n == s) {
std::cout << s + 1 << std::endl;
return 0;
}
for (LL i = 2; i <= q; i++) {
LL copy = n;
LL sum = 0;
while (copy) {
sum += copy % i;
copy /= i;
}
if (s == sum... | a.cc: In function 'int main()':
a.cc:7:22: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
7 | int q = std::sqrt(n);
| ^~~~
| sort
|
s503448431 | p04014 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#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 P pair<int,int>
#define ll __int64
#define... | a.cc:17:9: warning: "ll" redefined
17 | #define ll long long
| ^~
a.cc:16:9: note: this is the location of the previous definition
16 | #define ll __int64
| ^~
a.cc: In function 'int main()':
a.cc:33:23: error: 'sqrt' was not declared in this scope
33 | for(ll i=2;i<=sqrt(n)... |
s921277280 | p04014 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#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 P pair<int,int>
#define ll __int64
//#defi... | a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:18:7: note: in expansion of macro 'll'
18 | const ll INF=10000000000000;
| ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #defin... |
s808494125 | p04014 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#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 P pair<int,int>
#define ll __int64
//#defi... | a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:19:1: note: in expansion of macro 'll'
19 | ll n,s;
| ^~
a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ... |
s297805592 | p04014 | 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 REP(i,s,t) for( int i = s; i <= t; i++ )
#define dump(x) cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long ... | a.cc: In function 'int main()':
a.cc:54:20: error: no matching function for call to 'min(long long int, int)'
54 | int b = min((n-s)/(i+1)-2,2);
| ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits... |
s198904535 | p04014 | C++ | #include <algorithm>
#include <complex>
#include <iostream>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using std::cin;
using std::cout;
using std::endl;
using std::cerr;
using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::s... | a.cc: In function 'll solve(ll, ll)':
a.cc:53:13: error: lvalue required as left operand of assignment
53 | if(f(b, n) = s){
| ~^~~~~~
|
s960189627 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define... | cc1plus: error: '::main' must return 'int'
|
s966284345 | p04014 | C++ | #include <cstdio>
#include <cmath>
#include <vector>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define ALL(v) (v.begin()), (v.end())
typedef long long ll;
//---------------------------------------------------------------------------... | a.cc: In function 'll find()':
a.cc:49:3: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
49 | sort(ALL(divs));
| ^~~~
| sqrt
|
s475030257 | p04014 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll f(ll b,ll n){
if(n<b) return n;
else return f(b,n/b)+n%b;
}
ll solve(ll n,ll s){
if(n==s)return n+1;
if(n<s)return -1;
ll b=2;
for(;b*b<=n;b++){
if(f(b,n)==s)return i;
}
for(;b>0;i--){
if((n-s)%i==0 && f((n-s)/b+1,n)==s){
return (... | a.cc: In function 'll solve(ll, ll)':
a.cc:16:37: error: 'i' was not declared in this scope
16 | if(f(b,n)==s)return i;
| ^
a.cc:19:18: error: 'i' was not declared in this scope
19 | for(;b>0;i--){
| ^
|
s332844541 | p04014 | C++ | #include<stdio.h>
int ds(int n, int b){
int s=0;
while(n>0){
s=s+n%b;
n=n/b;
}
return s;
}
int main(){
int n,s,i;
scanf("%d %d",&n, &s);
if(n-s<0) printf("-1");
if(n-s==0) printf("%d",n+1);
for(i=2;i*i<=n;i++){
if(ds(n,i)==s){
printf("%d",i);
return 0;
}
}
for(;--i;){
b=(n-s)/i+1;
if(b<2)... | a.cc: In function 'int main()':
a.cc:23:17: error: 'b' was not declared in this scope
23 | b=(n-s)/i+1;
| ^
a.cc:25:20: error: 'f' was not declared in this scope
25 | if(f(b,n)==s){
| ^
|
s161545105 | p04014 | C++ | #include <iostream>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
ll n, s;
ll ds(ll n, int b){
ll s = 0;
while(n){
s += n % b;
n /= b;
}
return s;
}
int main(){
cin >> n >> s;
ll d = n - s;
if(d <= 0){
cout << (d == 0 ? n + 1 : -1) << e... | a.cc: In function 'int main()':
a.cc:36:56: error: no matching function for call to 'max(int&, ll)'
36 | if(d % i == 0 && s >= i && d / i >= max(i, s - i)){
| ~~~^~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
... |
s088056840 | p04014 | C++ | #include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
using namespace std;
ll N,S;
ll f(ll b,ll n){
if(n<b) return n;
return f(b,n/b)+n%b;
}
void solve(){
if(S>N){
printf("-1\n");return;
}
if(N==S){
printf("%lld\n",N+1);
return;
}
ll i=0;
for (i ... | a.cc: In function 'void solve()':
a.cc:31:21: error: 'n' was not declared in this scope
31 | ll b = (n-s)/p + 1;
| ^
a.cc:31:23: error: 's' was not declared in this scope
31 | ll b = (n-s)/p + 1;
| ^
|
s293537837 | p04014 | C++ | #include<bits/stdc++.h>
using namespace std;long long n,s,sum,g,i,A,B,C;main(){cin>>n>>s;if(n==s){cout<<n+1<<endl;goto F;}for(i=2;i<=min(n+1,3000000LL);i++){sum=0;g=1;while(g<=1LL<<37){sum+=(n/g)%i;g*=i;}if(sum==s){cout<<i<<endl;goto E;}}for(i=min(s,n/1000000);i>=1;i--){A=i,B=s-i;if((n-B)%A!=0)continue;C=(n-B)/A;if(C<=... | a.cc:2:49: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | using namespace std;long long n,s,sum,g,i,A,B,C;main(){cin>>n>>s;if(n==s){cout<<n+1<<endl;goto F;}for(i=2;i<=min(n+1,3000000LL);i++){sum=0;g=1;while(g<=1LL<<37){sum+=(n/g)%i;g*=i;}if(sum==s){cout<<i<<endl;goto E;}}for(i=min(s... |
s191797257 | p04014 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <string>
#include <climits>
using namespace std;
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP... | a.cc: In function 'll func(ll, ll)':
a.cc:39:12: error: 'dp' was not declared in this scope; did you mean 'p'?
39 | return dp[b]=func(b,floor(n/b))+(n%b);
| ^~
| p
|
s877307124 | p04015 | C++ | #include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define perl(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define pb push_back
#define ... | a.cc:2:9: fatal error: atcoder/all: No such file or directory
2 | #include<atcoder/all>
| ^~~~~~~~~~~~~
compilation terminated.
|
s037787109 | p04015 | C++ | //g++ main.cpp -I /usr/local/include/ac-library
//#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
//using namespace atcoder;
stack<int> st;
queue<int> qu;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#d... | a.cc: In function 'int main()':
a.cc:23:10: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'int')
23 | x[0]=0;
| ^
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64,
from /usr/include/x86_64-linu... |
s745633735 | p04015 | C++ | //g++ main.cpp -I /usr/local/include/ac-library
#include<cmath>
//#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
//using namespace atcoder;
stack<int> st;
queue<int> qu;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(... | a.cc: In function 'int main()':
a.cc:49:20: error: no match for 'operator*' (operand types are 'int' and 'std::vector<int>')
49 | rep(s,n*x+1){
| ~^~
| | |
| | std::vector<int>
| int
a.cc:11:39: note: in defin... |
s286682752 | p04015 | C++ | а | a.cc:1:1: error: '\U00000430' does not name a type
1 | а
| ^
|
s636805343 | p04015 | C++ | ///#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define all(x) (x).begin(), (x).end()
#define finout(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
#define X first
#define Y second
using namespace std;
const int MOD = 1e9 + 7;
typedef pair <int, int> pii;
typedef vector <i... | a.cc: In function 'int main()':
a.cc:42:14: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
42 | inline int ni() {int x; cin >> x; return x;}
| ^~
a.cc:42:14: note: remove parentheses to default-initialize a variable
42 | inline int ni() {int x; cin >> x... |
s738651221 | p04015 | C++ | ///#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define all(x) (x).begin(), (x).end()
#define finout(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
#define X first
#define Y second
using namespace std;
const int MOD = 1e9 + 7;
typedef pair <int, int> pii;
typedef vector <i... | a.cc: In function 'int main()':
a.cc:42:14: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
42 | inline int ni() {int x; cin >> x; return x;}
| ^~
a.cc:42:14: note: remove parentheses to default-initialize a variable
42 | inline int ni() {int x; cin >> x... |
s568176013 | p04015 | C++ | ///#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define all(x) (x).begin(), (x).end()
#define finout(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
#define X first
#define Y second
using namespace std;
const int MOD = 1e9 + 7;
typedef pair <int, int> pii;
typedef vector <i... | a.cc: In function 'int main()':
a.cc:42:14: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
42 | inline int ni() {int x; cin >> x; return x;}
| ^~
a.cc:42:14: note: remove parentheses to default-initialize a variable
42 | inline int ni() {int x; cin >> x... |
s758552578 | p04015 | C++ | # include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
... | a.cc: In function 'void solve()':
a.cc:111:30: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::pair<int, int>; _Tp = int; _Hash = std::hash<std::pair<int, int> >; _Pred = std::equal_to<std::pair<int, int> >; _Alloc = std::allocator<std::pair<const s... |
s658778707 | p04015 | Java | import java.io.*;
import java.util.*;
import java.util.Map.Entry;
import static java.lang.Math.min;
/**
* Created by Katushka on 11.03.2020.
*/
public class C {
public static final Comparator<int[]> COMPARATOR = Comparator.comparingInt(o -> o[0]);
static int[] readArray(int size, InputReader in) {
... | Main.java:11: error: class C is public, should be declared in a file named C.java
public class C {
^
1 error
|
s113486198 | p04015 | 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];
X[i] -= A;
}
vector<int>pl;
vector<int>mn;
long long zr = 1;
for (int i = 0; i < N; i ++) {
if (!(X[i])) zr *= 2;
if (X[i] > 0) pl.push_back(... | a.cc: In function 'int main()':
a.cc:23:17: error: 'de' was not declared in this scope; did you mean 'dp'?
23 | int si = (int)de.size();
| ^~
| dp
a.cc:24:18: error: 'de_' was not declared in this scope; did you mean 'dp_'?
24 | int si_ = (int)de_.size();
| ... |
s692854550 | p04015 | C++ | #define _USE_MATH_DEFINES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <ioman... | a.cc: In instantiation of 'bool chmax(T&, const S&) [with T = int; S = std::vector<int>]':
a.cc:65:14: required from here
65 | chmax(mx, x);
| ~~~~~^~~~~~~
a.cc:42:10: error: no match for 'operator<' (operand types are 'int' and 'const std::vector<int>')
42 | if(a < b){
| ... |
s337025893 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
ll N,A,i,j,k;cin>>N>>A;ll X[N],DP[N+1][4901];
REP(i,N){cin>>X[i];X[i]-=A;}
... | a.cc: In function 'int main()':
a.cc:14:32: error: invalid types 'll {aka long long int}[ll {aka long long int}]' for array subscript
14 | FOR(i,1,N+1)REP(j,2450)if(j-A[i-1]>=0&&j-A[i-1]<=4900)DP[i][j]=DP[i][j-A[i-1]]+1;
| ^
a.cc:14:45: error: invalid types 'll {aka long long i... |
s469609354 | p04015 | 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=1;i<=n;i++)
typedef long long ll
//部分点解法
int main(){
int n,a;
cin >> n >> a;
vector<int> x(n);
rep(i,n){
cin >> x[i];
}
ll ans = 0;
rep(bit, 1<<n){
if(bit == 0) continue;
ll sum = 0;
ll coun... | a.cc:9:1: error: expected initializer before 'int'
9 | int main(){
| ^~~
|
s378178528 | p04015 | C++ | afae | a.cc:1:1: error: 'afae' does not name a type
1 | afae
| ^~~~
|
s079296192 | p04015 | Java |
import lib.FastScanner;
public class Main {
public static void main(String[] args) {
FastScanner fsc = new FastScanner();
int n = fsc.nextInt();
int a = fsc.nextInt();
int[] x = new int[n];
for (int i = 0; i < n; i++) {
x[i] = fsc.nextInt() - a;
}
... | Main.java:2: error: package lib does not exist
import lib.FastScanner;
^
Main.java:6: error: cannot find symbol
FastScanner fsc = new FastScanner();
^
symbol: class FastScanner
location: class Main
Main.java:6: error: cannot find symbol
FastScanner fsc = new FastScanner();
... |
s031001410 | p04015 | C++ | fun main(args: Array<String>) {
val (n, a) = readLine()!!.split(" ").map(String::toInt)
var dp = Array(n+1, {Array(a*n+1, {0.toLong()})})
var dp_copy = Array(n+1, {Array(a*n+1, {0.toLong()})})
val x = readLine()!!.split(" ").map(String::toInt)
dp[0][0] = 1.toLong()
dp_copy[0][0] = 1.toLong()
... | a.cc:8:14: error: too many decimal points in number
8 | for(i in 1..n){
| ^~~~
a.cc:9:18: error: too many decimal points in number
9 | for(j in 0..n-1){
| ^~~~
a.cc:10:22: error: too many decimal points in number
10 | for(k in 0..n*a-x[i-1]){
... |
s852732026 | p04015 | C++ | #include <string>
#include <map>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define Rep(i, sta, n) for (int i = sta; i < n; ++i)
using namespace std;
typedef long long ll;
const int mod = 1000000007;
ll dp[55][55][2555];
int main() {
int N, A;
cin >> N >> A;
vector<int> x(N);
rep(i, N) cin >> x... | a.cc: In function 'int main()':
a.cc:15:5: error: 'cin' was not declared in this scope
15 | cin >> N >> A;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <map>
+++ |+#include <iostream>
3 |
a.cc:16:5: ... |
s428532527 | p04015 | C++ | #define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep1(i,n) for(ll i=1;i<=(n);i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
int main(){
//input
ll N,A; cin>>N>>A;
vector<ll> X(N+1);
rep1(i,N) cin>>X[i];
ll dp[51][51][2501]; //dp[x][y][z]:x番目までy個選び和を... | a.cc: In function 'int main()':
a.cc:10:9: error: 'll' was not declared in this scope; did you mean 'all'?
10 | ll N,A; cin>>N>>A;
| ^~
| all
a.cc:10:17: error: 'cin' was not declared in this scope
10 | ll N,A; cin>>N>>A;
| ^~~
a.cc:10:22: error: '... |
s304267060 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, m, n) for (int i = m; i < n; ++i)
int main() {
int N, A;
cin >> N >> A;
vector<int> x(N);
rep(i, 0, N) cin >> x[i], x[i] -= A;
vector<vector<long long>> dp(N + 1, vector<long long>(5555));
int g = 2500;
dp[0][g] = 1;
rep(i, 0,... | a.cc:20:1: error: 'a' does not name a type
20 | a
| ^
|
s881241251 | p04015 | C++ | #include<iostream>
using namespace std;
long dp[55][55][600];
main(){
int n,v;
cin>>n>>v;
ll x[n];
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<i;++j){
for(int k=0;k<550;++k){
dp[i+1][j][k]+=dp[i][j][k];
dp[i+1][j+1][k+x[i]]+=dp[i][j][k];
... | a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'll' was not declared in this scope
7 | ll x[n];
| ^~
a.cc:8:28: error: 'x' was not declared in this scope
8 | for(int i=0;i<n;++i)cin>>... |
s461069482 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
long long n,k,a[555];
map<long long,long long> f[555][2555];
int main()
{
cin >> n >> k;
for(int i=1; i<=n; i++)
{
cin >> a[i];
a[i]-=k;
}
for(int i=1; i<=n; i++)
{
long long v=a[i];
for(int j=-1000; j<=1000; j++)
... | a.cc: In function 'int main()':
a.cc:19:20: error: no match for 'operator+=' (operand types are 'std::map<long long int, long long int>' and 'std::map<long long int, long long int>')
19 | f[i][j]+=f[i-1][j-v];
| ~~~~~~~^~~~~~~~~~~~~
a.cc:21:20: error: no match for 'operator+=' (operand ... |
s232692297 | p04015 | C++ | #include <bits/stdc++.h>
#define reps(i,a,b) for(long long int i=a;i<b;i++)
#define rep(i,a) for(long long int i=0;i<a;i++)
typedef long long int ll;
using namespace std;
ll MOD = 1000000007;
ll dp[55][55][200000];
int N,A;
int x[50];
const int MAX = 510000;
struct aaa{
aaa(){
cin.tie(0); ios::sync_with_s... | /tmp/cc66Mgtk.o: in function `dpp(int, int, int)':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0x1e): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/cc66Mgtk.o
a.cc:(.text+0xd0): re... |
s314070772 | p04015 | C++ | s | a.cc:1:1: error: 's' does not name a type
1 | s
| ^
|
s444392492 | p04015 | C++ | s | a.cc:1:1: error: 's' does not name a type
1 | s
| ^
|
s298236543 | p04015 | C++ | #include<bits/stdc++.h>
#define ll long long
#define inf 0x3f3f3f3f3f3f3f3fLL
#define rep(i,a,b) for(register ll i=(a);i<=(b);i++)
#define dep(i,a,b) for(register ll i=(a);i>=(b);i--)
using namespace std;
const int maxn=50+5;
const int maxm=5000+5;
//const double pi=acos(-1.0);
//const double eps=1e-9;
const ll mo=1e9+... | a.cc: In function 'int main()':
a.cc:33:13: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
33 | rep(i,1,n)
| ^
a.cc:4:36: note: in definition of macro 'rep'
4 | #define rep(i,a,b) for(register ll i=(a);i<=(b);i++)
| ... |
s418393150 | p04015 | C | #include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint LINF = 1e18;
lint digit_sum(lint n, lint b) {
lint res = 0;
while (n > 0) {
res += n % b;
n /= b;
}
return res;
}
int main() {
lint n, s;
cin >> n >> s;
lint ans;
if (n == s) {
... | main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s018977517 | p04015 | C++ | hard | a.cc:1:1: error: 'hard' does not name a type
1 | hard
| ^~~~
|
s272455932 | p04015 | 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() {
| ^
|
s689733413 | p04015 | Java | public class Main {
public static void main(String[] args) {
Scanner keyboard = new Scanner(System.in);
int N = keyboard.nextInt();
int A = keyboard.nextInt();
int[] in = new int[N];
for(int i=0; i < N; i++) {
in[i] = keyboard.nextInt();
}
for (int i = 0; i < N; i++) {
in[i] -= A;
}
... | Main.java:4: error: cannot find symbol
Scanner keyboard = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:4: error: cannot find symbol
Scanner keyboard = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s825756887 | p04015 | C++ | #include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n))
#define Vec(a,n) vector<string> (a)((n))
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0))
#define Twovec(a,n,m) vector<v... | a.cc:18:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
18 | void Debug(auto a);
| ^~~~
a.cc: In function 'int main()':
a.cc:71:19: error: invalid types 'long long int[long long int]' for array subscript
71 | ans_t += a[i]*b[i];
|... |
s562348502 | p04015 | C++ | #include <iostream>
#include <stdio.h>
#define maxn 51
#define maxsum 5000
using namespace std;
int N, A;
// dp[i][j][k] = j carti din primele i carti care dau suma k
// dp[1][0][0] = 1
// dp[i][j][k] = dp[i - 1][j][k] + dp[i - 1][j - 1][k - v[i]]
long long dp[maxn][maxn][maxsum];
int v[maxn];
int main()
{
int min... | a.cc: In function 'int main()':
a.cc:39:2: error: expected '}' at end of input
39 | }
| ^
a.cc:14:1: note: to match this '{'
14 | {
| ^
|
s292401590 | p04015 | C++ | #include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
//using
using VI = vector<int>;
using VVI = vector<VI>;
using VS = vector<string>;
usin... | a.cc: In function 'int main()':
a.cc:45:12: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::set<int>; _Alloc = std::allocator<std::set<int> >; reference = std::set<int>&; size_type = long unsigned int]', declared with attribute 'nod... |
s064836531 | p04015 | C++ | //#include<stdio.h>
//#include<stdlib.h>
//#include<string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=55;
int main()
{
int n;
int a;
//for(auto &a:b)
//存在n*n种组合方法,求解满足条件的方法,遍历?
cin>>n>>a;
int b[N][N*N]={0};
int p;
ll cnt=0;//计算方法数
b[0][0... | a.cc: In function 'int main()':
a.cc:14:13: error: 'a\U0000ff1b' was not declared in this scope
14 | cin>>n>>a;
| ^~~
a.cc:18:9: error: 'b' was not declared in this scope
18 | b[0][0]=1;
| ^
|
s819053508 | p04015 | C++ | //#include<stdio.h>
//#include<stdlib.h>
//#include<string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=60;
int main()
{
int n;
int a;
//for(auto &a:b)
//存在n*n种组合方法,求解满足条件的方法,遍历?
cin>>n>>a;
int b[N][N*N]={0};
int p;
ll cnt=0;//计算方法数
b[0][0... | a.cc: In function 'int main()':
a.cc:14:13: error: 'a\U0000ff1b' was not declared in this scope
14 | cin>>n>>a;
| ^~~
a.cc:18:9: error: 'b' was not declared in this scope
18 | b[0][0]=1;
| ^
|
s549225635 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
LL dp[51][51][2501];
int main()
{
//freopen("In.txt" , "r" , stdin);
int N , A;
cin >> N >> A;
vector<int> a(N);
for(auto &x : a)
cin >> x;
dp[0][0][0] = 1;
for(int i = 0; i < N; i++)
{
for(int picked = 0; picked <= 50; picked++)
{
for(int sum = 0; sum <= i... | a.cc:3:1: error: 'LL' does not name a type
3 | LL dp[51][51][2501];
| ^~
a.cc: In function 'int main()':
a.cc:12:9: error: 'dp' was not declared in this scope; did you mean 'dup'?
12 | dp[0][0][0] = 1;
| ^~
| dup
a.cc:25:9: error: 'LL' was not declared in this scope
2... |
s331060390 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
#define vong1(i,a,b) for(int i=a;i<b;i++)
int N, A;
int x[50];
long p[100][100]10000];
//-----------------------------------------------------------------
int main()
{
cin >> N >> A;
vong1(i, 0, N) cin >> x[i];
p[0][0][0] = 1;
vong1(i, 0, N)
{
vong1(j, 0, N)
... | a.cc:6:17: error: expected initializer before numeric constant
6 | long p[100][100]10000];
| ^~~~~
a.cc: In function 'int main()':
a.cc:14:9: error: 'p' was not declared in this scope
14 | p[0][0][0] = 1;
| ^
|
s951801750 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
#define vong1(i,a,b) for(int i=a;i<b;i++)
int N, A;
int x[50];
long p[51][51][3010];
//-----------------------------------------------------------------
int main()
{
cin >> N >> A;
vong1(i, 0, N) cin >> x[i];
p[0][0][0] = 1;
vong1(i, 0, N)
{
vong1(j, 0, N)
{
... | a.cc: In function 'int main()':
a.cc:21:47: error: expected primary-expression before ']' token
21 | if(p[i][j][k])]
| ^
|
s481142531 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
int main()
{
ll n,a,i,j,k;
cin>>n>>a;
ll x[n+1];
for(i=1;i<=n;i++)
{
cin>>x[i];
}
ll dp[51][51][2501];
for(i=0;i<=2500;i++)
{
dp[0][0][i] = 0;
}
for(i=1;i<=n;i++)
{
for(k... | a.cc: In function 'int main()':
a.cc:38:77: error: no matching function for call to 'max(long long int, ll)'
38 | dp[i][j][k] = max(dp[i][j][k],dp[i-1][j][k]+dp[i-1][j-1][max(0LL,k-x[i])]);
| ~~~^~~~~~~~~~~~
In file includ... |
s479700595 | p04015 | C++ | #include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
int N,A;
ll dp[51][2501],ans;
vector<int> a(N);
int main()
{
cin>>N>>A;
for (int& x: a) cin>>x;
dp[0][0]=1;
for (int x: a)
{
for (int k=50;k>=0;k--)
for (int y=0;y<=2500;y++)
{
if (!dp[k][y]) con... | a.cc: In function 'int main()':
a.cc:20:43: error: 't' was not declared in this scope
20 | dp[k+1][y+t]+=dp[k][y];
| ^
|
s829359010 | p04015 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1e5+5,L=20;
typedef long long ll;
int a[N];
int p[N][L];
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++){
scanf("%d",&a[i]);
}
int L;
scanf("%d",&L);
for(int i=1,j=1;i<=n;i++){
w... | a.cc: In function 'int main()':
a.cc:19:15: error: 'x' was not declared in this scope
19 | while(x[j]+L<x[i])
| ^
a.cc:38:21: error: 'j' was not declared in this scope
38 | if(p[r][j]>=l)
| ^
|
s173366051 | p04015 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long int ll;
#define all(x) x.begin(),x.end()
const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;
int main(... | a.cc: In function 'int main()':
a.cc:38:44: error: expected primary-expression before ';' token
38 | for(int k = 0; k <=; k++){
| ^
|
s824283274 | p04015 | C++ | #pragma GCC optimize("O3")
#include <iostream>
#include <cstdio>
#include <cstring>
#include <list>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#define in(x) scanf("%d",&x)
#define ein(x) ~scanf("%d",&x)
#define inl(x) scan... | a.cc: In member function 'bool iofstream::out_double(T, int)':
a.cc:205:5: warning: no return statement in function returning non-void [-Wreturn-type]
205 | }
| ^
a.cc: In member function 'bool iofstream::out_doubleln(T, int)':
a.cc:245:5: warning: no return statement in function returning non-void [-Wr... |
s488364661 | p04015 | C++ | #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<stack>
using namespace std;
const int N=1e5+50;
const int INF=0x3f3f3f;
long long dp[N][N];
long long sum;
int main()
{
int n,m,a,b;
scanf("%d%d",&n,&m);
dp[0][0]=1;
sum=0;
for(int i=1;i<=n;i++)
... | /tmp/cc74N2Xa.o: in function `main':
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
a.cc:(.text+0x16b): relocation truncated to fit: R_X86_64_PC32 against symbol `sum' defined in .bss section in /tmp/cc74N2Xa.o
a.cc:(.text+0x175): relocation... |
s829519730 | p04015 | C++ | ///
// File: c.go
// Author: ymiyamoto
//
// Created on Sat Feb 24 18:11:43 2018
//
package main
import (
"fmt"
)
func main() {
var N, A int
fmt.Scan(&N, &A)
cards := make([]int, N)
for i := 0; i < N; i++ {
fmt.Scan(&cards[i])
}
dp := make([][][]int64, N+1)
for i := range dp {
dp[i] = make([][]int64, N... | a.cc:7:1: error: 'package' does not name a type
7 | package main
| ^~~~~~~
|
s225151048 | p04015 | C++ | //In the name of God
#include<bits/stdc++.h>
#define int long long
using namespace std;
int n , A , a[60] , dp[60][60][3000];
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n >> A;
for(int i=1 ; i <= n ; i++)
cin >> a[i];
... | a.cc:31:2: error: expected class-name at end of input
31 | ~
| ^
|
s987957144 | p04015 | C++ | #include <iostream>
#include <vector>
using namespace std;
int dp[50][50][50 * 50];
int main(void) {
int N, A;
cin >> N >> A;
vector<int> x;
x.push_back(0);
for (int i = 0; i < N; ++i) {
int x_in;
cin >> x_in;
x.push_back(x_in);
}
int X = *max_element(x.begin(), x... | a.cc: In function 'int main()':
a.cc:19:14: error: 'max_element' was not declared in this scope
19 | int X = *max_element(x.begin(), x.end());
| ^~~~~~~~~~~
|
s283941895 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> int_pair;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
const int N=50;
const int NX = 2500;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n,a,x[N+1];
int dp[N+1][N... | a.cc: In function 'int main()':
a.cc:29:21: error: expected initializer before 'ans'
29 | unsigned ll ans=0;
| ^~~
a.cc:31:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
31 | ans += dp[n][k][k*a];
| ^~~
| ... |
s585992950 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a;
cin>>n>>a;
vector<int>x;
x.resize(n);
for(auto&m:x)cin>>m;
vector<map<int,vector<int>>> map_(n+1);
vector<int> z(1,-1);
map_.at(0).insert(make_pair(0,z));
long long intsum=0;
for(int m=0;m<n;++m){
for(a... | a.cc: In function 'int main()':
a.cc:32:31: error: 'sum' was not declared in this scope
32 | ++sum;
| ^~~
a.cc:40:11: error: 'sum' was not declared in this scope
40 | cout<<sum<<endl;
| ^~~
|
s821910251 | p04015 | C++ | #include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> T &chmin(T &... | a.cc: In function 'int main()':
a.cc:68:21: error: 'b' was not declared in this scope
68 | if ((n-q)%p==0&&b=>q&&q>=0) {
| ^
a.cc:68:23: error: expected primary-expression before '>' token
68 | if ((n-q)%p==0&&b=>q&&q>=0) {
| ^
a.cc:69:10: error: redec... |
s430787800 | p04015 | C++ | ll N, A;
cin >> N >> A;
vector<ll> x;
x.pb(0);
rep(i,N){
ll inp; cin >> inp;
x.pb(inp);
}
rep(i,N)dp[i][0][0]=1;//0枚選んで合計0のやつが全部1通り
for(ll i =1;i<=N;i++){
for(ll j = 1;j<=N;j++){
for(ll k = 1;k<=3000;k++){
if(k<x[i])dp[i][j][k]=dp[i-1][j][k];
else dp[i][j][k]=dp[i-1][j][k]+dp[i-1... | a.cc:1:3: error: 'll' does not name a type
1 | ll N, A;
| ^~
a.cc:2:3: error: 'cin' does not name a type
2 | cin >> N >> A;
| ^~~
a.cc:3:3: error: 'vector' does not name a type
3 | vector<ll> x;
| ^~~~~~
a.cc:4:3: error: 'x' does not name a type
4 | x.pb(0);
| ^
a... |
s477890086 | p04015 | C++ | #include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int n, a;
ll x[51];
ll dp[51][51][2501]; // i番目までのカードをj枚使って合計をkになるような選び方
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 <= i; j++){
for(int k = ... | a.cc:24:3: error: expected unqualified-id before 'for'
24 | for(int i = 1; i <= n; i++){
| ^~~
a.cc:24:18: error: 'i' does not name a type
24 | for(int i = 1; i <= n; i++){
| ^
a.cc:24:26: error: 'i' does not name a type
24 | for(int i = 1; i <= n; i++){
| ... |
s642221364 | p04015 | C++ | a#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7
__attribute__((constructor))
void initial() {
cin.tie(0);
ios::sync_with_stdio(false);
}
ll n, a, x... | a.cc:1:2: error: stray '#' in program
1 | a#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'a' does not name a type
1 | a#include <bits/stdc++.h>
| ^
a.cc: In function 'void initial()':
a.cc:13:3: error: 'cin' was not declared in this scope
13 | cin.tie(0);
| ^~~
a.cc:14:3: error: 'ios' ... |
s075579491 | p04015 | C++ | #include <cstdio>
const int MAXN = 51;
const int ZERO = 2550;
const int MAXM = ZERO * 2;
typedef long long LL;
LL F[2][MAXM];
int main() {
int n, a, i, j, x;
scanf ( "%d%d", &n, &a );
F[0][ZERO] = 1;
for ( i = 1; i <= n; ++i ) {
scanf ( "%d", &x );
x -= A;
for ( j = MAXN; j + MAXN < MAXM; ++j )
F[i & 1][j]... | a.cc: In function 'int main()':
a.cc:13:22: error: 'A' was not declared in this scope
13 | x -= A;
| ^
a.cc:17:30: error: 'N' was not declared in this scope
17 | printf ( "%lld\n", F[N & 1][ZERO] - 1 );
| ^
|
s717032720 | p04015 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>... | a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
47 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
22 | #include <stack>
+++ |+#include <cstring>
23 ... |
s901210238 | p04015 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>... | a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
47 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
22 | #include <stack>
+++ |+#include <cstring>
23 ... |
s983308424 | p04015 | C++ | #include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>... | a.cc: In function 'int main()':
a.cc:47:5: error: 'memset' was not declared in this scope
47 | memset(dp,0,sizeof(dp));
| ^~~~~~
a.cc:23:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
22 | #include <stack>
+++ |+#include <cstring>
23 ... |
s992724630 | p04015 | C++ | #include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define mp make_pair
#define pb push_back
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define fi first
#define se second
using namespace s... | a.cc: In function 'int main()':
a.cc:63:25: error: 'b' was not declared in this scope
63 | cout << b << endl;
| ^
|
s049592247 | p04015 | Java | import java.util.*;
public class Main {
public static long takCards(int[] cards, int avg) {
ArrayList<Integer>[] cache = new ArrayList<Integer>[cards.length];
for (ArrayList<Integer> l : cache)
l = new ArrayList<Integer>();
long count = 0;
for (int i = 1; i <= cards.length; i++)
for (int j = 0; j < ca... | Main.java:5: error: generic array creation
ArrayList<Integer>[] cache = new ArrayList<Integer>[cards.length];
^
1 error
|
s330784575 | p04015 | Java | import java.util.*;
public class Main {
public static takCards(int[] cards, int avg) {
ArrayList<Integer>[] cache = new ArrayList<Integer>[cards.length];
for (ArrayList<Integer> l : cache)
l = new ArrayList<Integer>();
long count = 0;
for (int i = 1; i <= cards.length; i++)
for (int j = 0; j < cards.l... | Main.java:4: error: invalid method declaration; return type required
public static takCards(int[] cards, int avg) {
^
1 error
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.