submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s193828615 | p04015 | Java |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/**
* Created by jaga on 9/6/16.
* dpで解けるかな?
* 入力の数字を -Aしておき、組み合わせで0が何通り作れるかを考える
* dp[j][k] = j番目(0-indexed)までの文字をつかってkが何回作れるか j < N , - N*50 < k < N*50 + 1
* kの値は k + N*50 としておく(負の値の処理のため)
* dp[j][k] = dp[j - 1][k] +... | Main.java:17: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s790238054 | p04015 | C++ | ga | a.cc:1:1: error: 'ga' does not name a type
1 | ga
| ^~
|
s338017809 | p04015 | C++ | ga | a.cc:1:1: error: 'ga' does not name a type
1 | ga
| ^~
|
s414351566 | p04015 | C++ | test | a.cc:1:1: error: 'test' does not name a type
1 | test
| ^~~~
|
s512003875 | p04015 | C++ | aa | a.cc:1:1: error: 'aa' does not name a type
1 | aa
| ^~
|
s042534107 | p04015 | C++ | #test | a.cc:1:2: error: invalid preprocessing directive #test
1 | #test
| ^~~~
|
s668353681 | p04015 | C | #include<stdio.h>
#include<stdlib.h>
typedef long long ll;
int N,A;
int x[51];
ll dp[51][51][2501];
int max;
void solve(){
int i,j,k;
ll ans = 0;
dp[0][0][0] = 1;
for(i = 0; i <= N; i++){
for(j = 0; j <= N; j++){
for(k = 0; k <= N*max; k++){
if(k < x[i] && i >= 1)dp[i][j][k] = dp[i-1][j][k];
... | /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
|
s499056647 | p04015 | C++ | //変数名を長くしても伝わらなければ意味がないのじゃ
#include <iostream>
#include <algorithm>
#define int long long
using namespace std;
int ______________________________________;
int kokoropyonpyonmatchi[100000];
int kangaerufurisite[100001];
int l;
int q;
int mutyotthikaduityaeeeeeeeeee, thikaduityaeeeeeeeeee;
int unkonokoun[20][100000];... | a.cc: In function 'int main()':
a.cc:85:24: error: 'ed' was not declared in this scope
85 | while (ed - st >= 2) {
| ^~
a.cc:85:29: error: 'st' was not declared in this scope; did you mean 'std'?
85 | while (ed - st >= 2) {
| ... |
s887334844 | p04015 | C++ | //変数名を長くしても伝わらなきゃ意味がないのじゃ
#include <iostream>
#include <algorithm>
#define int long long
using namespace std;
int ______________________________________;
int kokoropyonpyonmatchi[100000];
int kangaerufurisite[100001];
int l;
int q;
int mutyotthikaduityaeeeeeeeeee, thikaduityaeeeeeeeeee;
int unkonokoun[20][100000];
... | a.cc: In function 'int main()':
a.cc:85:24: error: 'ed' was not declared in this scope
85 | while (ed - st >= 2) {
| ^~
a.cc:85:29: error: 'st' was not declared in this scope; did you mean 'std'?
85 | while (ed - st >= 2) {
| ... |
s042414788 | p04015 | C++ | #include<cstdio>
#include <map>
#include<iostream>
#include<string.h>
#include<algorithm>
using namespace std;
typedef __int64 LL;
int x[60];;
long long dp[60][60][2600];
int main()
{
int n, a;
scanf("%d%d", &n, &a);
for(int i = 1; i <= n; ++i)
scanf("%d", &x[i]);
for(int i = 0; i <= n; ++i)
... | a.cc:8:9: error: '__int64' does not name a type; did you mean '__int64_t'?
8 | typedef __int64 LL;
| ^~~~~~~
| __int64_t
|
s681097048 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY... | /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
|
s316448570 | p04015 | Java | public class Main {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
int A = 0;
int N = 0;
int[] X ;
int result = 0;
N = scanner.nextInt();
A = scanner.nextInt();
X = new int[N];
int pointer ... | Main.java:2: error: cannot find symbol
public static void main(String[] args) throws IOException {
^
symbol: class IOException
location: class Main
Main.java:3: error: cannot find symbol
Scanner scanner = new Scanner(System.in);
^
symbol: c... |
s499423559 | p04015 | C++ | #include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);++i)
#define rep(i,n) REP(i, 0, n)
typedef long long int i64;
typedef pair<int, int> pint;
int main() {
int N, A; cin >> N >> A;
vector<int> X(N);
rep(i, N) cin >> X[i];
vector<vec... | a.cc: In function 'int main()':
a.cc:13:55: error: no matching function for call to 'std::vector<std::vector<long long int> >::vector(int, std::vector<int>)'
13 | vector<vector<i64>> dp(N + 1, vector<int>(2510, 0));
| ^
In file included from /usr/includ... |
s670786756 | p04015 | C++ | 1 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 1
| ^
|
s493028299 | p04015 | Java | public class Main060 {
public static void main(String[] args) {
// キーボード入力をint配列へ詰める
int intAry[] = new int[2];
Scanner in1 = new Scanner(System.in);
for (int i = 0;i <= intAry.length; i++) {
intAry[i] = in1.nextInt();
}
in1.close();
//
int intAry2[] = new int[intAry[0]];
Scanner in2 = new Sc... | Main.java:1: error: class Main060 is public, should be declared in a file named Main060.java
public class Main060 {
^
Main.java:6: error: cannot find symbol
Scanner in1 = new Scanner(System.in);
^
symbol: class Scanner
location: class Main060
Main.java:6: error: cannot find symbol
Scanner in1 = new S... |
s014607420 | p04015 | C++ | #include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N = 55;
int a,n;
LL c[N][N*N];
int main(){
scanf("%d%d",&n,&a);
c[0][0]=1;
for(int i=1;i<=n;++i){
int x;scanf("%d",&x);
for(int j=i;j>=1;--j){
for(int k=2500;k>=x;--k)
c[j][k]+=c[j-... | a.cc: In function 'int main()':
a.cc:27:3: error: 'cout' was not declared in this scope
27 | cout<<ret<<endl;
| ^~~~
a.cc:4:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <algorithm>
+++ |+#include <iostream>
4 | using... |
s895826742 | p04015 | C++ | #include <iostream>
#include <map>
#include <vector>
using namespace std;
#define vvv vector<vector<vector<int > > >
int main() {
int N, A;
cin >> N >> A;
vector<int> x(N);
for(int i = 0; i < N; ++i) cin >> x[i];
sort(x.begin(),x.end());
long long counter = 0;
vector<vvv> subsetCount(N,vvv(5... | a.cc: In function 'int main()':
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
11 | sort(x.begin(),x.end());
| ^~~~
| short
|
s309412612 | p04015 | C++ | #include<iostream>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<queue>
#include<set>
#include<map>
using namespace std;
using ulong = unsigned long;
using ll = long long;
int n, a;
vector<int> xs;
ll memo[51][51][2501];
ll solve(int idx, int cnt, int sum){
if(memo[idx][cnt][sum] != ... | a.cc: In function 'int main()':
a.cc:33:9: error: 'memset' was not declared in this scope
33 | memset(memo, -1, sizeof(memo));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include<map>
+++ |+#include <cstr... |
s810215656 | p04015 | C++ | import java.util.Scanner;
public class Main {
public static void main(String[] args){
try(Scanner scan = new Scanner(System.in)){
int N = scan.nextInt();
int A = scan.nextInt();
int[] x = new int[N];
long ans = 0;
for(int i = 0; i<N; i++){
x[i] = scan.nextInt();
}
double lim ... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main {
| ^~~~~~
|
s836413410 | p04015 | C++ | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int n, a;
int x[50];
long long total = 0;
std::vector<std::vector<long long>> count, prev;
std::cin >> n >> a;
for (int ni = 0; ni < n; ++ni) {
std::cin >> x[ni];
}
count.... | a.cc:42:5: error: redefinition of 'int main()'
42 | int main() {
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main() {
| ^~~~
|
s308252492 | p04015 | C++ | #include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair... | a.cc: In function 'int main()':
a.cc:64:59: error: conversion from 'std::unordered_map<int, int>::iterator' {aka 'std::__detail::_Insert_base<int, std::pair<const int, int>, std::allocator<std::pair<const int, int> >, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std:... |
s743693368 | p04015 | C++ | #include <algorithm>
#include <iostream>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
int main() {
int n, a;
int x[50];
long long total = 0;
std::vector<std::vector<int>> count, prev;
std::cin >> n >> a;
for (int ni = 0; ni < n; ++ni) {
std::cin >> x[ni];
}
count.resize... | a.cc:42:5: error: redefinition of 'int main()'
42 | int main() {
| ^~~~
a.cc:8:5: note: 'int main()' previously defined here
8 | int main() {
| ^~~~
|
s414523157 | p04015 | C++ | #include<bits/stdc++.h>
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <limits.h>
#include <math.h>
#include <algorithm>
#include <deque>
#include <queue>
#include <st... | a.cc: In function 'int main()':
a.cc:78:22: error: 't' was not declared in this scope
78 | cin>>t;
| ^
a.cc:82:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
82 | ans+=max(ma[m-i],ma[m+i]);
| ^~~
| ... |
s128713078 | p04016 | C++ | #ifndef ATCODER_INTERNAL_BITOP_HPP
#define ATCODER_INTERNAL_BITOP_HPP 1
#ifdef _MSC_VER
#include <intrin.h>
#endif
namespace atcoder {
namespace internal {
// @param n `0 <= n`
// @return minimum non-negative `x` s.t. `n <= 2**x`
int ceil_pow2(int n) {
int x = 0;
while ((1U << x) < (unsigned int)(n)) x++;
r... | a.cc: In function 'int main()':
a.cc:1964:13: error: 'out' was not declared in this scope
1964 | if(n==K) {out << b+1 << endl;return 0;}
| ^~~
a.cc:1964:20: error: 'b' was not declared in this scope
1964 | if(n==K) {out << b+1 << endl;return 0;}
| ^
|
s469467388 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
typedef long long ll;
ll n, s;
ll ans = 1e18;
const int N = 317000;
void check(int b) {
ll v = n, sum = 0;
while (v) {
sum += v % b; v /= b;
}
if (sum == s) {
ans = min(ans, b);
}
}
void relax(ll a) {
ll b = s ... | a.cc: In function 'void check(int)':
a.cc:19:14: error: no matching function for call to 'min(ll&, int&)'
19 | ans = min(ans, b);
| ~~~^~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
fro... |
s625769792 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxN = 2e5 + 10;
const ll oo = 1e18;
ll n, m;
ll f(ll x, ll d) {
if (x > d) return d;
return (d % x) + f(x, d / x);
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// freopen("abc.inp", "r", stdin); freopen("abc... | a.cc: In function 'int main()':
a.cc:31:17: error: 'x' was not declared in this scope
31 | ll q = n - (x * y);
| ^
a.cc:31:21: error: 'y' was not declared in this scope
31 | ll q = n - (x * y);
| ^
|
s528836463 | p04016 | C++ | #include <iostream>
#include <utility>
#include <tuple>
#include <vector>
#include <string>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <algorithm>
#include <functional>
#include <climits>
#include <numeric>
#include <queue>
#include <cmath>
#include <iomanip>
#include <arra... | a.cc:45:9: error: expected unqualified-id before 'if'
45 | if (n == s) {
| ^~
a.cc:49:14: error: 'cout' in namespace 'std' does not name a type
49 | std::cout << "-1\n";
| ^~~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:63:18: note: 'std::cout' decl... |
s494158316 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
long long f(long long n, long long k) {
long long rt = 0;
while (n > 0) {
rt += n % k;
n /= k;
}
return rt;
}
int main() {
long long n, s;
cin >> n >> s;
long long ans = -1;
long long B = 0;
for (long long i = 2; i * i <... | a.cc: In function 'int main()':
a.cc:36:27: error: 'k' was not declared in this scope
36 | if (ans == -1 && n == k) ans = n + 1;
| ^
|
s409171603 | p04016 | C++ | n=int(input())
s=int(input())
import math
#first solve assuming b<=sqrt(n)
sq=int(math.sqrt(n))
for b in range(2,sq+2):
num=n
su=0
while num>=b:
su+=num%b
num//=b
su+=num
if su==s:
print(b)
exit()
#answer not found yet so check in the divisors of n-s
nn=n-s
if nn==0:
... | a.cc:4:2: error: invalid preprocessing directive #first
4 | #first solve assuming b<=sqrt(n)
| ^~~~~
a.cc:16:2: error: invalid preprocessing directive #answer
16 | #answer not found yet so check in the divisors of n-s
| ^~~~~~
a.cc:21:11: warning: multi-character character constant [-Wmultichar]
... |
s804106523 | p04016 | C++ | cout << -1 << endl; | a.cc:1:2: error: 'cout' does not name a type
1 | cout << -1 << endl;
| ^~~~
|
s048115677 | p04016 | C++ | #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;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());
#define VRSORT(v) sort(v.begin(), v.e... | a.cc: In function 'int solve()':
a.cc:79:17: error: 's' was not declared in this scope
79 | ll b = 1+(N-s)/q;
| ^
a.cc: At global scope:
a.cc:82:3: error: expected unqualified-id before 'if'
82 | if(func(N+1,N)==S) {cout << N+1 << endl; return 0;}
| ^~
a.cc:83:3: error: 'cout' ... |
s444704596 | p04016 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
ll f(ll b, ll n) {
ll ans=0;
while (n) {
ans += (n % b);
n /= b;
}
return... | a.cc: In function 'int main()':
a.cc:25:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
25 | scanf_s("%lld%lld", &n, &s);
| ^~~~~~~
| scanf
|
s697716496 | p04016 | C++ | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
ll f(ll b, ll n) {
ll ans=0;
while (n) {
ans += (n % b);
n /= b;
}
return... | a.cc: In function 'int main()':
a.cc:25:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
25 | scanf_s("%lld%lld", &n, &s);
| ^~~~~~~
| scanf
|
s829910510 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
long long n, s;
scanf("%lld%lld", &n, &s);
if(n == s) {
printf("%lld\n", n + 1);
return 0;
}
if(s == 1) {
else printf("%lld\n", n);
return 0;
}
int m = sqrt(n); m++;
long long res = -1;
for(int i = 2; i <= m; i++) {
long long tmp = n, sum = ... | a.cc: In function 'int main()':
a.cc:12:17: error: expected '}' before 'else'
12 | else printf("%lld\n", n);
| ^~~~
a.cc:11:20: note: to match this '{'
11 | if(s == 1) {
| ^
a.cc: At global scope:
a.cc:15:22: error: 'n' was not declared in thi... |
s411579939 | p04016 | C++ | //#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
//#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define files(name) name!=""?freopen(name".in","r",stdin),freopen(... | a.cc: In function 'long long int get_big(long long int, long long int)':
a.cc:63:20: error: no matching function for call to 'min(long long int&, int)'
63 | res=min(res,2);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64... |
s602955166 | p04016 | C++ | #include <iostream>
#include <climits>
using namespace std;
long long digitsum(long long b, long long n) {
long long result = 0;
while (n > 0) {
result += n % b;
n /= b;
}
return result;
}
int main() {
long long n, s, result = LLONG_MAX;
cin >> n >> s;
if (n == s) {
... | a.cc: In function 'int main()':
a.cc:37:33: error: 'b' was not declared in this scope
37 | result = min(n - s, b);
| ^
|
s698552893 | p04016 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
long long digitsum(long long b, long long n) {
long long result = 0;
while (n > 0) {
result += n % b;
n /= b;
}
return result;
}
int main() {
long long n, s;
unsigned long long result = -1;
cin >> n >> s;
for... | a.cc: In function 'int main()':
a.cc:27:29: error: no matching function for call to 'min(long long unsigned int&, long long int)'
27 | result = min(result, (n - s) / b);
| ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
fro... |
s753189788 | p04016 | C++ | #include<bits/stdc++.h>
#define LL long long
#define MAXN 50005
#define INF (1<<25)
#define P int(998244353)
using namespace std;
LL n,s;
bool chk(LL b){
LL res = 0;
LL x = n;
while(x){
res += x%b;
x /= b;
}
return (s==res);
}
int main(){
cin>>n>>s;
if(s==1){
cout<<max(2,n)<<endl;
return 0;
}
if(... | a.cc: In function 'int main()':
a.cc:25:26: error: no matching function for call to 'max(int, long long int&)'
25 | cout<<max(2,n)<<endl;
| ~~~^~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc... |
s293482841 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
long long f(long long b, long long n){
if (n < b)
return n;
return f(b, n / b) + n % b;
}
int main(){
long long n, s;
scanf("%lld %lld", &n, &s);
if (n == s){
printf("%lld\n", n + 1);
return 0;
for (long long i = 2; i * i <... | a.cc: In function 'int main()':
a.cc:19:15: error: 'i' was not declared in this scope
19 | if (f(i, n) == s){
| ^
|
s490813967 | p04016 | 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;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class... | a.cc: In function 'bool Add(llong&, llong)':
a.cc:26:42: warning: no return statement in function returning non-void [-Wreturn-type]
26 | bool Add(int &a,int b){a = (a + b) % MOD;}
| ^
a.cc: In function 'int main()':
a.cc:71:9: error: redeclaration of 'llong ans'
71 ... |
s841612682 | p04016 | 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;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class... | a.cc: In function 'bool Add(llong&, llong)':
a.cc:26:42: warning: no return statement in function returning non-void [-Wreturn-type]
26 | bool Add(int &a,int b){a = (a + b) % MOD;}
| ^
a.cc: In function 'int main()':
a.cc:50:28: error: expected primary-expression before... |
s819106178 | p04016 | C++ | #include <bits/stdc++.h>
#define pb push_back
#define ll long long
#define mp make_pair
#define inf 1000000007
#define int long long
using namespace std;
signed main(){
ll n,s;
cin>>n>>s;
if(n<s){
cout<<-1<<endl;
return 0;
}
if(n==s){
cout<<n+1<<endl;
return 0;
}
for(int i=2;i*i<=n;i++){
ll sum = 0;
... | a.cc: In function 'int main()':
a.cc:42:17: error: expected ',' or ';' before 'if'
42 | if(1.0*ct>sq && n/ct+n%ct==s){
| ^~
|
s669660960 | p04016 | C++ | #include <iostream>
#include <cmath>
using namespace std;
long long digitsum(long long a,long long p){
long long t = 0;
while(a>0){
t+=(a%p);
a/=p;
}
return t;
}
int main(){
long long n,s;
cin >> n >> s;
//sqrt(n)までは全探索
long long n1 = long(sqrt(n))+1;
for(int i = 2;i<... | a.cc: In function 'int main()':
a.cc:26:77: error: expected ')' before '}' token
26 | if(amari>=0 && (n-amari)%i==0 && amari<(n-amari)/i && (n-amari)/i>=2}){
| ~ ^
| ... |
s614777291 | p04016 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
vector<ll> yakusu;
void calc_yakusu(ll A) {
if (A == 1) {
yakusu.push_back(1);
return;
}
ll waru = 1;
while (waru * waru <= A) {
if (A % waru == 0) {
yakusu.push_back(waru);
if(waru * waru != A)
... | a.cc: In function 'int main()':
a.cc:61:46: error: 'sqrt' was not declared in this scope
61 | if (cur > 1 && counter > (ll)sqrt(n) && cur + 1 > counter && cur + 1 > s - counter) {
| ^~~~
|
s975007175 | p04016 | C++ | #include<bits/stdc++.h>
using namespace std;
// Shortcut
//#pragma optimize ("O3")
#define int long long
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair
#define upb upper_bound
#define lwb lower_bound
#define fi first
#define se second
#define For(i, l, r) fo... | a.cc: In function 'int main()':
a.cc:84:22: error: expected ';' before numeric constant
84 | for (int i = 2; i 8 i <= n; i++){
| ^~
| ;
a.cc:84:24: error: expected ')' before 'i'
84 | for (int i = 2; i 8 i <= n; i++){
| ~ ^~
... |
s330645026 | p04016 | C++ | #include<bits/stdc++.h>
using namespace std;
map<long long,map<long long, long long> > f;
long long count(long long b,long long n){
if(f[b][n]!=0){
return f[b][n];
}
if(n<b){
//cout << b << " " << n<<endl;
return n;
}
else{
f[b][n] = count(b,n/b) + n%b;
return f[b][n];
}
}
signed main(){
long long n,s;... | a.cc: In function 'int main()':
a.cc:22:29: error: expected ';' before ')' token
22 | for(int i=1;i<=10000){
| ^
| ;
|
s993957429 | p04016 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
using namespace std;
#define vel vector<long long>
#define vvel vector<vel>
#define int long long
#define rep(i,n) for(long long i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define... | a.cc: In function 'int main()':
a.cc:65:26: error: 'diff' was not declared in this scope; did you mean 'dif'?
65 | for(int i=1;i*i<=diff;i++){
| ^~~~
| dif
|
s701273239 | p04016 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
usi... | a.cc: In function 'int main()':
a.cc:86:7: error: 'j' was not declared in this scope
86 | j = n / i;
| ^
|
s353506133 | p04016 | C++ | #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
usi... | a.cc: In function 'int main()':
a.cc:74:3: error: 'b' was not declared in this scope
74 | b ++;
| ^
|
s301254974 | p04016 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
c... | a.cc: In function 'int main()':
a.cc:56:40: error: expected ')' before ';' token
56 | for(LL i=sqrt(n-s)+1;; i>=1; i--) {//枚举x1
| ~ ^
| )
a.cc:56:42: error: 'i' was not declared in this scope
56 | for(L... |
s626269637 | p04016 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
c... | a.cc: In function 'int main()':
a.cc:29:9: error: 'prLLf' was not declared in this scope
29 | prLLf("%lld\n",s+1);
| ^~~~~
a.cc:31:9: error: 'prLLf' was not declared in this scope
31 | prLLf("-1\n");
| ^~~~~
a.cc:46:17: error: 'prLLf' was not declared in this scope
4... |
s200628927 | p04016 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
c... | a.cc: In function 'int main()':
a.cc:29:9: error: 'prLLf' was not declared in this scope
29 | prLLf("%lld\n",s+1);
| ^~~~~
a.cc:31:9: error: 'prLLf' was not declared in this scope
31 | prLLf("-1\n");
| ^~~~~
a.cc:46:17: error: 'prLLf' was not declared in this scope
4... |
s438542639 | p04016 | C++ | #include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n,s;
bool check(ll base)
{
ll tmp=n;
ll ans=0;
while(tmp)
{
ans+=tmp%base;
tmp/=base;
}
return ans==s;
}
bool check(ll i,ll sum)
{
ll a1=s-i;//x0
ll a2=sum/i+1;//b
if(a1>=0&&a1<b&&i<a2)return 1;
... | a.cc: In function 'bool check(long long int, long long int)':
a.cc:20:18: error: 'b' was not declared in this scope
20 | if(a1>=0&&a1<b&&i<a2)return 1;
| ^
|
s796783279 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long int n, s;
cin >> n;
cin >> s;
bool judge = true;
long int i = 2;
long int f = 0;
long int x;
if(n<=s){
cout << -1 << end;
}
else{
while(judge){
x = n;
f = 0;
if(n<i){
if(n == s){
cout << i << endl;
... | a.cc: In function 'int main()':
a.cc:14:16: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
14 | cout << -1 << end;
| ~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c+... |
s812477891 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long int n, s;
cin >> n;
cin >> s;
bool judge = true;
long int i ;
long int f = 0;
long int x;
if(s > 1000000){
cout << -1 << endl;
continue;
}
else{
i = 2;
}
while(judge){
x = n;
f = 0;
if(n<i){
if(n == ... | a.cc: In function 'int main()':
a.cc:14:5: error: continue statement not within a loop
14 | continue;
| ^~~~~~~~
|
s227807835 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, s;
cin >> n;
cin >> s;
bool judge = true;
int i = 2;
int f = 0;
while(judge){
if(n<i){
if(n == s){
cout << i << endl;
}
else{
cout << -1 << endl;
}
judge = false;
}
else if(n >= i... | a.cc: In function 'int main()':
a.cc:37:2: error: expected '}' at end of input
37 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s320249396 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int n, s;
cin >> n;
cin >> s;
bool judge = true;
int i = 2;
int f = 0;
while(judge){
if(n<i){
if(n == s){
cout << i << endl;
}
else{
cout << -1 << endl;
}
judge = false;
}
else if(n >= i... | a.cc: In function 'int main()':
a.cc:25:13: error: lvalue required as left operand of assignment
25 | if(n%i = 0){
| ~^~
|
s913686215 | p04016 | C++ | #include <iostream>
#include <cmath>
#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)
using namespace std;
typedef long long ll;
typedef long long int;
#define ECHO(v) cout << v << endl;
ll f(ll b, ll n){
if(n < b)return n;
return f(b... | a.cc:8:19: error: declaration does not declare anything [-fpermissive]
8 | typedef long long int;
| ^~~
|
s101048966 | p04016 | C++ | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define lli long long int
#define REP(i,n) for(int i=0;i<n;i++)
#define REP2(i,n) for(int i=1;i<=n;i++)
#define DEBUG 0
lli calc(lli b,lli n){
if(n<b) return n;
else retu... | a.cc: In function 'int main()':
a.cc:35:18: error: conflicting declaration 'std::set<long long int> s'
35 | set<lli> s;
| ^
a.cc:23:15: note: previous declaration as 'long long int s'
23 | lli n,s;
| ^
a.cc:38:27: error: request for member 'insert' in 's'... |
s568186183 | p04016 | C++ | #include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
using namespace std;
LL dig(LL x, LL n) {
if(n<x) return n;
else return dig(x/n)+x%n;
}
int main(void)
{
LL n,s;
cin >> n >> s;
vector<LL> f;
for(LL i=2; i*i <= n;++i) {
if((n-s)%i) co... | a.cc: In function 'LL dig(LL, LL)':
a.cc:10:18: error: too few arguments to function 'LL dig(LL, LL)'
10 | else return dig(x/n)+x%n;
| ~~~^~~~~
a.cc:8:4: note: declared here
8 | LL dig(LL x, LL n) {
| ^~~
|
s987866120 | p04016 | C++ | #include <bits/stdc++.h>
typedef long long LL;
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
using namespace std;
LL dig(LL x, LL n) {
if(n<x) return n;
else return dig(x/n)+x%n;
}
int main(void)
{
LL n,s;
cin >> n >> s;
vector<LL> f;
FOR(i, 1, 1048576) {
if((n-s)%i) continue;... | a.cc: In function 'LL dig(LL, LL)':
a.cc:10:18: error: too few arguments to function 'LL dig(LL, LL)'
10 | else return dig(x/n)+x%n;
| ~~~^~~~~
a.cc:8:4: note: declared here
8 | LL dig(LL x, LL n) {
| ^~~
|
s831974036 | p04016 | C++ | import math
n = int(input())
s = int(input())
if s == 1:
print(n)
quit()
if n == s:
print(n+1)
quit()
def f(b, n):
ret = 0
while n > 0:
ret += n % b
n = n // b
return ret
for i in range(2, int(math.sqrt(n)+2)):
t = f(i, n)
if s == t:
print(i)
quit(... | a.cc:1:1: error: 'import' does not name a type
1 | import math
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s144896935 | p04016 | C++ | #include<iostream>
#include<map>
using namespace std;
map<__int64,int> m1;
int check(int b,int n){
if(n<b)return n;
int s=n%b;
n/=b;
s+=check(b,n);
return s;
}
int main(){
int i,j,k;
int a,n,s;
int b,c;
int s1=-1;
m1[1]=1;
map<__int64,int>::iterator itr;
cin>>n>>s;
a=n-s;
for(i=2;i<100000;i++){
if(a==i)... | a.cc:4:5: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
4 | map<__int64,int> m1;
| ^~~~~~~
| __int64_t
a.cc:4:16: error: template argument 1 is invalid
4 | map<__int64,int> m1;
| ^
a.cc:4:16: error: template argument 3 is invalid
a.cc:4:16: e... |
s014662121 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#de... | a.cc: In function 'int main()':
a.cc:66:9: error: 'else' without a previous 'if'
66 | else if(n==s){
| ^~~~
|
s055817200 | p04016 | C++ | #include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define se second
#define fi first
typedef long long ll;
using namespace std;
const int NUM = 1e5 + 5;
const int mod = 998244353;
int INF = 2e9;
pair <int ,int> pinf = {INF, INF};
ll f (ll b, ll n){
if (n < b)
return n;
return n % b + ... | a.cc: In function 'int main()':
a.cc:33:20: error: no matching function for call to 'max(ll&, int)'
33 | cout << max(n, 2);
| ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
f... |
s043431926 | p04016 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int shit(int b,int n){
if(n<b) return n;
else return shit(b,floor(n/b))+(n%b);
}
int main(){
long long a,b;
cin>>a>>b;
if(a==1){
cout<<"-1";
}
else if(b==1){
cout<<a;
}
else if(a==b){
cout<<1;
}
else if(a<=10000000&&b<=1000000){
for... | a.cc: In function 'int main()':
a.cc:26:47: error: 'f' was not declared in this scope
26 | else if(i==100000000&&f(i,a)!=b){
| ^
|
s384370497 | p04016 | C++ | #include<iostream>
#include<cmath>
using namespace std;
int shit(int b,int n){
if(n<b) return n
else return shit(b,floor(n/b))+(n%b);
}
int main(){
long long a,b;
cin>>a>>b;
if(a==1){
cout<<"-1";
}
else if(b==1){
cout<<a;
}
else if(a==b){
cout<<1;
}
else if(a<=10000000&&b<=1000000){
for(... | a.cc: In function 'int shit(int, int)':
a.cc:5:25: error: expected ';' before 'else'
5 | if(n<b) return n
| ^
| ;
6 | else return shit(b,floor(n/b))+(n%b);
| ~~~~
a.cc: In function 'int main()':
a.cc:26:47: er... |
s677308912 | p04016 | C++ | #include <iostream>
#include <cmath>
using namespace std;
int f(int n, int b){
int result = 0;
while(n >= b){
result += n % b;
n /= b;
}
result += n;
return result;
}
int main(){
int n, s;
int a[16] = {2, 5, 7, 8, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 10000000... | a.cc: In function 'int main()':
a.cc:17:106: error: narrowing conversion of '10000000000' from 'long int' to 'int' [-Wnarrowing]
17 | int a[16] = {2, 5, 7, 8, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10000000000, 100000000000};
| ... |
s015338087 | p04016 | C++ | #include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"
#include "map"
#include "unordered_map"
#include "set"
#include "stack"
#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define m... | a.cc: In function 'int main()':
a.cc:35:17: error: expected ';' before '}' token
35 | return 0
| ^
| ;
36 | }
| ~
|
s689729931 | p04016 | C++ | #include<bits/stdc++.h>
#define int long long
using namespace std;
long long tmp;
long long trans(long long b,long long n){
if(n<b){
return n;
}
return trans(b,n/b)+n%b;
}
vector<long long> divi;
signed main(){
long long n,s;
cin>>n>>s;
tmp=n;
if(s==1){
cout<<n;
return 0;
}
long long k=sqrt(n);
for(int ... | a.cc: In function 'int main()':
a.cc:27:31: error: 'q' was not declared in this scope
27 | tmp=n;q
| ^
|
s638090020 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll n,s,sq;
bool check(ll b)
{
ll ret=0,t=n;
for(;t;t/=b) ret+=t%b;
return (ret==s);
}
ll solve()
{
if(s==n) return n+1;
if(s>n) return -1;
for(ll i=2;i*i<=n;i++)
if(check(i)) return i;
for(ll i=1;i*i<=n;i++)
if((n-s)%i==0&&check((n-s)/i... | a.cc: In function 'int main()':
a.cc:28:34: error: expected ';' before 'printf'
28 | scanf("%lld%lld",&n,&s);s
| ^
| ;
29 | printf("%lld",solve());
| ~~~~~~
|
s616557339 | p04016 | C++ | // D.
#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long LL;
LL check(LL b, LL n) {
LL c = 0;
while (n) {
c += n % b;
n /= b;
}
return c;
}
int main(int argc, char *argv[]) {
LL n, s;
cin >> n >> s;
LL ans = 1LL << 60;
... | a.cc: In function 'int main(int, char**)':
a.cc:34:28: error: 'pow' was not declared in this scope
34 | LL q = (LL)pow(n, 1.0 / d);
| ^~~
|
s866988607 | p04016 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
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() {
long long n, s; cin >> n >> s;
//n = 1e11;
/*for (int b = 2; b <= n;... | a.cc: In function 'int main()':
a.cc:25:32: error: 'sqrt' was not declared in this scope
25 | for(int i=1;i<=sqrt(n);i++){
| ^~~~
a.cc:36:36: error: 'sqrt' was not declared in this scope
36 | for (int i = 2; i<=sqrt(n); i++) {
| ... |
s614894186 | p04016 | C++ | #include <cstdio>
#include <cmath>
using namespace std;
long long N, S;
double n;
long long function(long long b, long long n) {
if (n < b) {
return n;
} else {
return function(b, n/b) + n % b;
}
}
long long solve() {
if (N < S) {
return -1;
}
if (N == S) {
return N+1;
}
for (long lon... | /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
|
s029349381 | p04016 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
constexpr long MOD = 1e9 + 7;
using namespace std;
long digitsum(long b, long n) {
if (n < b) return n;
else return digitsum(b, n / b) + n % b;
}
int main() {
long n, s;
cin >> n ... | a.cc: In function 'int main()':
a.cc:36:17: error: 'LONG_MAX' was not declared in this scope
36 | long minb = LONG_MAX;
| ^~~~~~~~
a.cc:5:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
4 | #include <cmath>
+++ |+#include <... |
s112438323 | p04016 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll digit_sum(ll i, ll b)
{
ll ans = 0;
while (i > 0)
{
ans += i % b;
i /= b;
}
return ans;
}
int main()
{
ll n, s;
cin >> n >> s;
ll lim = sqrt(n);
ll ans = n + 1;
for (ll b... | a.cc: In function 'int main()':
a.cc:24:14: error: 'sqrt' was not declared in this scope
24 | ll lim = sqrt(n);
| ^~~~
|
s387569261 | p04016 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
ll digit_sum(ll i, ll b)
{
ll ans = 0;
while (i > 0)
{
ans += i % b;
i /= b;
}
return ans;
}
int main()
{
ll n, s;
cin >> n >> s;
ll lim = sqrt(n);
ll ans = n + 1;
for (ll b... | a.cc: In function 'int main()':
a.cc:24:14: error: 'sqrt' was not declared in this scope
24 | ll lim = sqrt(n);
| ^~~~
|
s303773806 | p04016 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = 1e18;
ll f(ll b,ll n){
if(n<b) return n;
return ... | a.cc: In function 'int main()':
a.cc:42:9: error: expected ',' or ';' before 'for'
42 | for(ll p = 1; p*p <= n; p++){
| ^~~
a.cc:42:23: error: 'p' was not declared in this scope
42 | for(ll p = 1; p*p <= n; p++){
| ^
|
s951718391 | p04016 | C++ | #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define rrep(i,n) RFOR(i,n,0)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll INF = 1e18
ll f(ll b,ll n){
if(n<b) return n;
return f... | a.cc:15:1: error: expected ',' or ';' before 'll'
15 | ll f(ll b,ll n){
| ^~
a.cc: In function 'int main()':
a.cc:34:20: error: 'f' was not declared in this scope
34 | if(f(b,n) == s){
| ^
a.cc:42:9: error: expected ',' or ';' before 'for'
42 | for(ll p = ... |
s496087561 | p04016 | C++ | /* *** In The Name of God ... *** */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define int long long
#define all(v) v.begin() , v.end()
template<typename T> inline bool smin(T &a, const T &b){ return b < a ? a = b,1:0;}
template<typename T> inline bool smax(T &a... | a.cc: In function 'int32_t main()':
a.cc:43:50: error: no matching function for call to 'min(double, long long int&)'
43 | for ( int possible = 1 ; possible <= min ( 1LL * 2e6 , t ) ; ++ possible ) {
| ~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include... |
s435310065 | p04016 | C++ | #include <cassert>
#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>
#include <ctime>
/*
//#if __cplusplus >= ... | a.cc: In function 'int main()':
a.cc:137:5: error: 'Min' was not declared in this scope; did you mean 'sin'?
137 | Min(ans,b);
| ^~~
| sin
|
s025811151 | p04016 | C++ | #include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <li... | a.cc: In function 'int main()':
a.cc:57:27: error: no matching function for call to 'max(ll&, int)'
57 | if(s==1) res = max(n, 2);
| ~~~^~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note... |
s659952816 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
/*{{{*/ //template
#define rep(i,n) for(int i=0;i<n;i++)
constexpr int INF = numeric_limits<int>::max()/2;
constexpr long long LINF = numeric_limits<long long>::max()/3;
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#d... | a.cc: In function 'int main()':
a.cc:55:22: error: no matching function for call to 'min(ll&, int)'
55 | for(ll i=2;i<=min(sqn,1000000);i++){
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h... |
s918304533 | p04016 | 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:69:10: error: redeclaration of 'll b'
69 | ll b = (n-q)/p;
| ^
a.cc:68:21: note: '<typeprefixerror>b' previously declared here
68 ... |
s098716610 | p04016 | C++ | #include <bits/stdc++.h>
#define MaxN 100005
using namespace std;
long long S,N,ans;
int main()
{
cin>>N>>S;
ans=N;
for(long long i=2;i*i<=N;i++)
{
int X=N,sum=0;
while(X)
{
sum+=X%i;
X=X/i;
}
if(S==sum)
{
cout<<i;
... | a.cc: In function 'int main()':
a.cc:44:12: error: 's' was not declared in this scope
44 | if(s==1)
| ^
|
s516701950 | p04016 | C++ | #include <bits/stdc++.h>
#define MaxN 100005
using namespace std;
long long S,N,ans;
int main()
{
cin>>N>>S;
ans=N;
for(int i=2;i*i<=N;i++)
{
int X=N,sum=0;
while(X)
{
sum+=X%i;
X=X/i;
}
if(S==sum)
{
cout<<i;
... | a.cc: In function 'int main()':
a.cc:39:20: error: no matching function for call to 'min(long long int&, int&)'
39 | ans=min(ans,j);
| ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s305006583 | p04016 | C++ |
// MAGRANT - GNC19 - TEMPLATE 3.2
// 2017/8/22 - AtCoder Regular Contest 060 - D
// PRACTISING TIME TAGS:
// ALGORITHM: ##MIN, STARTED AT:
// CODING: ##MIN, STARTED AT:
// SUMMARY: [MISTAKES / REQUISITES]
// FOR COMPATIBILITY:
#define _CRT_SECURE_NO_WARNINGS
// UNIVERSAL DEFINITIONS:
#define N (1<<17)
#define MODULO... | a.cc: In function 'int main()':
a.cc:142:25: error: 'LLONG_MAX' was not declared in this scope
142 | long long Ans = LLONG_MAX;
| ^~~~~~~~~
a.cc:35:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
34 | #include <com... |
s790449248 | p04016 | C++ |
if(s == 1){
cout << n << endl;
return 0;
}else if(s > n){
cout << -1 << endl;
return 0;
}else if(s == n){
cout << n+1 << endl;
return 0;
}else{
lli sn = int(sqrt(n))+1;
for(lli i = 2; i<=sn; i++) if(f(i,n) == s){
cout << i << endl;
return 0;
}
for(lli i = sn; i >= 1; i--) if(s>=i && (n-(s... | a.cc:2:9: error: expected unqualified-id before 'if'
2 | if(s == 1){
| ^~
a.cc:5:10: error: expected unqualified-id before 'else'
5 | }else if(s > n){
| ^~~~
a.cc:8:10: error: expected unqualified-id before 'else'
8 | }else if(s == n){
| ^~... |
s026390058 | p04016 | C++ | #include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <random>
#include <deque>
#define INF_LL 1e18
#define INF 1e9
#define REP(i, ... | a.cc: In function 'int main()':
a.cc:133:9: error: 'cin' was not declared in this scope
133 | cin >> n >> s;
| ^~~
a.cc:15:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
14 | #include <random>
+++ |+#include <iostream>
15 |... |
s396630247 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <array>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#define MOD 1000000007
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL n, s;... | a.cc: In function 'int main()':
a.cc:40:34: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
40 | for (LL i = 2; i <= std::sqrt(n); ++i)
| ^~~~
| sort
a.cc:49:34: error: 'sqrt' is not a member of 'std'; did you mean 'so... |
s936453562 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <set>
#include <array>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#define MOD 1000000007
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
LL n, s;... | a.cc: In function 'int main()':
a.cc:40:29: error: 'sqrt' was not declared in this scope
40 | for (LL i = 2; i <= sqrt(n); ++i)
| ^~~~
a.cc:49:29: error: 'sqrt' was not declared in this scope
49 | for (LL i = 1; i <= sqrt(n); ++i)
| ... |
s693888061 | p04016 | Java | arc060;
import static java.lang.Math.*;
import java.util.Arrays;
import java.util.Scanner;
/**
* http://arc060.contest.atcoder.jp/tasks/arc060_b
* f(b,n) は、n を b 進表記したときの各桁の和
* f(b,n)=s を満たすような 2 以上の整数 b が存在するか判定(存在する場合は最小のb)
*
* @author Cummin
*/
/**
* 例: b=10の場合、123=1*100+2*10+3 ⇒ 1*(99+1)+2(9+1)+3=9*(1*... | Main.java:1: error: class, interface, enum, or record expected
arc060;
^
Main.java:3: error: class, interface, enum, or record expected
import static java.lang.Math.*;
^
Main.java:4: error: class, interface, enum, or record expected
import java.util.Arrays;
^
Main.java:5: error: class, interface, enum, or record expect... |
s333117424 | p04016 | 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... |
s800038630 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define INF 2000000000000LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll n,s;
int main(vo... | a.cc: In function 'int main()':
a.cc:35:20: error: 'b' was not declared in this scope
35 | if(b*p==n-s+p)res=min(res,b);
| ^
|
s996674786 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define INF 2000000000000LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll n,s;
int main(vo... | a.cc: In function 'int main()':
a.cc:39:37: error: no matching function for call to 'max(int, ll)'
39 | for(ll j=max(1,n/(i+1LL));j*j<=min(rest,n/i);j++){
| ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:62,
from a.cc:... |
s442345389 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define INF 2000000000000LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll n,s;
int main(vo... | a.cc: In function 'int main()':
a.cc:43:43: error: 'ss' was not declared in this scope; did you mean 's'?
43 | for(ll j=max(1,n/(ss+1LL));j*j<=min(rest,n/ss);j++){
| ^~
| s
|
s790295083 | p04016 | C++ | #include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <string>
#include <algorithm>
#include <iostream>
#include <map>
#include <set>
#include <functional>
#include <iostream>
#define INF 2000000000LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
ll n,s;
int main(void)... | a.cc: In function 'int main()':
a.cc:36:18: error: 'b' was not declared in this scope
36 | ll sqr=n/b;
| ^
|
s893893463 | p04016 | C++ | #include <bits/stdc++.h>
using namespace std;
namespace {
typedef double real;
typedef long long ll;
template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
if (vs.empty()) return os << "[]";
os << "[" << vs[0];
for (int i = 1; i < vs.size(); i++) os << " " << v... | a.cc:55:9: error: 'cout' does not name a type
55 | cout << -1 << endl;
| ^~~~
a.cc:58:1: error: expected declaration before '}' token
58 | }
| ^
|
s719782022 | p04016 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
ll n,s,i,j,k,ans=-1;
cin>>n>>s;
cout << ans << endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:4:3: error: 'll' was not declared in this scope
4 | ll n,s,i,j,k,ans=-1;
| ^~
a.cc:5:8: error: 'n' was not declared in this scope; did you mean 'yn'?
5 | cin>>n>>s;
| ^
| yn
a.cc:5:11: error: 's' was not declared in this scope
5 | ... |
s232809209 | p04016 | C++ | int main(){
cout<<-1<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:2:1: error: 'cout' was not declared in this scope
2 | cout<<-1<<endl;
| ^~~~
a.cc:2:11: error: 'endl' was not declared in this scope
2 | cout<<-1<<endl;
| ^~~~
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.