submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s820225190
p03779
Java
import java.util.Scanner; public class Sample { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int X = scan.nextInt(); int sum =0; int d =0; int l =0; int g =0; for(int i=0;i<=X;i++){ sum += i; if(X<=sum){ d = i; break; } ...
Main.java:2: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s509951242
p03779
Java
import java.util.Scanner; public class Sample { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner scan = new Scanner(System.in); int X = scan.nextInt(); int sum =0; int d =0; int l =0; int g =0; for(int i=0;i<=X;i++){ sum += i; if(X-sum>i){ d = X-sum; }else{ ...
Main.java:2: error: class Sample is public, should be declared in a file named Sample.java public class Sample { ^ 1 error
s831950312
p03779
Java
import java.util.*; public class ABC056_C{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long x = sc.nextLong(); long sum = 0; long i = 0; while(sum<x){ sum+=(i+1); i++; } System.out.println(i); return; } }
Main.java:2: error: class ABC056_C is public, should be declared in a file named ABC056_C.java public class ABC056_C{ ^ 1 error
s833926290
p03779
Java
import java.util.*; public class ABC056_C{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); long x = sc.nextLong(); long sum = 0; long i = 0; while(sum<x){ sum+=(i+1); i++; } System.out.println(i); return; } }
Main.java:2: error: class ABC056_C is public, should be declared in a file named ABC056_C.java public class ABC056_C{ ^ 1 error
s078657068
p03779
C++
#include <iostream> using namespace std; int main(){ long long int X; int sum=0; cin>>X; for(int i=1 ; ; i++){ //i=0だとわかりにくい sum+=i; if(sum>=X){ break; cout<<i<<endl; ...
a.cc:1:2: error: extended character   is not valid in an identifier 1 | #include <iostream> | ^ a.cc:1:2: error: invalid preprocessing directive #include\U00003000 1 | #include <iostream> | ^~~~~~~~~ a.cc: In function 'int main()': a.cc:6:11: error: 'cin' was not declared in this scope 6 | ...
s258940498
p03779
C++
#include <iostream> #include <sstream> #include <vector> #include <cmath> #include <ctime> #include <cassert> #include <iomanip> #include <cstdio> #include <float.h> #include <queue> #include <set> #include <map> #include <fstream> #include <cstdlib> #include <string> #include <cstring> #include <algorithm> #include <n...
a.cc: In function 'int main()': a.cc:74:9: error: 'sum' was not declared in this scope; did you mean 'summ'? 74 | sum[i] = (i*(i+1))/2; | ^~~ | summ
s336536651
p03779
C++
using namespace std; int main(){ int n; cin>>n; int i=1; for(;i<100000;i++){ if((i*(i+1)/2) < n)continue; cout<<i<<endl; break; } return 0; }
a.cc: In function 'int main()': a.cc:3:8: error: 'cin' was not declared in this scope 3 | int n; cin>>n; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | using namespace std; a.cc:7:2: error:...
s666090001
p03779
C++
#include<bits/stdc++.h> using namespace std; main(){ int x.i=1; cin>>x; while(1){ if(ans+i>=x){ans=i;break;} ans+=i; i++; } cout<<ans<<endl; }
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 3 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:4:7: error: expected initializer before '.' token 4 | int x.i=1; | ^ a.cc:5:7: error: 'x' was not declared in this scope 5 | cin>>x; | ...
s762628235
p03779
C
#include <stdio.h> using namespace std; int main() { int x; scanf("%d",&x); int i=0; int t=0; while(t<x) { i++; t+=i; } printf("%d\n",i); return 0; }
main.c:2:1: error: unknown type name 'using' 2 | using namespace std; | ^~~~~ main.c:2:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std' 2 | using namespace std; | ^~~
s262386478
p03779
Java
import java.util.Scanner; public class Go_home { public static void main(String[] args){ Scanner read = new Scanner(System.in); int x = Integer.parseInt(read.nextLine()); int c = 0; int sum = 0; while (sum < x){ c++; sum += c; } ...
Main.java:2: error: class Go_home is public, should be declared in a file named Go_home.java public class Go_home { ^ 1 error
s809212105
p03779
Java
import java.util.Scanner; public static void main(String[] args){ Scanner read = new Scanner(System.in); int x = Integer.parseInt(read.nextLine()); int c = 0; int sum = 0; while (sum < x){ c++; sum += c; } System.out.println(c...
Main.java:3: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args){ ^ (use --enable-preview to enable unnamed classes) 1 error
s034298883
p03779
Java
import java.util.Scanner; public class Go_home { public static void main(String[] args){ Scanner read = new Scanner(System.in); int x = Integer.parseInt(read.nextLine()); int c = 0; int sum = 0; while (sum < x){ c++; sum += c; } ...
Main.java:2: error: class Go_home is public, should be declared in a file named Go_home.java public class Go_home { ^ 1 error
s308441739
p03779
C++
#include <iostream> #include <vector> using namespace std; int main() { int X; cin >> X; int answer = 0; vector<int> list; int place = 0; int i = 1; bool get_answer = false; list.push_back(place); while (true) { sort(list.begin(), list.end()); list.erase(unique(list.begin(), list.end()),...
a.cc: In function 'int main()': a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'short'? 18 | sort(list.begin(), list.end()); | ^~~~ | short a.cc:19:16: error: 'unique' was not declared in this scope 19 | list.erase(unique(list.begin(), list.end()), list.end()); ...
s730065316
p03779
C++
#include<iostream> #include<vector> #include<utility> using namespace std; int x; typedef pair<int, int> pp; vector<pp> q; int main() { cin >> x; q.push_back(pp(-1, 0)); int now = 0; while (true) { pp tmp = q[now++]; if (tmp.second == x) { cout << tmp.first << endl; ...
a.cc:30:2: error: expected class-name at end of input 30 | ~ | ^
s720224495
p03779
C++
#include<iostream> #include<utility> using namespace std; int x; typedef pair<int, int> pp; vector<pp> q; int main() { cin >> x; q.push_back(pp(-1, 0)); int now = 0; while (true) { pp tmp = q[now++]; if (tmp.second == x) { cout << tmp.first << endl; return 0; ...
a.cc:7:1: error: 'vector' does not name a type 7 | vector<pp> q; | ^~~~~~ a.cc: In function 'int main()': a.cc:12:5: error: 'q' was not declared in this scope 12 | q.push_back(pp(-1, 0)); | ^
s139761787
p03779
C++
#pragma once #include <stdio.h> #include <iostream> #include <string> #include <algorithm> #include <vector> using namespace std; long long int X,result,time; int main() { cin >> X; for (long long int i = 1; i < 1000000000; i++) { if (time >= X) { break; } result++; time += i; } cout << result<...
a.cc:1:9: warning: #pragma once in main file 1 | #pragma once | ^~~~ a.cc:10:24: error: 'long long int time' redeclared as different kind of entity 10 | long long int X,result,time; | ^~~~ In file included from /usr/include/pthread.h:23, from /usr/inclu...
s634733352
p03779
C++
#include <iostream> #include <vector> using namespace std; int X,ans = 0,s = 1; vector<int > x; int solve(){ while(true){ vector<int > xx; for (int i = 0; i < x.size(); ++i) { if(find(xx.begin(), xx.end(),x[i]+s) == xx.end())xx.push_back(x[i]+s); if(find(xx.begin(), xx.end(),x[i]) == xx.end())xx.push_back(...
a.cc: In function 'int solve()': a.cc:11:32: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, __gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type)' 11 | if(find(xx.begin(), xx.end(),x[i]+s) == xx.end())xx.push_back(x[i]+s); ...
s332967228
p03779
C++
using namespace std; int main(void) { long long x, i, j, ans = 0; cin >> x; for (i = 0; ans < x; i++) { ans += i; } cout << i - 1 << endl; return 0; }
a.cc: In function 'int main()': a.cc:6:9: error: 'cin' was not declared in this scope 6 | cin >> x; | ^~~ a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' +++ |+#include <iostream> 1 | a.cc:10:9: error: 'cout' was not...
s725902044
p03779
C++
#include<cstdio> #include <iostream> #include<algorithm> #include<string> #include<queue> #include<vector> #include<functional> #include<cmath> #include<map> #include<stack> #include<set> #include<numeric> #define rep(i,n) for(int i=0; i<int(n); i++) using namespace std; typedef long long ll; typedef pair<int, int>P; ...
a.cc:19:15: error: 'll time [100010]' redeclared as different kind of entity 19 | ll time[100010]; | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linux-gnu/c++/14/bit...
s454225073
p03779
C++
#include<cstdio> #include <iostream> #include<algorithm> #include<string> #include<queue> #include<vector> #include<functional> #include<cmath> #include<map> #include<stack> #include<set> #include<numeric> #define rep(i,n) for(int i=0; i<int(n); i++) using namespace std; typedef long long ll; typedef pair<int, int>P; ...
a.cc:19:17: error: 'std::vector<int> time' redeclared as different kind of entity 19 | vector<int> time(100010); | ^ In file included from /usr/include/pthread.h:23, from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35, from /usr/include/x86_64-linu...
s137240374
p03779
C++
#include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include<queue> using namespace std; int gcd(int a,int b) { if(b == 0) return a; return gcd(b,a%b); }a int main() { int x; while(cin>>x) { int sum=0; int i; for(i=1; sum<=x; i++) { ...
a.cc:11:2: error: 'a' does not name a type 11 | }a | ^
s154089687
p03780
Java
import java.util.*; import java.io.*; public class A { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new DataInputStream(System.in); ...
Main.java:4: error: class A is public, should be declared in a file named A.java public class A { ^ 1 error
s414291999
p03780
C++
// ----------------------------------- // author : MatsuTaku // country : Japan // created : 09/05/20 00:39:46 // ----------------------------------- #include <bits/stdc++.h> using namespace std; using ll = long long; #include "../../../library/include/convolution.hpp" #include "../../../library/include/ntt.hpp"...
a.cc:12:10: fatal error: ../../../library/include/convolution.hpp: No such file or directory 12 | #include "../../../library/include/convolution.hpp" | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s245110638
p03780
C++
#include<bits/stdc++.h> #define ll long long #define ull unsigned long long #define pii pair<int,int> #define pp pair<pair<ll, ll>,pair<ll, ll>> #define pll pair<ll,ll> #define ppll pair<ll,pll> #define pdd pair<double,double> #define vii vector<int> #define vll vector<ll> #define mat vector<vector<ll>> #define lb lowe...
a.cc: In function 'void solve()': a.cc:82:17: error: 'dp' was not declared in this scope; did you mean 'dp2'? 82 | dp[i].pb(j); | ^~ | dp2
s256067790
p03780
C++
#include <bits/stdc++.h> #ifdef NON_SUBMIT #define TEST(n) (n) #define tout cerr #else #define TEST(n) ((void)0) #define tout cin #endif using namespace std; vector<int> A(1), T; bitset<5000> D[5001], D2; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); TEST(freopen("input.txt","r",stdin)...
a.cc: In function 'int main()': a.cc:45:20: error: 'j' was not declared in this scope 45 | D2[j]|=D2[j]<<A[i]; | ^
s999729837
p03780
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vec; typedef vector<vec> mat; typedef pair<ll,ll> pll; const ll mod=1e9+7; //const ll mod=998244353; const ll inf=1LL<<61; int main() { ll n,k; cin >> n >> k; vec a(n); for(ll i=0;i<n;i++) cin >> a[i]; sort(a.begin(),a.end(...
a.cc: In function 'int main()': a.cc:31:17: error: no matching function for call to 'max(ll, int)' 31 | for(ll i=max(k-a[m],0);i<k;i++) { | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s343618968
p03780
C
#include<stdio.h> int main(){ int n,k,i,j,l,g,c=0; int a[5001],dp1[5001][5001],dp2[5001][5001]; scanf("%d%d",&n,&k); for(i=0;i<n;i++)scanf("%d",&a[i]); for(i=0;i<=n;i++)for(j=0;j<=k;j++)dp1[i][j]=dp2[i][j]=0; dp1[0][0]=dp2[n][0]=1; for(i=0;i<n;i++)for(j=0;j<=k;j++)dp1[i+1][j]=dp1[i][j]|(j<a[i]?0:dp1[i][j-...
main.c: In function 'main': main.c:15:3: error: expected declaration or statement at end of input 15 | } | ^
s696705030
p03780
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); long[] a = new long[n]; for(int i = 0; i < n; i++) { a[i] = sc.nextLong(); } Arrays.sort(a); int ans = 0; int le...
Main.java:34: error: incompatible types: possible lossy conversion from long to int if((i != med) && (j >= a[i])) dp[i][j] = (dp[i][j] || dp[i - 1][j - a[i]]); ^ 1 error
s404778451
p03780
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); long[] a = new long[n]; for(int i = 0; i < n; i++) { a[i] = sc.nextLong(); } Arrays.sort(a); int ans = 0; int lef...
Main.java:21: error: incompatible types: possible lossy conversion from long to int if(a[0] < k) dp[0][a[0]] = true; ^ Main.java:26: error: incompatible types: possible lossy conversion from long to int if(a[1] < k) dp[1][a[1]] = true; ^ Main.j...
s318320086
p03780
C++
#define SIZE 5005 using namespace std; typedef long long int ll; typedef pair <int,int> P; bool dp[SIZE]; int A[SIZE]; P pos[SIZE]; int main() { int n,K; scanf("%d %d",&n,&K); for(int i=0;i<n;i++) scanf("%d",&A[i]); sort(A,A+n); ll sum=0; for(int i=0;i<n;i++) sum+=A[i]; memset(dp,false,sizeof(dp)); dp[0]=...
a.cc:5:9: error: 'pair' does not name a type 5 | typedef pair <int,int> P; | ^~~~ a.cc:9:1: error: 'P' does not name a type 9 | P pos[SIZE]; | ^ a.cc: In function 'int main()': a.cc:14:9: error: 'scanf' was not declared in this scope 14 | scanf("%d %d",&n,&K); | ^~~~...
s431496255
p03780
C++
#include<iostream> #include<algorithm> using namespace std; int main() { long long w,a,b,i,j,k,n; cin>>n>>k; long long ara[n]; for(i=0;i<n;i++) cin>>ara[i]; sort(ara,ara+n); for(i=n-1;i>=0;i--){ if(ara[i]<k) { a=i; break; } } long long sum=0; ...
a.cc:34:5: error: expected unqualified-id before 'for' 34 | for(i=0;i<=a;i++){ | ^~~ a.cc:34:13: error: 'i' does not name a type 34 | for(i=0;i<=a;i++){ | ^ a.cc:34:18: error: 'i' does not name a type 34 | for(i=0;i<=a;i++){ | ^ a.cc:41:5: error: '...
s259738669
p03780
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++) #define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++) #define MOD 1000000007 #define int long long #define ALL(a) (a).begin(),(a).end() #define vi vector<int> #define vii vector<vi> #define pii pair<int,int> #define priq...
a.cc: In function 'int main()': a.cc:48:10: error: 'F' was not declared in this scope 48 | if(F[j]){ | ^
s011832997
p03780
C++
#include <bits/stdc++.h> using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; using P = pair<int, int>; const int INF = 1e9; const long long LINF = 1e18; const long long MOD = 1e9 + 7; signed main() { int n, k; cin >> n >> k; ll a[...
a.cc: In function 'int main()': a.cc:38:25: error: no matching function for call to 'max(int, ll)' 38 | for (int j = max(0, k - a[i]); j < k; j++) { | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14...
s080712874
p03780
C++
#include <bits/stdc++.h> #define int long long #define _overload3(_1,_2,_3,name,...) name #define _rep(i,n) repi(i,0,n) #define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++) #define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__) #define all(box) box.begin(), box.end() using namespace std; us...
a.cc: In function 'int main()': a.cc:55:39: error: 'chmin' was not declared in this scope 55 | if(l<t.size())chmin(mn,s[j]+a[i]+t[l]); | ^~~~~
s906483251
p03780
C++
#ifndef DEBUG # define NDEBUG #endif #include <iostream> #include <string> #include <iterator> #include <utility> #include <type_traits> #include <limits> #include <cassert> #include <bitset> #include <vector> using namespace std; // template {{{ // misc {{{ using Z = int; [[maybe_unused]] constexpr Z INF = numeric_...
a.cc: In function 'int main()': a.cc:120:3: error: 'sort' was not declared in this scope; did you mean 'short'? 120 | sort(begin(as), end(as)); | ^~~~ | short
s635663118
p03780
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin >> n >> k; vector<long>a(n); int i,j; for(i=0;i<n;i++){ cin >> a[i]; } sort(a.begin(),a.end(),greater<long>()); vector<set<long> >num(n); int tmp = 0; vector<bool>chk(n,false); for(i=0;i<n;i++){ num[i].insert(a[i]); ...
a.cc: In function 'int main()': a.cc:22:17: error: expected ',' or ';' before ':' token 22 | long tmppp = 0: | ^ a.cc:23:20: error: expected ';' before ')' token 23 | for(i=tmp;i<n;i++){ | ^ | ;
s287657719
p03780
C++
#include <bits/stdc++.h> using namespace std; int n,k; vector<int> a; bool ok(int p) { if(a[p]>=k) return true; vector<vector<char> > dp(vector<char>(k)); dp[0][0]=true; for(int i=0;i<n;++i) { for(int j=0;j<k;++j) { dp[i+1][j]|=dp[i][j]; if(i==p||j+a[i]>=k) continue; dp[i+1][j+a[i]]|=dp[i][j]; if(j...
a.cc: In function 'bool ok(int)': a.cc:10:33: warning: parentheses were disambiguated as a function declaration [-Wvexing-parse] 10 | vector<vector<char> > dp(vector<char>(k)); | ^~~~~~~~~~~~~~~~~ a.cc:10:33: note: replace parentheses with braces to declare a variable ...
s506656549
p03780
C++
#include <iostream> #include <vector> #include <string> #include <cstring> #include <algorithm> #include <cmath> #include <set> #include <map> #include <stack> #include <queue> #include <iomanip> #include <cassert> #include <random> #include <tuple> #include <cstdint> #include <complex> #define rep(i,n) for (int i = 0...
a.cc: In function 'int main()': a.cc:50:32: error: no match for 'operator|=' (operand types are 'std::vector<bool>::reference' and 'std::vector<bool>::reference') 50 | dp[i+1][j] |= dp[i][j]; | ~~~~~~~~~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/bits/memory_...
s696545513
p03780
C++
#include<iostream> #include<string> #include<cstdio> #include<cstring> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<deque> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> #include<stack> #include<un...
a.cc: In function 'void solve()': a.cc:67:20: error: no matching function for call to 'max(int, long long int)' 67 | int s = max(0, k - a[i]); | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s784333081
p03780
C++
/** * code generated by JHelper * More info: https://github.com/AlexeyDmitriev/JHelper * @author Gosu_Hiroo */ #include <iostream> #include <fstream> #include <bits/stdc++.h> using namespace std; using ll = long long; #ifdef int #define V2(v,size_1, size_2, value) vector<vector<long long>>v(size_1, vector<long l...
a.cc: In lambda function: a.cc:301:91: error: no matching function for call to 'max(long long int, int)' 301 | while(p_L != L[rmv].end() && p_R != R[rmv+1].rend() && (*p_L + *p_R )< max(1ll, K - a[rmv]))p_L++; | ...
s178296735
p03780
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) #define MOD 10e9+7 int main(){ int N, K; cin >> N >> K; int a[N]; rep(i, N) cin >> a[i]; sort(a,a+N,greater<int>()); int cnt = N; for(int i=0; i<N){ long int sum = 0; for(int j=i; j<N; j++){ ...
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before ')' token 12 | for(int i=0; i<N){ | ^ | ;
s921310931
p03780
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,n) for(int i=0; i<n; i++) #define MOD 10e9+7 int main(){ int N, K; cin >> N >> K; int a[N]; rep(i, N) cin >> a[i]; sort(a,a+N,greater<int>()); int cnt = N; for(int i=0; i<N){ long int sum = 0; for(int j=i; j<N; j++){ ...
a.cc: In function 'int main()': a.cc:12:21: error: expected ';' before ')' token 12 | for(int i=0; i<N){ | ^ | ; a.cc: At global scope: a.cc:27:1: error: expected unqualified-id before numeric constant 27 | 6 20 | ^
s696961186
p03780
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(int i=1;i<=(n);i++) #define rep0(i,n) for(int i=0;i<(n);i++) const ll INF=1e9+7; int n,m,a[5001],l,r; bool jl[INF]; bool dp[5001]; bool check(int k){ // cout<<k<<endl; memset(dp,0,sizeof(dp)); dp[0]=1; rep(i,n){ if(i==k){ ...
a.cc: In function 'int main()': a.cc:62:23: error: reference to 'hash' is ambiguous 62 | if(jl[hash(l,r)]){ | ^~~~ In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include...
s770630887
p03780
C++
#include<bits/stdc++.h> using namespace std; #define ll long long #define rep(i,n) for(ll i=1;i<=(n);i++) #define rep0(i,n) for(ll i=0;i<(n);i++) const ll INF=1e9+7; ll n,m,a[5001],g,l,r; bool jl[INF]; bool dp[5001]; bool check(int k){ // cout<<k<<endl; memset(dp,0,sizeof(dp)); dp[0]=1; rep(i,n){ if(i==k){ c...
a.cc: In function 'int main()': a.cc:63:23: error: reference to 'hash' is ambiguous 63 | if(jl[hash(l,r)]){ | ^~~~ In file included from /usr/include/c++/14/string_view:50, from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include...
s163905307
p03780
C++
#include <algorithm> #include <deque> #include <functional> #include <iomanip> #include <iostream> #include <limits.h> #include <map> #include <math.h> #include <queue> #include <set> #include <string> #include <string.h> #include <unordered_map> #include <unordered_set> #include <vector> #define rep(i,n) for(int i=0;i...
a.cc: In function 'int main()': a.cc:65:59: error: expected ')' before ']' token 65 | if (dp[1][1][k - 1] == dp[1][1][max((ll)0,k - a[0]]))ans++; | ~ ^ | ) a.cc:65:61: error: expected...
s706927988
p03780
C++
#include <bits/stdc++.h> #define int long long #define rep(i,n) for(int i=0;i<n;i++) using namespace std; #define all(v) v.begin(),v.end() int n,k,a[5010]; bool dp1[5010][5010],dp2[5010][5010]; signed main(){ cin>>n>>k; rep(i,n)cin>>a[i]; dp1[0][0]=true; rep(i,n-1){ rep(j,k){ if(dp1[i][j])dp1[i+1][j]=true; ...
a.cc: In function 'int main()': a.cc:36:20: error: 'b' was not declared in this scope 36 | if(b==false)ans++; | ^
s613713269
p03780
C
#include<stdio.h> #define d_flag 0 int C(const void *a,const void *b){ return *(int*)b-*(int*)a; } int main(){ int n,K,count=0; scanf("%d%d",&n,&K); int i,a[n]; for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i]>=K){ i--; n--; } } sqrt(a,n,sizeof(int),C); if(d_flag) { for(i=0;i<n;...
main.c: In function 'main': main.c:18:3: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 18 | sqrt(a,n,sizeof(int),C); | ^~~~ main.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt' 1 | #include<stdio.h> +++ |+#include <math.h> 2 | #define d_flag 0...
s626635526
p03780
C++
#include <bits/stdc++.h> using namespace std; int main() { int n, k, i, sum = 0; cin >> n >> k; vector<int> a(n); for(i = 0; i < n; i++){ cin >> a.at(i); sum += a.at(i); } if(sum < k){ cout << n << endl; } else{ for(i = 0; i < n; i++){ if(a.at(i) <= sum - k){ count++; ...
a.cc: In function 'int main()': a.cc:20:12: error: no post-increment operator for type 20 | count++; | ^~ a.cc:23:10: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '<unresolved overloaded function type>') 23 | cout << count << en...
s133073666
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int main(){ int N, K;cin>>N>>K; vi a; a.push_back(0); for (int i=0;i<N;++i){ int a_;cin>>a_;a.push_back(a_); } a.push_back(0); int left[2][K+1], right[2][K+1]; memset(left, -1, sizeof(left)); memset(right, -1, sizeof(right))...
a.cc: In function 'int main()': a.cc:30:12: error: invalid array assignment 30 | left[0]=left[1]; | ~~~~~~~^~~~~~~~ a.cc:40:13: error: invalid array assignment 40 | right[0]=right[1]; | ~~~~~~~~^~~~~~~~~
s104015834
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int main(){ int N, K;cin>>N>>K; vi a; a.push_back(0); for (int i=0;i<N;++i){ int a_;cin>>a_;a.push_back(a_); } a.push_back(0); int left[N+2][K+1], right[N+2][K+1]; memset(left, -1, sizeof(left)); memset(right, -1, sizeof(right...
a.cc: In function 'int main()': a.cc:46:7: error: 'x' was not declared in this scope 46 | x=lower_bound(r_sum[i+1].begin(), r_sum[i+1].end(), K-l_sum[i-1][l]-a[i])-l_sum[i-1].begin(); | ^
s621267055
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; int main(){ int N, K;cin>>N>>K; vi a; for (int i=0;i<N;++i){ int a_;cin>>a_;a.push_back(a_); } int left[N][K], right[N][K]; memset(left, -1, sizeof(left)); memset(right, -1, sizeof(right)); left[0][0]=1;left[0][a[0]]=1; right...
a.cc: In function 'int main()': a.cc:21:70: error: 'k' was not declared in this scope 21 | if(left[i][j]==1||(j>=a[i+1]&&left[i][j-a[i+1]]==1)) left[i+1][k]=1; | ^ a.cc:27:70: error: 'k' was not declared in this scope 27 | if(l...
s791517994
p03780
C++
#include <stdio.h> #include <iostream> #include <vector> #define ll long long #define rep2(i,a,b) for(ll i=a;i<=b;i++) #define rep(i,n) for(ll i=0;i<n;i++) #define rep3(i,a,b) for(ll i=a;i>=b;i--) #define vec vector<int> #define All(c) (c).begin(),(c).end() using namespace std; int in() {int x;scanf("%d",&x);return x;}...
a.cc: In function 'int main()': a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'? 28 | sort(All(a)); | ^~~~ | short
s326893726
p03780
C++
#include <cstdio> #include <algorithm> #include <cstring> #define MAXN 5050 #define ll long long using namespace std; int a[MAXN], dp[MAXN][MAXN]; int n, k; /* dp[i][j]表示从前i个元素中是否可以选择一些数使得它们的和为j 一般情况:dp[i,j] = dp[i-1][j]; 状态转移方程:当j大于ai时:dp[i,j] = dp[i-1,j]|dp[i-1,j-ai] 1、排序 2、如果ai是不必要的元素,那么ai之前的元素都是不必要的,...
a.cc: In function 'int main()': a.cc:54:44: error: expected ';' before 'else' 54 | if(a[1] >= k) printf("0\n") | ^ | ; 55 | else printf("1\n"); | ~~~~ ...
s358535974
p03780
C++
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<stdint.h> #include<malloc.h> #include<x86intrin.h> int my_gets(char *buf,int nBuf,FILE *fp){ int ch; while(--nBuf >0){ ch=getc(fp); if(ch==EOF || ch=='\n') break; *(buf++)=(char)ch; } *(buf)='\0'; ...
a.cc: In function 'int main()': a.cc:54:39: error: 'INT_MAX' was not declared in this scope 54 | int dp[5001][5000]={},K_i,min=INT_MAX; | ^~~~~~~ a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' ...
s144867115
p03780
C++
#include <stdio.h> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <list> #include <queue> #include <stack> #include <cmath> #include <ctime> #include <cstdio> #include <vector> #include <string> #include <bitset> #include <cctype> #include <cstdlib> #include <cstring> #include...
a.cc: In function 'int main()': a.cc:129:19: error: 'INT_MAX' was not declared in this scope 129 | int min_len = INT_MAX; | ^~~~~~~ a.cc:30:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 29 | #include <functional> +++ |+#in...
s423462207
p03780
C++
#include<iostream> #include<algorithm> #include<cmath> #include<cstring> #include<cstdlib> #include<ctime> #include<cstdio> #include<string> //#include<string> //#include<sstream> typedef long long ll; #define N 5050 int a[N]={0}; int main(){ ll n,k; cin>>n>>k; for(int i=0; i<n; i++){ cin>>a[i]; ...
a.cc: In function 'int main()': a.cc:16:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 16 | cin>>n>>k; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linke...
s124362719
p03780
C++
#include <iostream> #include <set> #include <map> #include <vector> using namespace std; typedef long long ll; int a[5001]; int main(int argc, const char * argv[]) { int n, k; cin >> n >> k; int ans = n; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int sum = 0; for (in...
a.cc: In function 'int main(int, const char**)': a.cc:21:3: error: 'sort' was not declared in this scope; did you mean 'short'? 21 | sort(a, a + n); | ^~~~ | short
s115434746
p03780
C++
#include <iostream> #include <set> #include <map> #include <vector> using namespace std; typedef long long ll; int main(int argc, const char * argv[]) { int n, k; cin >> n >> k; int a[5001]; int ans = n; for (int i = 0; i < n; i++) { cin >> a[i]; } sort(a, a + n); int sum = 0; for (i...
a.cc: In function 'int main(int, const char**)': a.cc:20:3: error: 'sort' was not declared in this scope; did you mean 'short'? 20 | sort(a, a + n); | ^~~~ | short
s291669846
p03780
C++
#include <bits/stdc++.h> using namespace std; #define IOS ios::sync_with_stdio(false), cin.tie(0) #define REP(i, n) for (int i = 0; i < n; i++) #define FOR(i, a, b) for (int i = a; i < b; i++) #define ALL(x) (x).begin(), (x).end() #define dump(x) cout << (x) << endl #define LMAX 9223372036854775807LL #define LMIN -9223...
a.cc: In function 'int main()': a.cc:59:24: error: no matching function for call to 'max(ll, long long int)' 59 | for(int j = max(k - a[mid],0ll);j < k;j++)if(dp[n][j])ok = true; | ~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr...
s386424918
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; #define LLINF 9223372036854775807 #define MOD ll(1e9+7) int main(){ int n, k; cin >> n >> k; vector<int> a; for(int i = 0; i < n; i++){ int ta; cin >> ta; if(...
a.cc: In function 'int main()': a.cc:44:46: error: 'Q' was not declared in this scope 44 | dp2[i+1][min(j+a[index],k)] +Q= dp2[i][j]; | ^
s167222404
p03780
C++
#include <cstdio> #include<bitset> #include<iostream> #include<string> #define ll long long using namespace std; long long n,k; ll a[5010]; bitset<5010> bs; bool check(int x) { bs.reset(); bs[0]=1; for(int i=1;i<=n;i++) if(i!=x) bs|=(bs<<a[i]); for(int i=k-a[x];i<k;i++) if(bs[i]==1) return false; return true; }...
a.cc: In function 'int main()': a.cc:25:9: error: 'sort' was not declared in this scope; did you mean 'short'? 25 | sort(a+1,a+n+1); | ^~~~ | short
s497581004
p03780
C++
#include <cstdio> #include <algorithm> #include <bitset> #define MAXN 50005 #define MAXBS 70005 using namespace std; bitset<MAXBS> bs; long long a[MAXN]={0}; long long n=0,k=0; long long check(long long x); int main(void){ long long ll=0,rr=0; scanf("%lld%lld",&n,&k); for (int i=0;i<n;i++){ scanf("%...
a.cc: In function 'long long int check(long long int)': a.cc:42:25: error: no matching function for call to 'max(int, long long int)' 42 | for (long long i=max(0,k-a[x]);i<k;i++){ | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from a.cc:2: /usr...
s028748630
p03780
C++
#include <cstdio> #include <algorithm> #include <bitset> #define MAXN 5005 #define MAXBS 7005 using namespace std; bitset<MAXBS> bs; int a[MAXN]; int n,k; int check(int x); int main(void){ int ll,rr; scanf("%d%d",&n,&k); for (int i=0;i<n;i++){ scanf("%d",a+i); a[i]=min(a[i],k); } sor...
a.cc: In function 'int check(int)': a.cc:33:7: error: no match for call to '(std::bitset<7005>) (int)' 33 | bs(0) | ~~^~~
s703502497
p03780
C++
#include<iostream> using namespace std; int n,s,k,a[5001],dp[5001],vis=1; int main() { ios::sync_with_stdio(false); cin>>n>>k; for(int i=1;i<=n;i++) { cin>>a[i]; a[i]=min(a[i],k); s+=a[i]; } sort(a+1,a+n+1); dp[0]=1; for(int i=n;i>=0;i--) { vis=1; for(int j=k-1;j>=k-s and j>=0;j--) { if(dp[j])v...
a.cc: In function 'int main()': a.cc:14:9: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(a+1,a+n+1); | ^~~~ | short
s234662569
p03780
C++
#include <bits/stdc++.h> #define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(long long int i=(a);i<(b);i++) #define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--) #define all(v) (v).begin(), (v).end() #define pb(q) push_back(q) #define Size(n) (n).size() #define Cout(x) cout<<(x)<<en...
a.cc: In function 'int main()': a.cc:33:18: error: the value of 'k' is not usable in a constant expression 33 | bitset<k+1> dp; | ^ a.cc:17:73: note: 'long long int k' is not const 17 | long long int n,cnt=0,ans=0,a[ohara],b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos,k; | ...
s384418335
p03780
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,k;cin>>n>>k; vector<long long int>a(n); for(int i=0;i<n;i++) cin>>a.at(i); sort(a.begin(),a.end()); long long int sum=0; int t=-1; for(int i=0;i<n;i++){ sum+=a.at(i); if(sum>=k){ t=i; break; } } if(t==-1){ cout<...
a.cc: In function 'int main()': a.cc:45:20: error: no matching function for call to 'max(long long int&, int&)' 45 | ret=max(dp[i+1][j+a.at(i+t)],ret); | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-l...
s021643354
p03780
C++
#include <bits/stdc++.h> #define FOR(I,X,Y) for(int (I)=(X);(I)<(Y);(I)++) #define REP(I,X,Y) for(int (I)=(Y)-1;(I)>=(X);(I)--) #define ALL(X) (X).begin(),(X).end() #define INF 1000000007 #define LINF 1000000000000000007 typedef long long ll; using namespace std; int main(){ int N,K,ans=0; cin >> N >> K; int a[N...
a.cc: In function 'int main()': a.cc:17:7: error: 'boo' was not declared in this scope; did you mean 'bool'? 17 | boo flag = 0; | ^~~ | bool a.cc:26:17: error: 'flag' was not declared in this scope 26 | flag = 1; | ^~~~ a.cc:33:12: error: 'flag' ...
s588698186
p03780
C++
#include <bits/stdc++.h> using namespace std; /* define const */ /* finish defineing const */ long n, k; long cnt; bool dp[5010][5010][5010] = {}; long a[5010]; vector<long> v; void init_dp() { for (int i = 0; i < 5010; i++) { dp[i][0][0] = true; } } void init_vector() { v.erase(v.begin(), ...
/tmp/cclcx8BR.o: in function `init_vector()': a.cc:(.text+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cclcx8BR.o a.cc:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/cclcx8BR.o a.cc:(.text+0x97): relocat...
s467434046
p03780
C++
#include <iostream> #include <queue> #include <set> #include <algorithm> #include <string> #include <list> #include <math.h> #include <map> using namespace std; #define REP(i, k, n) for(int i = k;i < n; i++) #define rep(i, n) REP(i,0,n) int dx[4] = {0,-1,1,0}; int dy[4] = {-1,0,0,1}; bool dp[5001][5001]; int tar = 0; i...
a.cc:87:5: error: redefinition of 'int dx [4]' 87 | int dx[4] = {0,-1,1,0}; | ^~ a.cc:12:5: note: 'int dx [4]' previously defined here 12 | int dx[4] = {0,-1,1,0}; | ^~ a.cc:88:5: error: redefinition of 'int dy [4]' 88 | int dy[4] = {-1,0,0,1}; | ^~ a.cc:13:5: note: 'int dy [4]' p...
s469255730
p03780
C++
#include<bits/stdc++.h> using namespace std; #define all(vec) vec.begin(),vec.end() typedef long long int ll; typedef pair<ll,ll> P; const ll MOD=1234567; const ll INF=1000000010; const ll LINF=1000000000000000010LL; const int MAX=500010; const double EPS=1e-3; int dx[4]={0,1,0,1}; int dy[4]={0,0,1,1}; int main(){ ...
a.cc: In function 'int main()': a.cc:34:22: error: no matching function for call to 'max(int, ll)' 34 | for(int i=max(0,k-s);i<k;i++){ | ~~~^~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s177896041
p03780
C++
v#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,k,i,ans=0,a[5010]; cin>>n>>k; for(i=0; i<n; i++) scanf("%d",&a[i]); sort(a,a+n); ll sum=0; for(i=n-1; i>=0; i--) { if(sum+a[i]<k) sum+=a[i]; else ans=i; } cout<<ans<<endl; ...
a.cc:1:2: error: stray '#' in program 1 | v#include <bits/stdc++.h> | ^ a.cc:1:1: error: 'v' does not name a type 1 | v#include <bits/stdc++.h> | ^ a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin>>n>>k; | ^~~ a.cc:9:9: error: 'scanf' w...
s861370035
p03780
C++
#include <bits/stdc++.h> using namespace std; int main() { int n,k,i,ans=0,a[5010]; cin>>n>>k; for(i=0; i<n; i++) scanf("%d",&a[i]); sort(a,a+n); ll sum=0; for(i=n-1; i>=0; i--) { if(sum+a[i]<k) sum+=a[i]; else ans=i; } cout<<ans<<endl; return 0; }
a.cc: In function 'int main()': a.cc:10:5: error: 'll' was not declared in this scope 10 | ll sum=0; | ^~ a.cc:13:12: error: 'sum' was not declared in this scope 13 | if(sum+a[i]<k) sum+=a[i]; | ^~~
s412669900
p03780
C++
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; int n, k; bool need(int*, int); int main(){ cin >> n >> k; int a[n+1]; for(int i=1; i<=n; i++) cin >> a[i]; sort(a+1, a+n+1); int l=1, r=n, m; if(need(a, 1)){ cout << 0 << endl; return 0; } if(!need(a, n)){ ...
a.cc: In function 'bool need(int*, int)': a.cc:62:16: error: no matching function for call to 'max(long long int, int)' 62 | for(int j=max(1LL*0, k-a[index]); j<k; j++){ | ~~~^~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/lo...
s615760020
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair<ll,ll> P; typedef pair<ll,P> PP; typedef vector<ll> Vector; typedef vector<Vector> DVector; typedef priority_queue<PP, vector<PP>, greater<PP>> PPQueue; #define fi first #define se secon...
a.cc: In function 'int main()': a.cc:49:21: error: no matching function for call to 'max(int, ll)' 49 | rep(i,n)repl(j,max(0,k-a[i]),k)if(!dp[j][i]){cou--;break;} | ~~~^~~~~~~~~~ a.cc:34:35: note: in definition of macro 'repl' 34 | #define repl(i,a,b) for(ll i=(ll)(a);i<=(ll)(b);i++) ...
s216803831
p03780
C++
#include <bits/stdc++.h> typedef long long ll; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using namespace std; #define dump(x) cout << #x << " = " << (x) << endl; #define YES(n) cout << ((n) ? "YES" : "NO" ) << endl #define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl #define POSSIBLE(n) cout ...
a.cc:74:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory 74 | #include <boost/multiprecision/cpp_int.hpp> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compilation terminated.
s819976208
p03780
C++
#include <iostream> #include <algorithm> #include <vector> #include <string> #include <utility> #include <cstdlib> #include <cmath> #include <functional> #define INF 1000000000000000000 using namespace std; typedef long long ll; int n; ll k; ll a[5010]; bool dp[5010]; bool need(int m) { for (int i = 1; i < k; i++) ...
a.cc: In function 'bool need(int)': a.cc:32:25: error: no matching function for call to 'max(int, ll)' 32 | for (int i = max(0, k - a[m]); i < k; i++) { | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_cla...
s725076646
p03780
C++
#include <cstdio> #include <vector> using namespace std; int main() { int n, k; scanf("%d%d", &n, &k); int ans = n, sum = 0; vector<int> a(n); for (int i = 0; i < n; i ++) scanf("%d", &a[i]); sort(a.begin(), a.end()); for (int i = n - 1; i >= 0; i --) { ...
a.cc: In function 'int main()': a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a.begin(), a.end()); | ^~~~ | short
s992315349
p03780
C++
#include <iostream> using namespace std; int n,k,a[5000],ans=0,used[5001],sum; int main(void){ cin>>n>>k; for(int i=0;i<n;i++){ cin>>a[i]; sum+=a[i]; } if(a[i]<k){ cout<<0<<endl; return 0; } int s=a[0],j=1; for(int i=0;j<n;s-=a[i],i++){ for(;j<n&&s<...
a.cc: In function 'int main()': a.cc:11:10: error: 'i' was not declared in this scope 11 | if(a[i]<k){ | ^
s717356410
p03780
C++
#include <stdio.h> #include <iostream> #include <vector> #include <algorithm> #include <random> #include <chrono> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set> #include <cstring> #include <sstream> #include <queue> using namespace std; using ll = unsigned long long...
a.cc: In function 'int main()': a.cc:38:5: error: 'bitset' was not declared in this scope 38 | bitset<5002> sum; | ^~~~~~ a.cc:15:1: note: 'std::bitset' is defined in header '<bitset>'; this is probably fixable by adding '#include <bitset>' 14 | #include <queue> +++ |+#include <bitset> 15 | a....
s605549947
p03780
C++
#include "IntMod.h" typedef IntMod<1000000007> MInt; #include "Union_Find.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <iostream> #include <string> #include <vector> #include <utility> #include <algorithm> #include <functional> #include <cmath> #include <stack> #include <queue> #include <set> #...
a.cc:1:10: fatal error: IntMod.h: No such file or directory 1 | #include "IntMod.h" | ^~~~~~~~~~ compilation terminated.
s985552317
p03780
C++
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #define REP(i, n) for(int i = 0; i < (int)(n); ++i) using namespace std; typedef long long ll; ll vs[5010]; bool needed[5010]; int N, K; int memo[5010][5010]; int isPossible(int pos, int x) { int& res = memo[pos][x]; if(res < 0) { ...
a.cc: In function 'int main()': a.cc:43:22: error: no matching function for call to 'max(ll, int)' 43 | for(int x = max(K-vs[i], 0); x < K; ++x) { | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, ...
s668705513
p03780
C++
#include<bits/stdc++.h> using namespace std; int N,K; int ans = 0; vector<int> V; int dp[5010][10010] = {1}; int main() { scanf("%d%d",&N,&K); for(int i = 0; i < N; i++) { int a; scanf("%d",&a); if(a <= K) { V.push_back(a); } } N = V.size(); ...
/tmp/cc44Qukr.s: Assembler messages: /tmp/cc44Qukr.s: Fatal error: can't fill 256 bytes in section .data of /tmp/ccJOdwFz.o: 'No space left on device' /tmp/cc44Qukr.s: Fatal error: /tmp/ccJOdwFz.o: No such file or directory
s986967951
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, N) for (int i = 0; i < (int)N; i++) int main () { int n, k; cin >> n >> k; vector<int> a(n); ll sum = 0; rep(i,n) { cin >> a[i]; sum += a[i]; } sort(a.begin(), a.end()); if(sum < k) { cout << n << endl; ...
a.cc: In function 'int main()': a.cc:40:3: error: 'out' was not declared in this scope 40 | out << 0 << endl; | ^~~
s517572956
p03780
C++
#include <iostream> #include<sstream> #include<vector> #include<iterator> using namespace std; bool f(int pos, int k, vector<int> card) { const int prev = card[pos]; card[pos] = 0; const int size = card.size(); vector<vector<bool>> table(size+1, vector<bool>(k+1, false)); table[0][0] = true; for(int i=0; i<siz...
a.cc: In function 'int main()': a.cc:54:17: error: 'count' was not declared in this scope; did you mean 'cnt'? 54 | cout << count(cnt.begin(), cnt.end(), false) << endl; | ^~~~~ | cnt
s864663054
p03780
C++
#include <iostream> #include <iomanip> #include <cstdio> #include <string> #include <cstring> #include <deque> #include <list> #include <queue> #include <stack> #include <vector> #include <utility> #include <algorithm> #include <map> #include <set> #include <complex> #include <cmath> #include <limits> #include <cfloat>...
a.cc: In function 'int main()': a.cc:91:8: error: 'accumulate' was not declared in this scope 91 | if(accumulate(a, a+N, 0LL) < K) { | ^~~~~~~~~~
s460663601
p03780
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll sum; bool dp[5005][5005]; int N,K; int a[5005]; int main() { cin >> N >> K; for(int i = 0; i < N; i++) { cin >> a[i]; sum += a[i]; } if(sum < K) { cout << N <<endl; return 0; } sort(a,a+N,greater<int>()); int l = 0; int...
a.cc: In function 'int main()': a.cc:28:14: error: expected ';' before 'continue' 28 | l = mid | ^ | ; 29 | continue; | ~~~~~~~~
s003959238
p03780
C++
#include <iostream> #include <vector> using namespace std; int N, K, a[5000]; bool C(int idx) { vector<vector<bool> > dp(N+1, vector<bool>(K+1, false)); dp[0][0] = true; for(int i=0; i<N; i++) { for(int j=0; j<=K; j++) { if(dp[i][j]) { dp[i+1][j] = true; ...
a.cc: In function 'int main()': a.cc:27:5: error: 'sort' was not declared in this scope; did you mean 'short'? 27 | sort(a, a+N, greater<int>()); | ^~~~ | short
s900649700
p03780
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] a = new int[N]; for(int i = 0; i < N; i++) { a[i] = sc.nextInt(); } Arrays.sort(a); int ans = -1; int left ...
Main.java:28: error: incomparable types: boolean and int dp[i][j] = (dp[i - 1][j] == 1) || (dp[i - 1][j - a[i]] == 1); ^ Main.java:28: error: incomparable types: boolean and int dp[i][j] = (dp[i - 1][j] == 1) || (dp[i - 1][j - a[i]] == 1); ...
s191565416
p03780
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; using vb = vector<bool>; using vvb = vector<vb>; int solve(long long N, long long K, vector<long long> &as); int solve_core(long long K, vector<long long> &as); void fill_dp(long long K, const vector<long long> &as, vvb & dp); bool is_nece...
a.cc: In function 'int solve(long long int, long long int, std::vector<long long int>&)': a.cc:25:23: error: 'accumulate' was not declared in this scope 25 | long long total = accumulate(as.begin(), as.end(), 0); | ^~~~~~~~~~
s378684050
p03780
C++
#include<bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<=b;i++) #define print(x) cout<<x<<endl; int n, k; int a[5002]; int ans; bool is; int main() { cin >> n >> k; rep(i, 0, n)cin >> a[i]; sort(a, a + n); int l = 0, r = n; while(r>l){ int s = (l + r) / 2; if (a[s] > k)continue; is ...
a.cc: In function 'int main()': a.cc:27:77: error: expected ';' before ']' token 27 | dp[i][j] = dp[i - 1][j] || dp[i-1][j - a[i]]]; | ^ | ...
s278148946
p03780
C++
def calcs(x,y,ax,ay,bx,by) ((ax-x)*(by-y)-(bx-x)*(ay-y))/2.0 end def inpf() a=gets.chomp.split(" ").map(&:to_f)end def inps() a=gets.chomp.split(" ")end def copy(a) Marshal.load(Marshal.dump(a)) end def kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end def scount(a) b=na(a.max+1);a.each{|n|b[n]+=1};return b end def na(n,d=...
a.cc:5:28: error: too many decimal points in number 5 | def kaizyo(n)(n < 2)? 1 : (2..n).inject(:*) end | ^~~~ a.cc:1:1: error: 'def' does not name a type 1 | def calcs(x,y,ax,ay,bx,by) ((ax-x)*(by-y)-(bx-x)*(ay-y))/2.0 end | ^~~ a.cc:6:29: error: 'a' does not name a type ...
s341495800
p03780
C++
#include <iostream> #define lli long long int #define DEBUG 0 using namespace std; lli show(lli *a,lli num){ for(lli i=0;i<num;i++){ cout<<a[i]<<" "; } cout<<endl; } lli solve(lli *a,lli index,lli n,lli k){ lli dp[n+1][k]; for(lli i=0;i<=n;i++){ for(lli j=0;j<k;j++){ if(j==0){ dp[i][j]=1; }else{...
a.cc: In function 'long long int show(long long int*, long long int)': a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type] 13 | } | ^ a.cc: At global scope: a.cc:3:23: error: '::main' must return 'int' 3 | #define lli long long int | ^~~ a.cc:5...
s695537588
p03780
C++
#include <iostream> #define lli long long lli #define DEBUG 0 using namespace std; lli show(lli *a,lli num){ for(lli i=0;i<num;i++){ cout<<a[i]<<" "; } cout<<endl; } lli solve(lli *a,lli index,lli n,lli k){ lli dp[n+1][k]; for(lli i=0;i<=n;i++){ for(lli j=0;j<k;j++){ if(j==0){ dp[i][j]=1; }else{...
a.cc:8:5: error: expected initializer before 'show' 8 | lli show(lli *a,lli num){ | ^~~~ a.cc:15:5: error: expected initializer before 'solve' 15 | lli solve(lli *a,lli index,lli n,lli k){ | ^~~~~ a.cc:52:5: error: expected initializer before 'main' 52 | lli main(){ | ^~~~
s426220080
p03780
Java
import java.util.Scanner; import java.util.Arrays; public class Sub{ static int n, k; static int[] a; public static void main(String[] args){ Scanner sc = new Scanner(System.in); n = sc.nextInt(); k = sc.nextInt(); a = new int[n]; for(int i = 0; i < n; i++){ a[i] = sc.nextInt(); }...
Main.java:4: error: class Sub is public, should be declared in a file named Sub.java public class Sub{ ^ 1 error
s087903191
p03780
C++
#include <iostream> #include <vector> #include <functional> #include <algorithm> using namespace std; class NoNeed { private: int n, k; int sum; vector<vector<bool> > l_dp; vector<vector<bool> > r_dp; vector<int> a; public: NoNeed(){ cin >> n >> k; a.resize(n); sum = 0; for (int i = 0; i < n; ++i) { ...
a.cc: In member function 'void NoNeed::exec()': a.cc:106:25: error: expected ';' before '}' token 106 | } | ^
s918653748
p03780
C++
#include <iostream> #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 ...
a.cc: In function 'bool ok(ll)': a.cc:138:33: error: expected primary-expression before '}' token 138 | } | ^
s209750813
p03780
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <math.h> #include <numeric> #include <set> #include <map> #include <stack> #include <queue> #include <time.h> using namespace std; typedef long long ll; #define pl pair<ll,ll> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i...
a.cc: In function 'int main()': a.cc:40:17: error: 'memset' was not declared in this scope 40 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 10 | #include <queue> +++ |+...
s801924466
p03780
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> #include <numeric> #include <set> #include <map> #include <stack> #include <queue> #include <time.h> using namespace std; typedef long long ll; #define pl pair<ll,ll> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) for(int i=0;i<...
a.cc: In function 'int main()': a.cc:39:17: error: 'memset' was not declared in this scope 39 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include <queue> +++ |+...
s584394692
p03780
C++
#include <iostream> #include <vector> #include <algorithm> #include <math.h> #include <numeric> #include <set> #include <map> #include <stack> #include <queue> #include <time.h> using namespace std; typedef long long ll; #define pl pair<ll,ll> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define rep(i,n) for(int i=0;i<...
a.cc: In function 'int main()': a.cc:39:17: error: 'memset' was not declared in this scope 39 | memset(dp,0,sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include <queue> +++ |+...
s980330325
p03780
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (n); ++i) #define rrep(i, n) for(int i = (n) - 1; i >= 0; --i) typedef long long ll; typedef long double ld; using namespace std; void solve(ll N, ll K, vector<ll> a){ ll ans = 0; vector<ll> dp(K + 1); dp[0] = 1; rep(i, N) { rep(j,...
a.cc: In function 'int main()': a.cc:41:12: error: expected primary-expression before 'N' 41 | ll N; | ^ a.cc:43:23: error: 'N' was not declared in this scope 43 | scanf("%lld",&N); | ^