submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s240294579
p03782
C++
#include <bits/stdc++.h> #define REP(i,n) for(long long i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namesp...
a.cc: In function 'int main()': a.cc:139:20: error: no matching function for call to 'max(long long int, int)' 139 | for(int x=max(k-a[i],0);x<k;x++){ | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/std...
s931567471
p03782
C++
#include <bits/stdc++.h> #define REP(i,n) for(long long i=0;i<n;i++) #define REPP(i,n) for(int i=1;i<=n;i++) const double PI = acos(-1); const double EPS = 1e-15; long long INF=(long long)1E17; #define i_7 (long long)(1E9+7) long mod(long a){ long long c=a%i_7; if(c>=0)return c; return c+i_7; } using namesp...
a.cc: In function 'int main()': a.cc:139:26: error: no matching function for call to 'max(long long int, int)' 139 | for(long long x=max(k-a[i],0);x<k;x++){ | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++...
s034002113
p03782
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...
s824252009
p03782
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; #defne N 5050 int a[N]={0}; int main(){ ll n,k; cin>>n>>k; for(int i=0; i<n; i++){ cin>>a[i]; } sort(a,a+n);//排序,容易知道一定是最小的那几个是不需要的 ll sum = 0; ll p = n; for(ll i=n-1; i>=0; i--){ if(sum+a[i]<k){ ...
a.cc:4:2: error: invalid preprocessing directive #defne; did you mean #define? 4 | #defne N 5050 | ^~~~~ | define a.cc:5:7: error: 'N' was not declared in this scope 5 | int a[N]={0}; | ^ a.cc: In function 'int main()': a.cc:10:14: error: 'a' was not declared in this scope 10 | ...
s763123328
p03782
C++
#include <iostream> #include <bitset> #include <algorithm> #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)(n);++i) #define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i) #define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i) #define each(a,b) for(auto&...
a.cc:32:9: error: 'vector' does not name a type 32 | typedef vector<int> vi; | ^~~~~~ a.cc:33:9: error: 'vector' does not name a type 33 | typedef vector<vi> vvi; | ^~~~~~ a.cc:34:9: error: 'vector' does not name a type 34 | typedef vector<ll> vl; | ^~~~~~ a.cc:35:9: e...
s659064909
p03782
C++
#include <bits/stdc++.h> typedef long long ll; typedef long double ld; const int INF=1e9,MOD=1e9+7,ohara=1e6; const ll LINF=1e18; using namespace std; #define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++) #define rrep(i,a,b) for(int i=(a);i<(b);i++) #define rrrep(i,a,b) for(int i=(a);i>=(b);i--) #define all(v) (v).begin(...
a.cc: In function 'int main()': a.cc:75:20: error: no matching function for call to 'max(ll&, int)' 75 | ans=max(ans,i+1); | ~~~^~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s496512862
p03782
C++
#include <bits/stdc++.h> #define int long long #define uint unsigned int #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, a, b) for (int i = (a); i < (b); ++i) #define FORR(i, a, b) for (int i = (a); i >= (b); --i) #define ALL(a) (a).begin(), (a).end() #d...
a.cc: In function 'bool check(long long int)': a.cc:38:13: error: no matching function for call to 'max(bool)' 38 | FOR(i, max(0LL< K-a[x]), K) if (dp[i]) return true; | ~~~^~~~~~~~~~~~~ a.cc:7:36: note: in definition of macro 'FOR' 7 | #define FOR(i, a, b) for (int i = (a); i < (b); ++i) ...
s658042981
p03782
C++
#include <bits/stdc++.h> #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define REPr(i,n) for(int i=(n)-1;i>=0; --i) #define FORq(i, m, n) for(int i = (m);i <= (n);++i) #define FORqr(i, m , n) for(int i = (n);i >=(m);--i) #define SCD(n) scanf("%d",&n) #define SCD2(m,n) scanf("%d%d"...
a.cc: In function 'int main()': a.cc:50:16: error: break statement not within loop or switch 50 | if (N>401) break; // for 300 | ^~~~~
s132828405
p03782
C++
#include <cstdio> #include <algorithm> using namespace std; int N, K, arr[5000]; bool isPos[5000]; bool judge(int ex) { memset(isPos, false, sizeof isPos); isPos[0] = true; if(K == 1 && arr[ex]) return true; for(int v = K-1; v >= 0; v--) { for(int i = 0; i < N; i++) { if(i...
a.cc: In function 'bool judge(int)': a.cc:10:5: error: 'memset' was not declared in this scope 10 | memset(isPos, false, sizeof isPos); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#inclu...
s382535037
p03782
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 "unordered_set" #include "stack" #include "tuple" #define rep(n) for (int i = 0; i < n; ++i) #define REP...
a.cc: In function 'int main()': a.cc:47:43: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] 47 | it--; | ~~^~
s620918618
p03782
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 "unordered_set" #include "stack" #include "tuple" #define rep(n) for (int i = 0; i < n; ++i) #define REP...
a.cc: In function 'int main()': a.cc:47:43: error: no 'operator--(int)' declared for postfix '--' [-fpermissive] 47 | it--; | ~~^~
s604827401
p03782
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 "unordered_set" #include "stack" #include "tuple" #define rep(n) for (int i = 0; i < n; ++i) #define REP...
a.cc: In function 'int main()': a.cc:47:41: error: no match for 'operator--' (operand type is 'std::__detail::_Node_iterator<int, true, false>') 47 | --it; | ^~~~
s248281424
p03782
C++
#include <bits/stdc++.h> #define FOR(i, begin, end) for(int i=(begin);i<(end);i++) #define REP(i, n) FOR(i,0,n) #define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--) #define IREP(i, n) IFOR(i,0,n) #define SORT(a) sort(a.begin(), a.end()) #define REVERSE(a) reverse(a.begin(), a.end()) //#define int long long #de...
a.cc: In function 'int main()': a.cc:28:25: error: no matching function for call to 'min(long long int, int)' 28 | int Nu = N / U + min(1LL, N % U); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits...
s424038773
p03782
C++
v
a.cc:1:1: error: 'v' does not name a type 1 | v | ^
s147379481
p03782
C++
#include<bits/stdc++.h> using namespace std; int n,k; int a[5010]; int f[5010][5010]; bool check(int x) { memset(f,0,sizeof(f)); f[0][0]=1; if (0>=k-a[x]&&0<k) return true; for (int i=1;i<=n;i++) { int tmp=a[i]; if (i==x) tmp=0; f[i][0]=1; for (int j=1;j<k;j++) { if (j>=tmp) f[i][j]=f[i-1][j]|f[i-1][j-...
a.cc: In function 'int main()': a.cc:38:9: error: 'else' without a previous 'if' 38 | else cout<<l<<endl; | ^~~~
s645225982
p03782
C++
#include<bits/stdc++.h> using namespace std; int n,k; long a[5050]; int main() { cin>>n>>k; for (int i=1;i<=n;i++) { cin>>a[i]; } sort(a,a+n); int i=n,ans=n; while (i>0 && ans >0) { int s=0,j=i; while (s<k && j>0) { s+=a[j]; j--; } if (s>=k &&j==0) { ans==n; } if (s>=k && j!=0) { ...
a.cc:38:2: error: stray '#' in program 38 | }#include<bits/stdc++.h> | ^ a.cc:38:3: error: 'include' does not name a type 38 | }#include<bits/stdc++.h> | ^~~~~~~ a.cc:40:5: error: redefinition of 'int n' 40 | int n,k; | ^ a.cc:3:5: note: 'int n' previously declared here 3 | int n,k...
s126646345
p03782
C++
#include <iostream> #include <algorithm> using namespace std; int N, K, T, Ans, A[5100]; int main() { cin >> N >> K ; for(register int i = 1; i <= n; i ++ ) cin >> A[i]; sort(A+1, A+N+1); for(register int i = N; i >= 1; i -- ) if(T+A[i] >= K) Ans = 0; else ans++, T += a[i]; cout << ans << endl; }
a.cc: In function 'int main()': a.cc:7:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister] 7 | for(register int i = 1; i <= n; i ++ ) cin >> A[i]; | ^ a.cc:7:38: error: 'n' was not declared in this scope 7 | for(register int i = 1;...
s258054861
p03782
C++
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.util.NoSuchElementException; public class Main { static PrintWriter out; static InputReader ir; static boolean debug = false; static void solve() { l...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.IOException; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.InputStream; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodu...
s328196308
p03782
C++
#include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; typedef long long ll; const ll maxn = 5010; ll n,k,a[maxn],ans,sum; bool f[maxn]; int main() { scanf("%lld%lld",&n,&k); for (ll i = 0; i < n; i++) { scanf("%lld",&a[i]); sum += min(a[i],k); ...
a.cc: In function 'int main()': a.cc:26:36: error: no matching function for call to 'max(int, ll)' 26 | for (ll j = k - 1; j >= max(0,k - sum); j--) | ~~~^~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s160143242
p03782
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int N, K; long long a[5002]; bool dp[5003][5000]; bool is_needed(int x){ for(int k = 0; k < K; k++){ dp[0][k] = false; } dp[0][0] = true; for(int i = 0; i < N; i++){ for(int k = 0; k < K; k++){ ...
a.cc: In function 'bool is_needed(int)': a.cc:30:20: error: no matching function for call to 'max(int, long long int)' 30 | for(int k = max(0, K - a[x]); k < K; k++){ | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/local...
s438918817
p03782
C++
#include<iostream> #include<string> #include<cmath> #include<queue> #include<map> #include<set> #include<list> #include<iomanip> #include<vector> #include<random> #include<functional> #include<algorithm> #include<cstdio> #include<bitset> #include<unordered_map> using namespace std; //-----------------------------------...
a.cc: In function 'bool solve(long long int)': a.cc:111:25: error: no matching function for call to 'max(int, long long int)' 111 | for (int i = max(0, k - v[t]); i < k; i++) | ~~~^~~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c...
s447633630
p03782
C++
#pragma GCC optimize("Ofast") #pragma GCC target("sse,sse2,sse3,sse3,sse4,popcnt,abm,mmx") //#include<bits/stdc++.h> #include <map> #include <set> #include <list> #include <cmath> #include <ctime> #include <deque> #include <queue> #include <stack> #include <string> #include <bitset> #include <cstdio> #include <limits>...
a.cc: In function 'void Solve()': a.cc:112:17: error: expected primary-expression before '}' token 112 | } | ^
s854414137
p03782
C++
#include<iostream> #include<vector> #include<alogorithm> using namespace std; int main() { int N, K, ans=0; bool tmp; cin >> N >> K; vector<int> vect(K, 0),old_vect(K,0); vector<int> avect(N); old_vect[0]++; for(int i=0 ; i<N ; i++){ cin >> avect[i]; for(int j=0 ; j < K ; j...
a.cc:3:9: fatal error: alogorithm: No such file or directory 3 | #include<alogorithm> | ^~~~~~~~~~~~ compilation terminated.
s197393210
p03782
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() #define pb push_back #define endl '\n' template<typename T> inline bool smin(T &a, const T &b){ return b < a ? a = b,1:0;} ...
a.cc: In function 'bool chk(int)': a.cc:31:44: error: expected ']' before ')' token 31 | for ( int i = max ( 0 , k - a [ mid ) ; i < k ; i++ ) | ^~ | ]
s229125402
p03782
C++
#include<bits/stdc++.h> #define int long long #define fi first #define se second #define PB push_back using namespace std; typedef pair<int, int> P1; typedef pair<int, pair<int, int> > P2; static const int INF = 1ll<<60; static const int dx[] = { 1, -1, 0, 0, }; static const int dy[] = { 0, 0, 1, -1 }; static const int...
a.cc: In function 'bool solve(long long int)': a.cc:36:18: error: no matching function for call to 'max(int, long long int)' 36 | for(int k=max(0,K-a[i]);k<=K;++k){ | ~~~^~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/...
s349154666
p03782
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int n,k,s,ss; int a[5010]; int ans; int f[5010]; int main() { scanf("%d%d",&n,&k); for(int i=1;i<=n;i++) { int x; scanf("%d",&x); if(x>=k)continue; a[++s]=x; ss+=x; } if(ss<=k) { printf("0");return 0; } sort(a+1,a+s+1); fo...
a.cc: In function 'int main()': a.cc:28:17: error: 'memset' was not declared in this scope 28 | memset(f,false,sizeof(f)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> ++...
s721769023
p03782
C++
include<bits/stdc++.h> using namespace std; long long N, K; long long a[5005]; bool ldp[5005][5005]; bool rdp[5005][5005]; int main(){ cin >> N >> K; for(long long i = 0; i < N; i++){ cin >> a[i]; } //ldp[i] <-- i 未満 for(long long i = 0; i < N; i++){ for(long long j = 0; j < K; j++){ if(j == 0 || ldp[i]...
a.cc:1:1: error: 'include' does not name a type 1 | include<bits/stdc++.h> | ^~~~~~~ a.cc: In function 'int main()': a.cc:11:9: error: 'cin' was not declared in this scope 11 | cin >> N >> K; | ^~~ a.cc:67:9: error: 'cout' was not declared in this scope 67 | cout << ans << ...
s473058329
p03782
C++
int N, K; int A[5010]; bool dp[5010][5010]; void solve() { cin >> N >> K; rep(i, 1, N + 1) cin >> A[i]; sort(A, A + N + 1); dp[N][min(K, A[N])] = true; dp[N][0] = true; for(int i = N - 1; i >= 1; i--) { int a = -1; for(int j = K; j >= 0; j--) { if(j - A[i] >= 0) dp[i][j] = max(dp[i + 1][j], dp[i + 1][j -...
a.cc: In function 'void solve()': a.cc:7:9: error: 'cin' was not declared in this scope 7 | cin >> N >> K; | ^~~ a.cc:8:13: error: 'i' was not declared in this scope 8 | rep(i, 1, N + 1) cin >> A[i]; | ^ a.cc:8:9: error: 'rep' was not declared in this scope 8 ...
s479171660
p03782
C++
#include <iostream> #include <vector> #include <queue> #include <cstdio> #include <algorithm> using namespace std; int a[5020]; int n,k; bool d[5020]; bool test(int idx){ if(a[idx]>=k) return true; memset(d,false,sizeof(d)); d[0]=true; for(int i=0;i<n;i++){ if(i==idx) contin...
a.cc: In function 'bool test(int)': a.cc:16:5: error: 'memset' was not declared in this scope 16 | memset(d,false,sizeof(d)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include <algorithm> +++ |+#include <cstrin...
s126997504
p03782
C++
# coding: utf-8 n, k = map(int, raw_input().split()) a = list(map(int, raw_input().split())) a.sort() left = 0 right = n - 1 while left != right: mid = (left + right + 1) / 2 dp = [[0 for j in range(k + 1)] for i in range(n + 1)] dp[0][0] = 1 for i in range(n): for j in range(k + 1): ...
a.cc:1:3: error: invalid preprocessing directive #coding 1 | # coding: utf-8 | ^~~~~~ a.cc:3:1: error: 'n' does not name a type 3 | n, k = map(int, raw_input().split()) | ^
s811860184
p03782
C++
#include <cstdio> #include <cstdlib> #include <algorithm> using namespace std; int N,K; long long a[5000]; int dp[5000][5000]; int rec(int x, int y); bool need(int i); int main(){ int ans; int left,right; scanf("%d %d", &N,&K); for(int i=0;i<N;i++){ scanf("%lld",&a[i]); } sort(a,a+...
a.cc: In function 'bool need(int)': a.cc:76:5: error: 'memset' was not declared in this scope 76 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <algorithm> +++ |+#include <cstring...
s569177128
p03782
C++
#include <cstdio> #include <algorithm> using namespace std; int N,K; long long a[5000]; int dp[5000][5000]; int rec(int x, int y); bool need(int i); int main(){ int ans; int left,right; scanf("%d %d", &N,&K); for(int i=0;i<N;i++){ scanf("%lld",&a[i]); } sort(a,a+N); if(need(0)...
a.cc: In function 'bool need(int)': a.cc:75:5: error: 'memset' was not declared in this scope 75 | memset(dp,-1,sizeof(dp)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> +++ |+#include <cstring...
s529334773
p03782
C++
#include <iostream> #include <string> #include <list> #include <vector> #include <queue> #include <algorithm> #include <climits> #define int long long #define uint unsigned long long #define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end()) #define SORT(v) sort((v).begin(), (v).end()) #define RSORT(v) sort...
a.cc: In function 'int main()': a.cc:64:17: error: 'memset' was not declared in this scope 64 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 7 | #include <climits> ++...
s874188767
p03782
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int c[5001]; bool dp[5001]; signed main() { int a, b; scanf("%d%d", &a, &b); int sum = 0;//個数 for (int d = 0; d < a; d++) { int e; scanf("%d", &e); if (e<b) { c[sum] = e; sum++; } } sort(c, c + sum); c[sum] = 1 << 29; sum++...
a.cc: In function 'int main()': a.cc:24:17: error: 'memset' was not declared in this scope 24 | memset(dp, false, sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> ...
s871069407
p03782
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int c[5000]; bool dp[5001]; signed main() { int a, b; scanf("%d%d", &a, &b); int sum = 0;//個数 for (int d = 0; d < a; d++) { int e; scanf("%d", &e); if (e<b) { c[sum] = e; sum++; } } sort(c, c + sum); int s = 0, g = sum;//[s,...
a.cc: In function 'int main()': a.cc:22:17: error: 'memset' was not declared in this scope 22 | memset(dp, false, sizeof(dp)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<algorithm> ...
s750198315
p03782
C++
#include "bits/stdc++.h" using namespace std; #ifdef _DEBUG #include "dump.hpp" #else #define dump(...) #endif //#define int long long #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(c) begin(c),end(c) const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f...
a.cc: In function 'int main()': a.cc:28:9: error: reference to 'left' is ambiguous 28 | left[0][0] = right[0][0] = 1; | ^~~~ In file included from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/...
s316413312
p03782
C++
#include <iostream> #include <vector> #include <algorithm> #include <iterator> #include <functional> using namespace std; int main() { int N; int K; int count = 0; vector<long long> a; long long sum = 0; cin >> N; cin >> K; bool dp[N+1][K+1]; for ( int n = 0; n <= N; n++ ) { for ( int k = 0; k <= ...
a.cc: In function 'int main()': a.cc:42:14: error: 'n' was not declared in this scope 42 | if ( n == 1 ) { | ^
s479290491
p03782
C++
#include <iostream> #include <vector> #include <algorithm> #include <iterator> #include <functional> using namespace std; int main() { int N; int K; int count = 0; vector<long long> a; long long sum = 0; cin >> N; cin >> K; bool dp[N+1][K+1]; for ( int n = 0; n <= N; n++ ) { for ( int k = 0; k <= ...
a.cc: In function 'int main()': a.cc:42:14: error: 'n' was not declared in this scope 42 | if ( n == 1 ) { | ^
s580711289
p03782
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; using ll = long long; ll a[5100] = {}; bool dp_right[5010][5010] = {}; bool dp_left[5010][5010] = {}; int main(void){ // Here your code ! ll n,k; cin >> n >> k; for(int i = 0; i < n; i++){ cin >> a[i]; ...
a.cc: In function 'int main()': a.cc:30:48: error: 'K' was not declared in this scope 30 | int nj = min(j + a[i], K); | ^ a.cc:44:48: error: 'K' was not declared in this scope 44 | int nj = min(j + a[i], K); ...
s792680041
p03782
C++
using System; namespace D_NoNeed { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(' '); int N = int.Parse(input[0]); int K = int.Parse(input[1]); input = Console.ReadLine().Split(' '); var A = new int[N...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:5:26: error: 'string' has not been declared 5 | static void Main(string[] args) { | ^~~~~~ a.cc:5:35: error: expected ',' or '...' before 'args' 5 | stat...
s630617172
p03782
C++
using System; namespace D_NoNeed { class Program { static void Main(string[] args) { string[] input = Console.ReadLine().Split(' '); int N = int.Parse(input[0]); int K = int.Parse(input[1]); input = Console.ReadLine().Split(' '); var A = new int[N...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:5:26: error: 'string' has not been declared 5 | static void Main(string[] args) { | ^~~~~~ a.cc:5:35: error: expected ',' or '...' before 'args' 5 | stat...
s075673770
p03782
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <set> #include <map> #include <cmath> #include <iomanip> #include <codecvt> #include <locale> using namespace std; using ll = long long; int main() { int N, K; cin >> N >> K; vector<int> a(N); for(int i=0; i<N; ++i) {...
a.cc: In function 'int main()': a.cc:21:14: error: 'accumulate' was not declared in this scope 21 | ll sum = accumulate(a.begin(), a.end(), 0LL); | ^~~~~~~~~~
s189598639
p03782
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include ...
a.cc: In instantiation of 'void fill_all(ARR&, const T&) [with T = int; ARR = signed char]': a.cc:34:32: recursively required from 'void fill_all(ARR&, const T&) [with T = int; ARR = signed char [5001]]' 34 | for (auto& i : arr) { fill_all(i, v); } | ~~~~~~~~^~~~~~ a.cc:...
s989488701
p03782
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include ...
a.cc: In function 'int main()': a.cc:89:26: error: 'i' was not declared in this scope 89 | ignore = i; | ^
s095228554
p03782
C++
#include <iostream> #include <vector> #include <bitset> using namespace std; int N, K; vector<int> a; bitset<5001> dp; //is m necessary? bool sub(int m) { if(K <= a[m]) return true; dp.reset(); for(int i = 0; i < N; ++i) { if(i != m) dp |= dp << a[i]; } for(int b = K - a[m]; b < K; ++b) { if(dp[b]) return t...
a.cc: In function 'int main()': a.cc:33:9: error: 'sort' was not declared in this scope; did you mean 'short'? 33 | sort(a.begin(), a.end()); | ^~~~ | short
s228329268
p03782
C++
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; long long a[5010]; long long dp[5010]; int main() { int n, k; while(~scanf("%d%d",&n, &k)) { for(int i=1; i<=n;i++) scanf("%lld",&a[i]); sort(a+1, a+1+n); long long sum = 0; for(int i=1;i<=n;i++) { sum += a[i]; } if...
a.cc: In function 'int main()': a.cc:31:30: error: 'j' was not declared in this scope 31 | if(a[j]+a[i] >= k && a[i]<k) | ^ a.cc:41:31: error: 'i' was not declared in this scope 41 | if(dp[i] == i-1 && a[i] < k)//&& a[i] < k) ...
s471977428
p03782
C++
#include<iostream> #include<algorithm> using namespace std; int N, K; int a[5000]; bool is_needed(int i){ if(a[i]>=K) return true; int memo[N+1][K]; for(int j=0; j<N+1; j++)for(int k=0; k<K; k++) memo[j][k]=0; memo[0][0]=1; for(int j=0; j<N; j++){ for(int k=0; k<K; k++){ memo[j+1][k]|=...
a.cc: In function 'int main()': a.cc:40:11: error: 'r' was not declared in this scope 40 | cout<< r<< endl; | ^
s783160106
p03782
C++
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; long long a[5010]; long long dp[5010]; int main() { int n, k; while(~scanf("%d%d",&n, &k)) { for(int i=1; i<=n;i++) scanf("%lld",&a[i]); sort(a+1, a+1+n); long long sum = 0; for(int i=1;i<=n;i++) { sum += a[i]; } if...
a.cc: In function 'int main()': a.cc:40:53: error: expected primary-expression before ')' token 40 | if(dp[i] == i-1 && a[i] < k))//&& a[i] < k) | ^
s447815224
p03782
C++
#include <cstdio> #include <algorithm> #include <set> using namespace std; int nums[6000]; set<int> st; int main(){ int N, K,next; scanf("%d %d", &N, &K); for (int i = 0; i < N; i++) scanf("%d", nums + i); sort(nums, nums + N); int knot = N; st.clear(); st.insert(0); vector<int>temp; for (int i=N-1;i>=0;i--)...
a.cc: In function 'int main()': a.cc:16:9: error: 'vector' was not declared in this scope 16 | vector<int>temp; | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <set> +++ |+#include <vector> 4 |...
s542368611
p03782
C++
#include <iostream> #include <vector> using namespace std; int main() { int n,k; cin>>n>>k; vector<int>vec(n,k); vector<int>a(n); for(int i=0;i<n;i++)cin>>a[i]; sort(a.begin(),a.end()); for(int i=0;i<n;i++){ for(int j=0;j<n;j++){ if(i==j)continue; if(vec[i]-a...
a.cc: In function 'int main()': a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'? 11 | sort(a.begin(),a.end()); | ^~~~ | short
s747376611
p03782
C++
#include<bits/stdc++.h> #define DEBUG 0 /* */ using namespace std; int main() { long long int N, K; cin >> N >> K; vector < long long int >A(N); for (size_t i = 0; i < N; i++) { cin >> A[i]; } vector<unordered_set<long long int>>dp1(N + 1), dp2(N + 1); dp1[0].insert(0); for (size_t i = 0; i < N; i++) { ...
a.cc: In function 'int main()': a.cc:52:40: error: '__gnu_cxx::__alloc_traits<std::allocator<std::unordered_set<long long int> >, std::unordered_set<long long int> >::value_type' {aka 'class std::unordered_set<long long int>'} has no member named 'rbegin'; did you mean 'begin'? 52 | auto ite2 = dp2[i...
s772941712
p03782
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define rep(i, n) for (int i = 0; i < (int)n; i++) #define orep(i, n) for (int i = 1; i <= (int)n; i++) #define vec vector int main(void) { int n, k; cin >> n >> k; vec<int> a(n + 1); orep(i, n) cin >> a[i]; int ans = 0; orep(t, n...
a.cc: In function 'int main()': a.cc:22:23: error: invalid types '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}[int]' for array subscript 22 | cur[0][0] = 1; | ^
s965192877
p03782
C++
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; int a[5010]; int dp[5010]; int main() { int n, k; while(~scanf("%d%d",&n, &k)) { for(int i=1; i<=n;i++) scanf("%d",&a[i]); sort(a+1, a+1+n); long long sum = 0; for(int i=1;i<=n;i++) { sum += a[i]; } if(sum<k) { ...
a.cc: In function 'int main()': a.cc:32:28: error: 'arr' was not declared in this scope 32 | if(arr[j]+a[i] >= k) | ^~~
s589565533
p03782
C++
#include <iostream> #include <cstdio> #include <vector> #include <cmath> #include <cstring> #include <numeric> #include <algorithm> #include <functional> #include <array> #include <map> #include <queue> #include <limits.h> #include <set> #include <stack> #include <random> #include <complex> #include <unordered_map> #de...
a.cc: In lambda function: a.cc:80:33: error: inconsistent types 'bool' and 'int' deduced for lambda return type 80 | return can[nok] = ret; | ~~~~~~~~~^~~~~
s128679320
p03782
C++
#include <bits/stdc++.h> using namespace std; const int N = 5009; const int inf = (int) 2e9; int a[N]; int b[N]; int main () { int n, k; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a[i]; b[i] = a[i]; } sort (b, b + n); int ans = 0; for (int i = 0; i < n; i++) { for (i...
a.cc: In function 'int main()': a.cc:28:36: error: 't' was not declared in this scope 28 | for (int l = 0, r = 0, s = t; l < n; l++) { | ^ a.cc:35:28: error: 't' was not declared in this scope 35 | if (mn < k || mn - t >= k) { | ...
s748270017
p03782
C++
#include <iostream> #include <iomanip> #include <cstdio> #include <cstring> #include <cmath> #include <cstdlib> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <set> #include <map> #include <functional> #include <utility> #include <tuple> #define INF 0x3f3f3f3f #defin...
a.cc:26:19: error: declaration does not declare anything [-fpermissive] 26 | typedef long long int; | ^~~
s543757200
p03782
C++
#if 1 #include <iostream> #include <fstream> #include <string> #include <vector> #include <map> #include <set> #include <unordered_map> #include <unordered_set> #include <queue> #include <stack> #include <array> #include <deque> #include <algorithm> #include <utility> #include <cstdint> #include <functional> #include...
a.cc: In function 'int32_t func(int, int)': a.cc:38:34: error: cannot convert '<brace-enclosed initializer list>' to 'int32_t' {aka 'int'} in return 38 | return { -MIN,{} }; | ^ a.cc:41:33: error: cannot convert '<brace-enclosed initializer list>' to 'int32_t' {...
s341113035
p03782
C++
#include <bits/stdc++.h> using namespace std; const int N = 5005; int n, k; vector<int> a; bitset<N> t, t2; int main() { cin >> n >> k; int ans = n; for (int i = 0, x; i < n; i++) { cin >> x; if (x >= k) ans --; else a.pb(x); } n = (int)a.size(); t.set(0); for (int i = 0; i < n; i++) { if (i)...
a.cc: In function 'int main()': a.cc:17:24: error: 'class std::vector<int>' has no member named 'pb' 17 | else a.pb(x); | ^~
s838168654
p03782
C++
#include <cstdio> #include <iostream> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <string> #include <cstring> #include <sstream> #include <algorithm> #include <functional> #include <queue> #include <stack> #include <cmath> #include <iomanip> #include <list>...
a.cc: In function 'int main()': a.cc:64:32: error: return-statement with no value, in function returning 'int' [-fpermissive] 64 | if (n > 400 || k > 400)return; | ^~~~~~
s669737066
p03782
C++
#include<bits/stdc++.h> using namespace std; typedef long long LL; LL t,n,m,ans,tot; LL f[5111],g[111]; int main() { LL i,j,k,l,ca=0,u,v,w; cin>>n>>m;w=m; for(i=1;i<=n;i++) cin>>f[i],ans+=f[i]; if(ans<m){ cout<<n<<endl; return 0; } sort(f+1,f+n+1); for(i=n;i>0;i--) if(f[i]>=m)n--; for(i=n;i>0&&m>0;i...
a.cc: In function 'int main()': a.cc:30:18: error: no matching function for call to 'max(int, const long long int&)' 30 | cout<<max(0,min(n,i-2) )<<endl; | ~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14...
s151737067
p03782
C++
#include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <set> #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <complex> #include <stack> #include <queue> #include <cstdio> #include <cstring> #include <iterator> #include <b...
a.cc: In function 'void mainmain()': a.cc:140:12: error: 'i' was not declared in this scope 140 | if(i==1){ | ^
s127049493
p03782
C++
#include <iostream> #include <vector> #include <cstdint> #include<algorithm> #include<set> #include<map> #include<queue> #include<math.h> using namespace std; typedef long long ll; double abs(double d){ if(d>=0)return d; return -1.0*d; } int main() { ll n,k; cin>>n>>k; vector<ll>a(n); ll sum...
a.cc:14:20: error: 'double abs(double)' conflicts with a previous declaration 14 | double abs(double d){ | ^ In file included from /usr/include/c++/14/cstdlib:81, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_strin...
s650879215
p03782
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 100000 + 10; const int M = 1000000007; const double PI = atan(1) * 4; const int oo = 1000000000; typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; #define pb push_back #define all(c) (c).begin(),(c).end() int v[5...
a.cc: In function 'int main()': a.cc:30:26: error: 'i' was not declared in this scope 30 | bool f=v[i]>=k; | ^
s797048452
p03782
C++
#include <iostream> using ll = long long; int n, k; int a[5010]; bool stat[5010]; ll dp[5010][5100]; ll dfs(int idx, ll sum) { if(sum >= k) { return sum; } if(idx >= n) { return 0; } if(dp[idx][sum] != -1) { return dp[idx][sum]; } ll min = 1e18; for(int i = id...
a.cc: In function 'int main()': a.cc:41:5: error: 'memset' was not declared in this scope 41 | memset(dp, -1, sizeof(dp)); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring> ...
s488526106
p03782
C++
#include <algorithm> #include <fstream> #include <iostream> using namespace std; short pref[5005][5005]; short suf[5005][5005]; int main() { //ifstream cin("f.iun"); int n, k; cin >> n >> k; vector<int> v; for (int x, i = 1; i <= n; ++ i) { cin >> x; if (x < k) { v.push...
a.cc: In function 'int main()': a.cc:13:5: error: 'vector' was not declared in this scope 13 | vector<int> v; | ^~~~~~ a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>' 3 | #include <iostream> +++ |+#include <vector> 4 | usin...
s714054360
p03782
C++
#include<iostream> #include<vector> #include<algorithm> using namespace std; typedef long long int lli; typedef pair<lli, lli> pii; int main(){ lli n, k; std::cin >> n >> k; vector<pii> a(n); for (int i = 0; i < n; i++) { std::cin >> a[i].first; a[i].second = i; } sort(a.begin(), a.end()); revers...
a.cc: In function 'int main()': a.cc:24:18: error: no matching function for call to 'max(lli&, int)' 24 | pos = max(pos, j + 1); | ~~~^~~~~~~~~~~~ In file included from /usr/include/c++/14/string:51, from /usr/include/c++/14/bits/locale_classes.h:40, from...
s475809875
p03782
C++
#include <vector> #include <iostream> #include <utility> #include <algorithm> #include <string> #include <deque> #include <tuple> #include <queue> #include <functional> #include <cmath> #include <iomanip> #include <map> #include <set> #include <numeric> #include <unordered_map> #include <unordered_set> #include <comple...
a.cc: In member function 'void segtree<T, Func>::updateall(int, int)': a.cc:174:9: error: expected ';' before '}' token 174 | } | ^ a.cc: In constructor 'BIT<T>::BIT(int)': a.cc:197:21: error: class 'BIT<T>' does not have any field named 'obj' 197 | BIT(int n) :obj(n + 1, 0) {} |...
s735492860
p03782
C++
#include<iostream> #include<cstdio> #include<algorithm> #include<map> #include<set> #include<functional> #include<unordered_map> #include<unordered_set> #include<queue> #include<vector> using namespace std; int c[405]; bool dp[405]; signed main() { int a, b; scanf("%d%d", &a, &b); if (a > 400 || b > 400)return 0; i...
a.cc: In function 'int main()': a.cc:28:17: error: 'memset' was not declared in this scope 28 | memset(dp, false, sizeof(dp)); | ^~~~~~ a.cc:10:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 9 | #include<queue> +...
s738700332
p03783
C++
#include <bits/stdc++.h> using namespace std; #define int int64_t typedef pair<int, int> ii; const int infinity = 1e18; int number; ii segment[100001]; int f[401][401]; int32_t main() { ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin >> number; for (int i = 1; i <= number; i++) cin >> segment[i]....
a.cc: In function 'int32_t main()': a.cc:37:41: error: no matching function for call to 'max(long long int, int64_t)' 37 | for (int k = max(1LL, l - segment_length); k <= r; k++) | ~~~^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/1...
s868671915
p03783
C++
解説見た(2回目) CHTかなーとか考えた
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token 1 | 解説見た(2回目) | ^
s092312511
p03783
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> #in...
a.cc: In function 'void solve()': a.cc:63:32: error: expected primary-expression before '>' token 63 | else if (l[i] => mr) { | ^
s842008254
p03783
C++
#include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> #include <queue> using namespace std; typedef long long ll; priority_queue <ll> P; priority_queue <ll,vector <ll>,greater <ll> > Q; int main() { int n; ll A=0,B=0,ans=0; cin>>n; for(int i=1;i<=n;i++) { cin>>...
a.cc: In function 'int main()': a.cc:17:14: error: 'l' was not declared in this scope 17 | cin>>l>>r; | ^ a.cc:17:17: error: 'r' was not declared in this scope 17 | cin>>l>>r; | ^
s755739923
p03783
C++
#include<stdio.h> #include<stdlib.h> int compare(const void *a,const void *b){ k=*(long*)a; t=*(long*)b; if(k<t) return -1; else return 1; } int main(){ int n,i; long l[111111],r[111111],m[222222],p,ans=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%ld%ld",&l[i],&r[i]); m[i*2]=l[i]; m[i*2+1]=r[i]; } qsort(m,n*2,sizeof(lo...
a.cc: In function 'int compare(const void*, const void*)': a.cc:4:1: error: 'k' was not declared in this scope 4 | k=*(long*)a; | ^ a.cc:5:1: error: 't' was not declared in this scope 5 | t=*(long*)b; | ^ a.cc:10:1: warning: control reaches end of non-void function [-Wreturn-type] 10 | } | ...
s416457393
p03783
C++
#include <bits/stdc++.h> #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<map> ...
a.cc: In function 'int main()': a.cc:296:32: error: expected ';' before '{' token 296 | else(h-w==l[i]){ | ^ | ;
s592321178
p03783
C++
#define _USE_MATH_DEFINES #pragma region include #include <iostream> #include <iomanip> #include <stdio.h> #include <sstream> #include <algorithm> #include <iterator> #include <cmath> #include <complex> #include <string> #include <cstring> #include <vector> #include <bitset> #include <queue> #include <set> #include ...
a.cc: In function 'long long unsigned int TIME::get_cycle()': a.cc:610:16: error: '__rdtsc' was not declared in this scope 610 | return __rdtsc(); | ^~~~~~~ a.cc: In function 'void addABSfunc(int)': a.cc:689:26: error: no match for 'operator=' (operand types are 'std::multiset<long long i...
s226113197
p03783
C++
#include <bits/stdc++.h> #define db double #define ls rt << 1 #define rs rt << 1 | 1 #define pb push_back #define ll long long #define mp make_pair #define pii pair<int, int> #define X first #define Y second #define pcc pair<char, char> #define vi vector<int> #define vl vector<ll> #define rep(i, x, y) for(int i = x - 1...
a.cc:22:50: warning: multi-character character constant [-Wmultichar] 22 | while (ch < '0' || ch > '9') { if (ch == ' - ') f = - 1; ch = getchar(); } | ^~~~~ a.cc: In function 'int main()': a.cc:44:33: error: expected primary-expression before '=' token...
s716901802
p03783
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n; cin >> n; ll l, r, len; ll pbl = 0, pbr = 0, ans = 0; priority_queue<ll> ql; priority_queue<ll, vector<ll>, greater<ll>> qr; while (n--) { cin >> l >> r; len = r - l; pbr += len; ql.push(r - pbl); qr.push(...
a.cc: In function 'int main()': a.cc:27:25: error: 'L' was not declared in this scope 27 | while ((L = ql.top() + pbl) > (R = pbr + qr.top())) { | ^ a.cc:27:48: error: 'R' was not declared in this scope 27 | while ((L = ql.top() + pbl) > (R = pbr + qr....
s674215731
p03783
C++
#include <bits/stdc++.h> using namespace std; int len[N]; priority_queue<long long> PQL, PQR; long long pbl, pbr; long long Ans; int main() { int n; cin >> n; for (int i = 0;i < n;i++) { scanf("%d%d", &pos[i].first, &pos[i].second); len[i] = pos[i].second - pos[i].first; } ll l, r, len; for (int i = 0;...
a.cc:4:9: error: 'N' was not declared in this scope 4 | int len[N]; | ^ a.cc: In function 'int main()': a.cc:16:32: error: 'pos' was not declared in this scope; did you mean 'pow'? 16 | scanf("%d%d", &pos[i].first, &pos[i].second); | ^~~ | ...
s298721695
p03783
C++
/* % D a l a o --InterestingLSY */ #include <iostream> #include <cstdio> #include <cmath> #include <vector> #include <cstring> #include <stack> #include <queue> #include <algorithm> #include <set> #include <map> #define pb push_back #define mp make_pair #define INF 9999999 #define LINF 999999999999999999 #de...
a.cc: In function 'int main()': a.cc:47:9: error: expected primary-expression before '/' token 47 | /freopen("E.txt","r",stdin); | ^
s437653726
p03783
C++
#include <cstdio> #include <algorithm> #include <iostream> #include <cstring> using namespace std; int n; int l[405],r[405]; int d[405][405]; int go(int now,int leftx){ if(now == n) return 0; int &ans = d[now][leftx]; if(ans!=-1) return ans; int rightend = leftx + r[now-1]-l[now-1]; ans...
a.cc: In function 'int go(int, int)': a.cc:23:28: error: 'rnow' was not declared in this scope; did you mean 'rnew'? 23 | if(rnew < leftx || rnow < k) continue; | ^~~~ | rnew
s920360958
p03783
C++
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <cstring> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #include <list> #include <cassert> #include <ctime> #include...
a.cc: In function 'void run()': a.cc:70:25: error: 'cur' was not declared in this scope 70 | printf("%lld\n",cur); | ^~~
s304472923
p03783
C++
#include <iostream> #include <algorithm> #include <cmath> #include <vector> using namespace std; int main(int argc, char* argv[]) { int n; vector<int> l, r; for (int i=0; i<n; i++) { int l_, r_; cin >> l_, r_; l.push_back(l_); r.push_back(r_); } if(n > 400){ return 0; } long min_loss = -1; int loss_pos...
a.cc: In function 'int main(int, char**)': a.cc:22:17: error: expected ',' or ';' before 'for' 22 | for (int j=0, j < n; j++) { | ^~~ a.cc:22:38: error: 'j' was not declared in this scope 22 | for (int j=0, j < n; j++) { | ...
s116742198
p03783
C++
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <numeric> #include <cstring> #include <ctime> #include <cstdlib> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <list> #include <cmath> #include <bitset> #include <cassert> #...
a.cc: In function 'int main()': a.cc:72:21: error: 'L' was not declared in this scope 72 | if (max(L, Ln) <= min(R, Rn)) { | ^ a.cc:72:35: error: 'R' was not declared in this scope 72 | if (max(L, Ln) <= min(R, Rn)) { | ^ a....
s053920463
p03783
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; ll N; ll a[100005],b[100005]; ll dp[2][405]; void solve(){ if(N==1){ cout<<0<<endl; return 0; } ll INF=(1LL<<60); fill( dp[0],dp[2] , INF); for(int i=1;i<=400;i++){ dp[1][ i ]= abs(a[1]-i); } ll ans=INF; for(int i=...
a.cc: In function 'void solve()': a.cc:13:12: error: return-statement with a value, in function returning 'void' [-fpermissive] 13 | return 0; | ^
s517851367
p03784
C++
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int a, b; cin >> a >> b; if(a <= b){ cout << "Impossible" << endl; return 0; } vector<int> x; x.emplace_back(0); for(int i = 1; i < n; i++){ cout << "? " << x.back() << " " << i <<...
a.cc: In function 'int main()': a.cc:18:22: error: 'n' was not declared in this scope 18 | for(int i = 1; i < n; i++){ | ^ a.cc:32:19: error: 'n' was not declared in this scope 32 | vector<int> ans(n, 0); | ^
s003727065
p03784
C++
#include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define fi first #define se second const int N = 4007; int a, b, n, ans[N]; stack <int> st; string s; int ask(int x, int y){ int ret = 0; #ifndef Dat cout << "? " << x << " " << y << endl; cin >> s; if(s == 'Y') ret = 1; ...
a.cc: In function 'int ask(int, int)': a.cc:19:22: error: no match for 'operator==' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char') 19 | if(s == 'Y') ret = 1; | ~ ^~ ~~~ | | | | | ch...
s821706586
p03784
C++
#include<bits/stdc++.h> using namespace std; int N, A, B; struct TGrader{ string s; TGrader() { #ifdef ONLINE_JUDGE cin >> A >> B; N = A + B; #else s = "10001110001110011100101010111"; for(int i = 0; i < Grader.s.size(); ++i) { N++; if(Grader.s[i] == '1') A++; el...
a.cc: In constructor 'TGrader::TGrader()': a.cc:14:26: error: 'Grader' was not declared in this scope; did you mean 'TGrader'? 14 | for(int i = 0; i < Grader.s.size(); ++i) { | ^~~~~~ | TGrader
s442027486
p03784
C++
#include <bits/stdc++.h> using namespace std; int ax[100005]; int top=0; bool ok[100005]; signed main() { int a, b; cin>>a>>b; if(a<=b) { cout<<"Impossible"<<endl; return 0; } int n=a+b; for(int i=1; i<=n; i++) { if(top==0) { top++; ax[top]=i; } else { cout<<"? "<<ax[top]<<" "<<i<<endl...
a.cc: In function 'int main()': a.cc:31:31: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 31 | if(ans=="Y") | ~~~^~~~~ a.cc:47:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 47 | ...
s279405793
p03784
C++
#include<bits/stdc++.h> using namespace std; int main() { int A, B; cin >> A >> B; if (A <= B) { cout << "Impossible" << '\n'; exit(0); } stack<int> s; s.push(0); for (int i = 1; i < N; i++) { cout << '?' << ' ' << s.top() << ' ' << i << '\n' << flush; char c; cin >> c; if (c == 'N') s.pop(); ...
a.cc: In function 'int main()': a.cc:9:23: error: 'N' was not declared in this scope 9 | for (int i = 1; i < N; i++) { | ^ a.cc:16:23: error: 'N' was not declared in this scope 16 | for (int i = 0; i < N; i++) { | ^
s669346683
p03784
C++
#include <bits/stdc++.h> using namespace std; bool f[4050]; char ch[2]; int main() { int a, b, n; scanf("%d%d", &a, &b); if(a <= b) { puts("Impossible"); return 0; } n = a + b; stack<int> q; for(int i = 1; i <= n; i++) { if(!q.size()) { printf("? %d %d\n", i, i + 1); fflush(stdout); scanf("%s", ...
a.cc: In function 'int main()': a.cc:30:19: error: 'class std::stack<int>' has no member named 'front' 30 | int u = q.front(); | ^~~~~
s121676219
p03784
C++
#include <bits/stdc++.h> #define int long long using namespace std; const int INF = 1e10; const int MOD = 1e9 + 7; #define dump(x) cout << #x << " = " << (x) << endl; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define pb push_back #define all(v) (v).begin(), (v).end() #define V vector<int> #define P pair<int,...
a.cc:14:1: error: 'Vector' does not name a type 14 | Vector<P> p; | ^~~~~~ a.cc: In function 'void solve()': a.cc:29:9: error: 'p' was not declared in this scope 29 | p.push_back(mp(l[i], -1)); | ^ a.cc:29:27: error: cannot bind rvalue reference of type 'long long int&&' to lvalue of t...
s507318599
p03784
C++
#include <bits/stdc++.h> #define int long long using namespace std; const int INF = 1e20; const int MOD = 1e9 + 7; #define dump(x) cout << #x << " = " << (x) << endl; #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define pb push_back #define all(v) (v).begin(), (v).end() #define V vector<int> #define P pair<int,...
a.cc:4:17: warning: overflow in conversion from 'double' to 'long long int' changes value from '1.0e+20' to '9223372036854775807' [-Woverflow] 4 | const int INF = 1e20; | ^~~~ a.cc:14:1: error: 'Vector' does not name a type 14 | Vector<P> p; | ^~~~~~ a.cc: In function 'void solve()': ...
s808714916
p03784
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",&s);} string s; int main() { int a,b,n; cin>>a>>b; n=a+b; bool m[20000]; query(0,2); if(s=="NO"){m[0]=0;b--;} else{m[0]=1;a--;} for(int j=1...
a.cc: In function 'void query(int, int)': a.cc:5:76: error: 's' was not declared in this scope 5 | void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",&s);} | ^
s047361518
p03784
C++
#include<iostream> #include<cstdio> #include<cstring> using namespace std; void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",s);} string s; int main() { int a,b,n; cin>>a>>b; n=a+b; bool m[20000]; query(0,2); if(s=="NO"){m[0]=0;b--} else{m[0]=1;a--;} for(int j=1;j...
a.cc: In function 'void query(int, int)': a.cc:5:75: error: 's' was not declared in this scope 5 | void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",s);} | ^ a.cc: In function 'int main()': a.cc:14:27: error: exp...
s963232080
p03784
C++
#include<iostream> #include<cstring> using namespace std; void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",s);} string s; int main() { int a,b,n; cin>>a>>b; n=a+b; bool m[20000]; query(0,2); if(s=="NO"){m[0]=0;b--} else{m[0]=1;a--;} for(int j=1;j<n;j++){query(j,0...
a.cc: In function 'void query(int, int)': a.cc:4:75: error: 's' was not declared in this scope 4 | void query(int x,int y){printf("? %d %d\n",x,y);fflush(stdout);scanf("%s",s);} | ^ a.cc: In function 'int main()': a.cc:13:27: error: exp...
s714460382
p03784
C++
/*Program from Luvwgyx*/ #include<cstdio> #include<cstring> #include<algorithm> using namespace std; char s[10];int top,sta[maxn],ans[maxn]; int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();} return x*f; } ...
a.cc:6:24: error: 'maxn' was not declared in this scope 6 | char s[10];int top,sta[maxn],ans[maxn]; | ^~~~ a.cc:6:34: error: 'maxn' was not declared in this scope 6 | char s[10];int top,sta[maxn],ans[maxn]; | ^~~~ a.cc: In function 'int main()'...
s285324375
p03784
C++
#include <stdio.h> #include <string.h> #include <algorithm> const int N=200005; int ans[N],stack[N],top; int main(void) { int a,b; scanf("%d%d",&a,&b); if (a<=b) return 0&printf("Impossible\n"); int n=a+b; rep(i,0,n-1) { if (!top) { stack[++top]=i; continue; } printf("? %d %d\n", stack[top],i); ffl...
a.cc: In function 'int main()': a.cc:13:13: error: 'i' was not declared in this scope 13 | rep(i,0,n-1) { | ^ a.cc:13:9: error: 'rep' was not declared in this scope 13 | rep(i,0,n-1) { | ^~~
s628866051
p03784
C++
#include <iostream> #include <vector> #include <ctime> #include <algorithm> #include <string> using namespace std; int A, B, N; bool used[4009]; char p[4009][4009]; char ask(int x, int y) { if (p[x][y] == 'Y' || p[x][y] == 'N') return p[x][y]; cout << "? " << x << " " << y << endl; cin >> p[x][y]; return p[x][y];...
a.cc: In function 'int main()': a.cc:53:38: error: redeclaration of 'char c' 53 | char c; cin >> c; | ^ a.cc:52:38: note: 'char c' previously declared here 52 | char c = ask(s1, s2); | ...
s429439751
p03784
C++
#include <bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();} return x*f; } int A,B,stt[6000],top=0; string tt; int main() { A=read(); B=read(); if(A<=B) {puts("Impossi...
a.cc: In function 'int main()': a.cc:25:21: error: expected ';' before 'for' 25 | cout << "! " | ^ | ; 26 | for(int i=0;i<A+B;i++) | ~~~ a.cc:26:21: error: 'i' was not declared in this scope 26 | for(int i=0;i<A...
s229552355
p03784
C++
#include <bits/stdc++.h> using namespace std; inline int read() { int x=0,f=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();} while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();} return x*f; } int A,B,stt[6000],top=0; string tt; int main() { A=read(); B=read(); if(A<=B) {puts("Impossi...
a.cc: In function 'int main()': a.cc:25:21: error: expected ';' before 'for' 25 | cout << "! " | ^ | ; 26 | for(int i=0;i<A+B;i++) | ~~~ a.cc:26:21: error: 'i' was not declared in this scope 26 | for(int i=0;i<A...