submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s903793748
p03721
C++
#include <bits/stdc++.h> using namespace std; int N long long A[100001], K; int main(){ long long cnt = 0; cin >> N >> K; for(int i = 0; i < N; i++){ int a, b; cin >> a >> b; A[a] += b; } for(int i = 1; i < 100001; i++){ cnt += A[i]; if(cnt >= K){ printf("%d\n", i); return 0; } } return 0; }
a.cc:5:1: error: expected initializer before 'long' 5 | long long A[100001], K; | ^~~~ a.cc: In function 'int main()': a.cc:9:16: error: 'N' was not declared in this scope 9 | cin >> N >> K; | ^ a.cc:9:21: error: 'K' was not declared in this scope 9 | cin >> N >> K...
s274544195
p03721
C++
#include<cstdio> using namespace std; const int A=1e5+5; long long bo[A]; int main() { int N,K,a,b,cnt=0; scanf("%d%d",&N,&K); for(int i=1;i<=N;i++) { scanf("%d%d",&a,&b); bo[a]+=b; } for(int i=1;i<=1e5;i++) { cnt+=bo[i]; if(cnt>=K) { printf("%d",i)\n; return 0; } } return 0;...
a.cc:19:39: error: stray '\' in program 19 | printf("%d",i)\n; | ^ a.cc: In function 'int main()': a.cc:19:39: error: expected ';' before 'n' 19 | printf("%d",i)\n; | ^~ | ...
s829878831
p03721
C
#include<stdio.h> #include<stdlib.h> #include<string.h> #define df 0 int dc=100000; #define MAX 100010 typedef long int li; typedef struct{ int a; int b; }data; data array[MAX]; int comp(const void*a,const void*b){ int x=*((data*)a),y=*((data*)b); return x.a-y.a; } int main(){ if(df)printf("*** debug mode **...
main.c: In function 'comp': main.c:14:9: error: incompatible types when initializing type 'int' using type 'data' 14 | int x=*((data*)a),y=*((data*)b); | ^ main.c:14:23: error: incompatible types when initializing type 'int' using type 'data' 14 | int x=*((data*)a),y=*((data*)b); | ...
s001457836
p03721
C++
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <stack> #include <queue> #include <deque> #include <set> #include <map> #include <utility> #include <tuple> #include <algorithm> #include <cstdio> #include <cmath> using namespace std; #define rep(i, n) for(int i = 0; i < (n); i++) usi...
a.cc: In function 'int main()': a.cc:31:3: error: expected ',' or ';' before 'int' 31 | int ans; | ^~~ a.cc:35:7: error: 'ans' was not declared in this scope; did you mean 'abs'? 35 | ans = i; | ^~~ | abs a.cc:39:11: error: 'ans' was not declared in this scope; did you mean...
s507331237
p03721
C++
// In His Name #include <Bits/stdc++.h> #define pb push_back #define F first #define S second #define ll long long #define gcd __gcd using namespace std; typedef pair<int, int> pii; ll n, k; map <ll, ll> mp; int main(){ ios_base::sync_with_stdio(0); cin >> n >> k; for (int i = 0 ; i < n ; i++){ int x, ...
a.cc:3:10: fatal error: Bits/stdc++.h: No such file or directory 3 | #include <Bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s509787778
p03721
C++
n, k = [int(i) for i in input().split()] m = sorted([[int(i) for i in input().split()] for _ in range(n)] s=0 i=0 while s<k: s += m[i][1] i += 1 print(m[i-1][0])
a.cc:1:1: error: 'n' does not name a type 1 | n, k = [int(i) for i in input().split()] | ^
s450248299
p03721
C++
#include <bits/stdc++.h> #define int long long using namespace std; int main() { int a,b; cin>>a>>b; vector<pair<int,int>> vec(a); for(int i=0;i<a;i++){ int X,Y; cin >> X >> Y; vec.at(i) = make_pair(X,Y); } sort(vec.begin(),vec.end()); int count = 0; int answer = 0; for(int i = 0;i < a;i++) { if(b - count...
cc1plus: error: '::main' must return 'int'
s421129856
p03721
C++
#include <bits/stdc++.h> #define int long long using namespace std; int main() { int a,b; cin>>a>>b; vector<pair<int,int>> c(a); for(int i=0;i<a;i++){ int X,Y; cin >> X >> Y; c.at(i) = make_pair(X,Y); } sort(c.begin(),c.end()); int count = 0; int answer = 0; for(int i = 0;i < a;i++) { if(b - count <= c[i]...
cc1plus: error: '::main' must return 'int'
s626857180
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; vector<pair<int,int>> c(a); for(int i=0;i<a;i++){ int X,Y; cin >> X >> Y; c.at(i) = make_pair(X,Y); } sort(vec.begin(),vec.end()); int count = 0; int answer = 0; for(int i = 0;i < a;i++) { if(b - count <= c[i].second) { ans...
a.cc: In function 'int main()': a.cc:12:8: error: 'vec' was not declared in this scope 12 | sort(vec.begin(),vec.end()); | ^~~ a.cc:21:10: error: expected '}' at end of input 21 | } | ^ a.cc:3:12: note: to match this '{' 3 | int main() { | ^
s103445380
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; vector<pair<int,int>> c(a); for(int i=0;i<a;i++){ int X,Y; cin >> X >> Y; c.at(i) = make_pair(X,Y); } sort(vec.begin(),vec.end()); int count = 0; int answer = 0; for(int i = 0;i < N;i++) { if(K - count <= vec[i].second) { a...
a.cc: In function 'int main()': a.cc:12:8: error: 'vec' was not declared in this scope 12 | sort(vec.begin(),vec.end()); | ^~~ a.cc:15:27: error: 'N' was not declared in this scope 15 | for(int i = 0;i < N;i++) { | ^ a.cc:16:20: error: 'K' was not declared in...
s983844791
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; vector<pair<int,int>> c(a); for(int i=0;i<a;i++){ int X,Y; cin >> X >> Y; c.at(i) = make_pair(X,Y); } sort(c.begin(), c.end()); int count=0; for(int i=0;i<a;i++){ if(b-count<=c[i].second){ cout<<c[i].first<<endl; break; } count+=c...
a.cc: In function 'int main()': a.cc:19:8: error: no match for 'operator+=' (operand types are 'int' and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'std::pair<int, int>'}) 19 | count+=c[i]second;
s632656798
p03721
C++
#include <bits/stdc++.h> #define ll long long #define rep(X,N) for(ll X = 0; X < (N); X++) #define PI (acos(-1.0)) #define sorta(V) sort(V.begin(), V.end()) #define pback push_back #define mpair make_pair #define MODN 1000000007 #define ALL(V) (V).begin(),(V).end() using namespace std; int main(){ int n ll ...
a.cc: In function 'int main()': a.cc:2:12: error: expected initializer before 'long' 2 | #define ll long long | ^~~~ a.cc:16:5: note: in expansion of macro 'll' 16 | ll k; | ^~ a.cc:17:12: error: 'n' was not declared in this scope; did you mean 'yn'? 17 | cin >> n >> k; ...
s339191865
p03721
C++
#include<bits/stdc++.h> #define rep(i,n,m) for(int i = (n); i <(m); i++) using namespace std; using ll = long long; int main() { ll n, k; cin >> n >> k; vector<int, int> ab; rep(i, 0, n) { int a, b; cin >> a >> b; ab.emplace_back(a, b); } sort(ab.begin(), ab.end());...
In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53, from a.cc:1: /usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<int, int>': /usr/i...
s964049674
p03721
C++
#include<bits/stdc++.h> using namespace std; #define ll long long ll n,k; ll a,b; vector<pair<ll,ll> > num; vector<pair<ll,ll> > ::iterator iter; int main(){ cin>>n>>k; for(int i=1;i<=n;i++) { cin>>a>>b; num.insert(make_pair(a,b)); } ll sum=0; for(iter=num.begin();iter!=num.end();iter++) ...
a.cc: In function 'int main()': a.cc:14:22: error: no matching function for call to 'std::vector<std::pair<long long int, long long int> >::insert(std::pair<long long int, long long int>)' 14 | num.insert(make_pair(a,b)); | ~~~~~~~~~~^~~~~~~~~~~~~~~~ In file included from /usr/include/c++...
s527363983
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; const int mod = (int)1e9 + 7; const int INF = (int)100100100; int main() { ll N; cin >> N; //ll N,M; cin >> N >> M; //string S; cin >> S; //ll H,W; cin >> H >> W; ll K; cin >> K; ll sum=0; ll num[100000]={}; for(int i=0;...
a.cc: In function 'int main()': a.cc:20:13: error: expected ',' or ';' before ':' token 20 | ll mat=0: | ^ a.cc:21:21: error: 'i' was not declared in this scope 21 | for(int i=0;i<100001;i++){ | ^
s968790696
p03721
C
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> /* define */#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> /* define */ #define Yes(X) puts ( X ? "Yes" : "No") #define YES(X) puts ( X ? "YES" :...
main.c:67:11: error: redefinition of 'MOD' 67 | const int MOD = (int)1e9 + 7; | ^~~ main.c:26:11: note: previous definition of 'MOD' with type 'int' 26 | const int MOD = (int)1e9 + 7; | ^~~ main.c:74:5: error: redefinition of 'cmp' 74 | int cmp(const void *a, const void *b) { ...
s234609462
p03721
C++
N, K = map(int, input().split()) acc = 0 while True: a, b = map(int, input().split()) acc += b if K <= acc: print(a) break
a.cc:1:1: error: 'N' does not name a type 1 | N, K = map(int, input().split()) | ^
s987838077
p03721
C++
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i) #define REPS(i,s,n) for(int i=(s), i##_len=(n); i<i##_len; ++i) #define ALL(obj) (obj).begin(),(obj).end() typedef unsigned int uint; typedef unsigned long long int ull; typedef long long int ll; typedef ...
a.cc: In function 'int main()': a.cc:30:9: error: expected initializer before 'll' 30 | ll K;cin>>N>>K; | ^~ a.cc:30:19: error: 'N' was not declared in this scope 30 | ll K;cin>>N>>K; | ^ a.cc:30:22: error: 'K' was not declared in this scope 30 | ll...
s217977697
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; cin>>a>>b; vector<pair<int,int>> d(a); for(int i=0;i<a;i++) { int e,f; cin >>e>>f; d.at(i) = make_pair(e,f); } sort(d.begin(), d.end()); for(int i=0;i<a;i++){ if(b<=c){ cout <<d[i].first; break; ...
a.cc: In function 'int main()': a.cc:20:13: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'second\U0000ff1b'; did you mean 'second'? 20 | c+=d[i].second; | ^~~~~~~~ | ...
s096318458
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; cin>>a>>b; vector<int> e(a); vector<int> d(a); for(int i=0;i<a;i++){ cin>>e.at(i); cin>>d.at(i); } sort(e.begin(), e.end()) for(int i=0;i<a;i++){ c+=d.at(i); if(b<=c){ cout <<e.at(i); break; ...
a.cc: In function 'int main()': a.cc:14:27: error: expected ';' before 'for' 14 | sort(e.begin(), e.end()) | ^ | ; 15 | for(int i=0;i<a;i++){ | ~~~ a.cc:15:15: error: 'i' was not declared in this scope 15 | for(...
s049917921
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; int g=0; cin>>a>>b; vector<int> e(a); vector<int> d(a); for(int i=0;i<a;i++) g+=e.at(i); vector<int> f(g); for(int i=0;i<a;i++){ cin>>e.at(i); cin>>d.at(i); } for(int i=0;i<a;i++){ for(int j=0;i<d.at(i);j+...
a.cc: In function 'int main()': a.cc:20:23: error: expected ';' before '}' token 20 | f.at(j)=e.at(i) | ^ | ; 21 | } | ~
s024791886
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; int g=0; cin>>a>>b; vector<int> e(a); vector<int> d(a); for(int i=0;i<a;i++) g+=e.at(i) vector<int> f(g); for(int i=0;i<a;i++){ cin>>e.at(i); cin>>d.at(i); } for(int i=0;i<a;i++){ for(int j=0;i<d.at(i);j++...
a.cc: In function 'int main()': a.cc:12:15: error: expected ';' before 'vector' 12 | g+=e.at(i) | ^ | ; 13 | vector<int> f(g); | ~~~~~~ a.cc:20:8: error: 'f' was not declared in this scope 20 | f.at(j)=e.at(i) | ^ a.cc:22:9: error...
s869494800
p03721
C++
#include<iostream> #include<vector> #include<map> #include<algorithm> #include<iomanip> int main(){ int N; long K; std::cin >> N >> K; std::map<int, int> ab; int temp1, temp2; for(int i = 0; i < N; i++){ std::cin >> temp1 >> temp2; auto itr = ab.find(temp1); if(itr != ab.end()) ab[temp1] += tem...
a.cc: In function 'int main()': a.cc:23:20: error: 'setprecision' was not declared in this scope; did you mean 'std::setprecision'? 23 | std::cout << setprecision(10) << x.first << std::endl; | ^~~~~~~~~~~~ | std::setprecision In file included from a.cc:5: /usr...
s332704329
p03721
C++
#include<bits/stdc++.h> using namespace std; int main(){ long N,K,p,q;cin>>N;K; vector<int> a; for(int i=0;i<N;i++){ cin>>p>>q; for(int j=0;j<b;j++)a.push_back(p); } sort(a.begin(),a.end()); cout<<a.at(K-1)<<endl; }
a.cc: In function 'int main()': a.cc:8:19: error: 'b' was not declared in this scope 8 | for(int j=0;j<b;j++)a.push_back(p); | ^
s599825794
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; cin>>a>>b; vector<int> c(a); vector<int> d(a); for(int i=0;i<a;i++){ cin>>c.at(i); cin>>d.at(i); } for(int i=0;i<a;i++){ c+=d.at(i); if(b<=c) cout <<c.at(i); } }
a.cc: In function 'int main()': a.cc:8:15: error: conflicting declaration 'std::vector<int> c' 8 | vector<int> c(a); | ^ a.cc:6:7: note: previous declaration as 'int c' 6 | int c=0; | ^ a.cc:11:8: error: request for member 'at' in 'c', which is of non-class type 'int' 11 |...
s891717746
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int a,b; int c=0; cin>>a>>b; vector<int> c(a); vector<int> d(a); for(int i=0;i<a;i++){ cin>>c.at(i); cin>>d.at(i); } for(int i=0;i<a;i++){ c+=d.at(i); if(b<=c) cout <<c.at(i); } }
a.cc: In function 'int main()': a.cc:8:15: error: conflicting declaration 'std::vector<int> c' 8 | vector<int> c(a); | ^ a.cc:6:7: note: previous declaration as 'int c' 6 | int c=0; | ^ a.cc:11:8: error: request for member 'at' in 'c', which is of non-class type 'int' 11 |...
s347265345
p03721
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; vector<vector<int>> c(2*a); for(int i=0;i<2*a;i++) cin>>c.at(i); vector<int> d(a); for(int i=0;i<a;i++) d.at(i)=c.at(2*i) sort() unsigned long long int d=0; for(int i=0;i<a;i++) d+=2*i+1; vector<int> e(d); ...
a.cc: In function 'int main()': a.cc:9:8: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::vector<int> >, std::vector<int> >::value_type' {aka 'std::vector<int>'}) 9 | cin>>c.at(i); | ~~~^~~~~~~~~ ...
s962598763
p03721
C++
#include<bits/stdc++.h> using namespace std; int main(){ int N; long long K; long long ans = 0; cin >> N >> K; int a, b; int t[100100]; for(int i=0; i< N; ++i) { cin >> a >> b; t[a] = b; } for(int i=0; i< 100100; ++i) { if(sum >= K){ cout << ...
a.cc: In function 'int main()': a.cc:17:12: error: 'sum' was not declared in this scope 17 | if(sum >= K){ | ^~~
s996400619
p03721
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <cmath> #include <vector> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { int a[100010], b[100010]; int N; ll K; cin >> N >> K; vector<pair<int, int>> v(N); ...
a.cc: In function 'int main()': a.cc:21:11: error: 'class std::vector<std::pair<int, int> >' has no member named 'push' 21 | v.push.back(make_pair(a2, b2)); | ^~~~
s212793508
p03721
C++
#include <iostream> #include <cstdio> #include <string> #include <algorithm> #include <cmath> #include <vector> #define rep(i, n) for(int i = 0; i < n; i++) using namespace std; typedef long long ll; int main() { int a[100010], b[100010]; int N; ll K; cin >> N >> K; vector<pair<int, int>> v; r...
a.cc: In function 'int main()': a.cc:21:11: error: 'class std::vector<std::pair<int, int> >' has no member named 'push' 21 | v.push.back(make_pair(a2, b2)); | ^~~~
s366937150
p03721
C++
#include "bits/stdc++.h" using namespace std; void solve(void) { long n, k; cin >> n >> k; vector<pair<long, long>> ps(n); for (int i = 0; i < n; i++) { cin >> ps[i].first >> ps[i].second; } sort(ps.begin(), ps.end()); long now = 0; for (int i = 0; i < n; i++) { now += bs[i]; if (now >= k) { cout...
a.cc: In function 'void solve()': a.cc:18:24: error: 'bs' was not declared in this scope; did you mean 'ps'? 18 | now += bs[i]; | ^~ | ps a.cc:21:33: error: 'as' was not declared in this scope; did you mean 'ps'? 21 | ...
s558233305
p03721
C++
#define _CRT_SECURE_NO_WARNINGS #define MATH_PI 3.14159265358979323846264338327950288419716939 #define DIVIDER9 1000000007 #define lli long long int #include <iostream> #include <string.h> #include <fstream> #include <math.h> #include <iomanip> using namespace std; #ifdef _WIN32 #pragma warning(disable : 4101) sign...
a.cc:249:20: error: 'int index [100010][2]' redeclared as different kind of entity 249 | int index[100010][2]; | ^ In file included from /usr/include/string.h:462, from a.cc:6: /usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)' 5...
s782270094
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { map<int,int> cnt; int n,q; cin>>n>>q; int x,y; for(int i=0 ; i<n ; ++i) { cin>>x>>y; cnt[x]+=y; } for(auto &i:cnt) { if(i.second>=q) { cout<<i.first<<endl return 0; } q-=i...
a.cc: In function 'int main()': a.cc:19:36: error: expected ';' before 'return' 19 | cout<<i.first<<endl | ^ | ; 20 | return 0; | ~~~~~~
s807270788
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { map<int,int> cnt; int n,q; cin>>n>>q; int x,y; for(int i=0 ; i<n ; ++i) { cin>>x>>y; cnt[x]+=y; } for(auto &i:cnt) { if(i.second>=q) { cout<<i.first<<endl return 0; } q-=i...
a.cc: In function 'int main()': a.cc:19:36: error: expected ';' before 'return' 19 | cout<<i.first<<endl | ^ | ; 20 | return 0; | ~~~~~~
s848489257
p03721
C++
using ll = long long; const int AMAX = 100000; ll cnt[AMAX + 1]; int main(void) { int N; ll K; cin >> N >> K; for (int i = 0; i < N; ++i) { int A, B; cin >> A >> B; cnt[A] += B; } for (int ans = 1; ans <= AMAX; ++ans){ if (K <= cnt[ans]) { cout << ans << endl; break; } ...
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> N >> K; | ^~~ a.cc:14:13: error: 'cout' was not declared in this scope 14 | cout << ans << endl; | ^~~~ a.cc:14:28: error: 'endl' was not declared in this scope 14 | ...
s979044581
p03721
C++
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 using ll = long long; const int AMAX = 100000; ll cnt[AMAX + 1]; int main(void) { int N; ll K; cin >> N >> K; for (int i = 0; i < N; ++i) { int A, B; cin >> A >> B; cnt[A] += B; } for (int ans = 1; ans <= AMAX; ++ans){ i...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 2 3 4 5 6 7 8 9 | ^ a.cc:5:1: error: 'll' does not name a type 5 | ll cnt[AMAX + 1]; | ^~ a.cc: In function 'int main()': a.cc:8:5: error: 'll' was not declared in this scope 8 | ll K; | ^~ a.cc:9:5: error: 'cin' ...
s501163020
p03721
C++
#include<iostream> #include<string> #include<vector> #include<algorithm> #include<bitset> #include<set> #include<map> #include<stack> #include<queue> #include<iomanip> using namespace std; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1e9+7 ...
a.cc: In function 'int main()': a.cc:21:11: error: expected unqualified-id before ';' token 21 | int N,;cin >> N; | ^
s236485913
p03721
C++
#include<bits/stdc++.h> using namespace std; //define #define int long long #define rep(x,y) for(int i=x;i<y;i++) #define REP(x,y) for(int j=x;j<y;j++) #define Rep(x,y) for(int k=x;k<y;k++) #define str string //vectordefine #define vint vector<int> #define vvint vector<vector<int>> #define vc vector<char> #define vvc v...
a.cc:121:8: error: redefinition of 'struct UnionFind' 121 | struct UnionFind{ | ^~~~~~~~~ a.cc:58:8: note: previous definition of 'struct UnionFind' 58 | struct UnionFind{ | ^~~~~~~~~ a.cc:143:8: error: redefinition of 'int main()' 143 | signed main(){ | ^~~~ a.cc:80:8: not...
s612679435
p03721
C++
#include<bits/stdc++.h> using namespace std; //define #define int long long #define rep(x,y) for(int i=x;i<y;i++) #define REP(x,y) for(int j=x;j<y;j++) #define Rep(x,y) for(int k=x;k<y;k++) #define str string //vectordefine #define vint vector<int> #define vvint vector<vector<int>> #define vc vector<char> #define vvc v...
a.cc: In function 'int main()': a.cc:78:2: error: expected '}' at end of input 78 | } | ^ a.cc:64:14: note: to match this '{' 64 | signed main(){ | ^
s407801913
p03721
C++
#include<bits/stdc++.h> #define all(x) (x).begin(),(x).end() typedef long long ll; #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) #define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i) #define repprev(i,a,b) for(ll i=b-1;i>=a;i--) #define reprev(i,n) repprev(i,0,n) using namespace std; #define sz(x)...
a.cc: In function 'int main()': a.cc:193:11: error: 'n' was not declared in this scope 193 | rep(i,n){ | ^ a.cc:4:39: note: in definition of macro 'rep' 4 | #define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i) | ^
s093624642
p03721
C++
#include <iostream> #include <math.h> #include <algorithm> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> using namespace std; long long int main() { long long int N,ans=0,K; cin >> N >> K; vector<pair<long long int, long long int>>A(N); for (long long int i = 0; i < N; i++)...
a.cc:10:11: error: '::main' must return 'int' 10 | long long int main() { | ^~~
s225699309
p03721
C++
#include <bits/stdc++.h> using namespace std; int main() { int N,K; cin >> N >> K; int bsum=0; int a=0; for(int i=0;bsum<K;i++){ cin >> a >> b; bsum+=b; } cout << a << endl; }
a.cc: In function 'int main()': a.cc:10:17: error: 'b' was not declared in this scope 10 | cin >> a >> b; | ^
s079021614
p03721
C++
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <map> #include <unordered_map> #include <set> #include <queue> using namespace std; #define ALL(x) (x).begin(),(x).end() #define SZ(x) int((x).size()) #define OUT(x) cout << ...
a.cc: In function 'int main()': a.cc:27:14: error: expected unqualified-id before '>' token 27 | vector<ll>> dic(100010,0); | ^~ a.cc:30:9: error: 'dic' was not declared in this scope; did you mean 'div'? 30 | dic[a] += b; | ^~~ | div a.cc:34:16: error: '...
s445861452
p03721
C++
#include <bits/stdc++.h> #define ld long double #define ll long long int #define ull unsigned long long int using namespace std; ll main() { ll N, K; cin >> N >> K; vector<ll> a(N); vector<ll> b(N); for (ll i = 0; i < N; ++i) { cin >> a[i]; cin >> b[i]; } /** * メモリエ...
a.cc:4:22: error: '::main' must return 'int' 4 | #define ll long long int | ^~~ a.cc:9:1: note: in expansion of macro 'll' 9 | ll main() { | ^~
s018073301
p03721
Java
import java.util.Scanner; public class C_61_BigArray { public static void main(String[] args) { final int MAX_NUM = 1000000; Scanner sc = new Scanner(System.in); int[] backet = new int[MAX_NUM + 1]; int cnt = 0; int numberOfIns = sc.nextInt(); int numberOfArrLengt...
Main.java:3: error: class C_61_BigArray is public, should be declared in a file named C_61_BigArray.java public class C_61_BigArray { ^ 1 error
s922049123
p03721
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; vector<int> c(100000); for(int i=0;i<n;i++){ int a,b; cin>>a>>b; c.at(a)+=b; } for(int i=0;i<100000;i++){ if(k>c.at(i)){ k-=c.at(i); continue; } else{ cout<<i<<endl; break; } }
a.cc: In function 'int main()': a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s139875457
p03721
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; vector<int> c(100000); for(int i=0;i<n;i++){ int a,b; cin>>a>>b; c.at(a)+=b; } for(int i=0;i<100000;i++){ if(k>a.at(i)){ k-=a.at(i); continue; } else{ cout<<i<<endl; break; } }
a.cc: In function 'int main()': a.cc:13:10: error: 'a' was not declared in this scope 13 | if(k>a.at(i)){ | ^ a.cc:21:2: error: expected '}' at end of input 21 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s239344552
p03721
C++
#include <bits/stdc++.h> using namespace std; #define int long long const lint INF = 1E9; #define P pair<int, int> signed main() { int N, K; cin >> N >> K; vector<P> lis; for(int i = 0; i < N; ++i){ int a, b; cin >> a >> b; lis.push_back(make_pair(a, b)); } sort(li...
a.cc:6:7: error: 'lint' does not name a type; did you mean 'uint'? 6 | const lint INF = 1E9; | ^~~~ | uint
s045701227
p03721
C++
#include <iostream> using namespace std; int main() { int n, k; int a, b; cin >> n >> k; for (int i = 0; i < n; i++) { cin >> a >> b; k -= b; if (k <= 0) { cout << a << endl; return (0); } }
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s163922349
p03721
C++
#include <iostream> #include <stdio.h> #include <string> #include <algorithm> #include <cmath> #include <vector> #include <functional> #include <cstdlib> using namespace std; #define REP(i,n); for(int i = 0;i < (int)(n);i++) int main() { int n,k,sum=0,ans; vector<int> a,b; cin >> n >> k; a.resize(n); b.resize(n); ...
a.cc: In function 'int main()': a.cc:23:35: error: expected ';' before 'break' 23 | ans = a[i] | ^ | ; 24 | break; | ~~~~~
s898146955
p03721
C++
#include <iostream> #include <stdio.h> #include <string> #include <algorithm> #include <cmath> #include <vector> #include <functional> #include <cstdlib> using namespace std; #define REP(i,n); for(int i = 0;i < (int)(n);i++) int main() { int n,k,sum=0; vector<int> a,b; cin >> n >> k; a.resize(n); b.resize(n); REP...
a.cc: In function 'int main()': a.cc:24:19: error: 'i' was not declared in this scope 24 | cout << a[i]; | ^
s215356075
p03721
C++
#include<bits/stdc++.h> using namespace std; int main(void){ int n, k;cin>>n>>k; queue<pair<int, int>> q; for(int i=0;i<n;i++){ int a, b;cin>>a>>b; q.push(make_pair(a, b)) } int sum=0; int ans; for(int i=0;i<n;i++){ pair<int, int> p=q.pop(); sum+=p.second if(sum>=k){ ans=p.first...
a.cc: In function 'int main()': a.cc:9:28: error: expected ';' before '}' token 9 | q.push(make_pair(a, b)) | ^ | ; 10 | } | ~ a.cc:14:27: error: conversion from 'void' to non-scalar type 'std::pair<int, int>...
s530071764
p03721
C++
#include<iostream> #include <vector> #include <algorithm> #include <string> #include <cmath> using namespace std; using ll=long long; #define REP(i, n) for(int i = 0; i < (int)n; ++i) #define REP1(i, n) for(int i = 1; i < (int)n; ++i) #define REPll1(i, n) for(ll i = 1; i*i < (int)n; ++i) char alphabet[26] = {'a', '...
a.cc: In function 'int main()': a.cc:33:10: error: 'MAX1eE5' was not declared in this scope; did you mean 'MAX1E5'? 33 | ll A[MAX1eE5+1] = {}; | ^~~~~~~ | MAX1E5 a.cc:36:9: error: 'A' was not declared in this scope 36 | A[a] += b; | ^ a.cc:40:18: error: 'A' ...
s175157440
p03721
C++
#include<iostream> #include <vector> #include <algorithm> #include <string> #include <cmath> using namespace std; using ll=long long; #define REP(i, n) for(int i = 0; i < (int)n; ++i) #define REP1(i, n) for(int i = 1; i < (int)n; ++i) #define REPll1(i, n) for(ll i = 1; i*i < (int)n; ++i) char alphabet[26] = {'a', '...
a.cc: In function 'int main()': a.cc:38:13: error: 'MAX1E5' was not declared in this scope; did you mean 'MAX1eE5'? 38 | REP1(i, MAX1E5+1) { | ^~~~~~ a.cc:10:45: note: in definition of macro 'REP1' 10 | #define REP1(i, n) for(int i = 1; i < (int)n; ++i) | ...
s882359269
p03721
C++
#include<iostream> #include <vector> #include <algorithm> #include <string> #include <cmath> using namespace std; using ll=long long; #define REP(i, n) for(int i = 0; i < (int)n; ++i) #define REP1(i, n) for(int i = 1; i < (int)n; ++i) #define REPll1(i, n) for(ll i = 1; i*i < (int)n; ++i) char alphabet[26] = {'a', '...
a.cc: In function 'int main()': a.cc:40:20: error: expected ']' before ')' token 40 | if (K < A[i) { | ^ | ]
s896875829
p03721
C++
#include <iostream> using namespace std; struct ab{ int a; int b; }; int cmp(const void *a, const void*b) { return ((ab*)a)->a - ((ab*)b)->a; } int main(void){ ab ab[100000]; ll N,K; cin >> N >> K; int i; for(i=0;i<N;i++){ cin >> ab[i].a >> ab[i].b; } qsort(ab,N,sizeof(struct ab),cmp); ll count = 0; for...
a.cc: In function 'int main()': a.cc:15:9: error: 'll' was not declared in this scope 15 | ll N,K; | ^~ a.cc:16:16: error: 'N' was not declared in this scope 16 | cin >> N >> K; | ^ a.cc:16:21: error: 'K' was not declared in this scope 16 | cin >> N >>...
s665867229
p03721
C++
#include <iostream> #include <cstdio> #include <queue> #include <vector> #include <stack> #include <string> #include <tuple> #include <random> #include <map> #include <set> #include <complex> #include <algorithm> #include <cassert> #include <iterator> #include <numeric> #include <cmath> #include <stdio.h> #include <fun...
a.cc: In function 'int main()': a.cc:43:22: error: expected ';' before ':' token 43 | K-=kosuu[ans]: | ^ | ;
s531316701
p03721
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> #define REP(i,n) for(i=0;i<n;i++) int iin() { int i; scanf("%d", &i); return i; } long long llin() { long long i; scanf("%lld", &i); return i; } double din() { double i; scanf("%lf", &i);...
main.c: In function 'main': main.c:87:17: error: 'ONT_MAX' undeclared (first use in this function); did you mean 'INT_MAX'? 87 | long long c[ONT_MAX]; | ^~~~~~~ | INT_MAX main.c:87:17: note: each undeclared identifier is reported only once for each function it appears ...
s578112424
p03721
C++
#include <bits/stdc++.h> using namespace std; using ll = long long; ll main(){ ll n,x,ans=0; cin >> n >> x; vector<pair<ll,ll>> v(n);//どの数字が何個か vector<ll> sum(n+1);//累積和 sum.at(0)=0; for(ll i=0;i < n;i++){ cin >> v.at(i).first >> v.at(i).second; } sort(v.begin(),v.end());//数...
a.cc:4:1: error: '::main' must return 'int' 4 | ll main(){ | ^~
s239440025
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> p; int main() { ll n,k,cnt=0; cin >> n >> k; int ans=0; vector<p> v(n); for(int i=0; i<n; i++) { int a,b; cin >> a >> b; v[i].first=a; v[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i++)...
a.cc: In function 'int main()': a.cc:18:10: error: 'b' was not declared in this scope 18 | cnt+=b; | ^ a.cc:20:11: error: 'a' was not declared in this scope 20 | ans=a; | ^
s701608761
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) P; int main() { ll n,k,cnt=0; cin >> n >> k; int ans=0; vector<P> A(n); for(int i=0; i<n; i++) { int a,b; cin >> a >> b; A[i].first=a; A[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i++)...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) P; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) P; | ~^~~ | ) a.cc: In function 'int main()': a.cc:9:10: error: 'P' was not declared in this sco...
s702608178
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) P; int main() { ll n,k,cnt=0; int ans=0; cin >> k >> n; vector<P> A(n); for(int i=0; i<n; i++) { int a,b; cin >> a >> b; A[i].first=a; A[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i+...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) P; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) P; | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:10: error: 'P' was not declared in this sc...
s865018423
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) P; int main() { ll k,cnt=0; int n,ans=0; cin >> k >> n; vector<P> v(n); for(int i=0; i<n; i++) { int a,b; cin >> a >> b; v[i].first=a; v[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i+...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) P; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) P; | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:10: error: 'P' was not declared in this sc...
s818703717
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) P; int main() { ll k,cnt=0; int n,a,b,ans=0; cin >> k >> n; vector<P> v(n); for(int i=0; i<n; i++) { cin >> a >> b; v[i].first=a; v[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i++) { ...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) P; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) P; | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:10: error: 'P' was not declared in this sc...
s076863120
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) p; int main() { ll k,cnt=0; int n,a,b,ans=0; cin >> k >> n; vector<p> v(n); for(int i=0; i<n; i++) { cin >> a >> b; v[i].first=a; v[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i++) { ...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) p; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) p; | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:10: error: 'p' was not declared in this sc...
s525771829
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair(int,int) p; int main() { ll k,cnt=0; int n,a,b,ans=0; cin >> k >> n; vector<p> v(n); for(int i=0; i<n; i++) { cin >> a >> b; v[i].first=a; v[i].second=b; } sort(v.begin(),v.end()); for(int i=0; i<n; i++) { ...
a.cc:4:14: error: expected unqualified-id before 'int' 4 | typedef pair(int,int) p; | ^~~ a.cc:4:14: error: expected ')' before 'int' 4 | typedef pair(int,int) p; | ~^~~ | ) a.cc: In function 'int main()': a.cc:10:10: error: 'p' was not declared in this sc...
s484558837
p03721
C
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <time.h> #define _CRT_SECURE_NO_WARNINGS #define TLong long long typedef struct { int a; // num int b; // count } elm; int comp(const void *p,const void *q){ return ((elm *)p)->a - ((elm *)q)->a; } int main(int argc, char c...
main.c: In function 'main': main.c:23:52: error: expected expression before 'elm' 23 | for(i = 0; i < n; ++i) scanf("%lld%lld", &elm[i].a, &elm[i].b); | ^~~ main.c:25:46: error: expected expression before 'elm' 25 | for(i = 0; (i < n && j < k); +...
s615505371
p03721
C++
#ABC061C N,K=map(int,input().split()) A={} for n in range(N): a,b=map(int,input().split()) A[a]=A.get(a,0)+b for key in sorted(list(A.keys())): K-=A[key] if K<=0: print(key) break
a.cc:1:2: error: invalid preprocessing directive #ABC061C 1 | #ABC061C | ^~~~~~~ a.cc:2:1: error: 'N' does not name a type 2 | N,K=map(int,input().split()) | ^ a.cc:4:1: error: expected unqualified-id before 'for' 4 | for n in range(N): | ^~~
s408879370
p03721
C++
#include<bits/stdc++.h> using namespace std; int main(){ long long n,k; cin>>n>>k; int a[n],b[n]; vector<pair<int,int>> v; for(int i=0;i<n;i++){ cin>>a[i]>>b[i]; v.push_back(make_pair(a[i],b[i])); } sort(v.begin(),v.end()); long long cnt=0; for(auto i:v){ cnt...
a.cc: In function 'int main()': a.cc:16:22: error: expression cannot be used as a function 16 | cnt+=i.second(); | ~~~~~~~~^~
s114422548
p03721
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n; long long int k,count=0; cin >> n >> k; vector<int> a(n),b(n) vector<long long int> c(100001,0); for(int i=0;i<n;i++)cin >> a.at(i) >> b.at(i); for(int i=0;i<n;i++)c.at(a.at(i))+=b.at(i); for(int i=1;i<100001;i++){ count ...
a.cc: In function 'int main()': a.cc:10:3: error: expected ',' or ';' before 'vector' 10 | vector<long long int> c(100001,0); | ^~~~~~ a.cc:12:23: error: 'c' was not declared in this scope 12 | for(int i=0;i<n;i++)c.at(a.at(i))+=b.at(i); | ^ a.cc:14:14: error: 'c' was not d...
s665357856
p03721
C++
#include <iostream> #include <vector> using namespace std; int main(){ int n; long long int k,count=0; cin >> n >> k; vector<int> a(n),b(n) vector<long long int>c(100001,0); for(int i=0;i<n;i++)cin >> a.at(i) >> b.at(i); for(int i=0;i<n;i++)c.at(a.at(i))+=b.at(i); for(int i=1;i<100001;i++){ count +...
a.cc: In function 'int main()': a.cc:10:3: error: expected ',' or ';' before 'vector' 10 | vector<long long int>c(100001,0); | ^~~~~~ a.cc:12:23: error: 'c' was not declared in this scope 12 | for(int i=0;i<n;i++)c.at(a.at(i))+=b.at(i); | ^ a.cc:14:14: error: 'c' was not de...
s718207305
p03721
C++
#include<bits/stdc++.h> #include<iostream> using namespace std; int main(){ int N,K; cin >> N >> K; for(int i=0;i<N,i++){ int A,B; cin >> A >> B; K -= B; if(K<=0){ cout << A << endl; return 0; } } }
a.cc: In function 'int main()': a.cc:8:22: error: expected ';' before ')' token 8 | for(int i=0;i<N,i++){ | ^ | ;
s599428391
p03721
C++
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef long long int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #d...
a.cc: In function 'void input()': a.cc:24:15: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(double)' 24 | ab.push_back(INF); | ~~~~~~~~~~~~^~~~~ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, ...
s180280942
p03721
C++
#include <bits/stdc++.h> using namespace std; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } typedef long long int ll; #define EPS (1e-7) #define INF (1e9) #define PI (acos(-1)) #d...
a.cc: In function 'void input()': a.cc:25:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse] 25 | int main() | ^~ a.cc:25:9: note: remove parentheses to default-initialize a variable 25 | int main() | ^~ | -- a.cc:25:9: note: or re...
s088872155
p03721
C++
#include <iostream> #include <iostream> #include <vector> #include <queue> #include <utility> #include <algorithm> using namespace std; #define Pair pair<int, int> int N, K; int a[100000]; int b[100000]; vector<Pair> ab; bool compare(Pair x, Pair y){ return x.first < y.first; } int solve(){ int count=0; int ans; ...
a.cc: In function 'int main()': a.cc:40:20: error: 'class std::vector<std::pair<int, int> >' has no member named 'puch_back'; did you mean 'push_back'? 40 | ab.puch_back({a[i], b[i]}); | ^~~~~~~~~ | push_back
s115700353
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<ll, ll> pll; #define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i)) #define REP(i, n) FOR(i, n, 0) #define OF64 std::setprecision(10) const ll MOD = 1000000007; const ll INF = (ll)1e15; pll T[100005]; int main() { int N; ...
a.cc: In lambda function: a.cc:25:63: error: expected ';' before '}' token 25 | sort(T, T + N, [](pll a, pll b) { return a.first < b.first }); | ^~ | ;
s089022836
p03721
C++
#include <bits/stdc++.h> using namespace std; int n; ll k; vector<pair<int, int>> x; void solve() { int i = 0; sort(x.begin(), x.end()); while (k > 0) { k -= x[i].second; if (k > 0) { i++; } } cout << x[i].first << "\n"; } int main() { int i; cin >> n >> k; x.resize(n); for (...
a.cc:5:1: error: 'll' does not name a type 5 | ll k; | ^~ a.cc: In function 'void solve()': a.cc:13:10: error: 'k' was not declared in this scope 13 | while (k > 0) { | ^ a.cc: In function 'int main()': a.cc:26:15: error: 'k' was not declared in this scope 26 | cin >> n >> k; | ...
s733491840
p03721
C
N,K = map(int,raw_input().split()) data = [map(int,raw_input().split()) for i in range(N)] data.sort() cnt = 0 for i in data: cnt += i[1] if cnt >= K: print i[0] break
main.c:1:1: warning: data definition has no type or storage class 1 | N,K = map(int,raw_input().split()) | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'K' [-Wimplicit-int] 1 | N,K = map(int,raw_input().split...
s932204360
p03721
C++
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll arr[100005]; int main() { ll n,k; cin>>n>>k; for(int i=0;i<n;i++){ int a,b; cin>>a>>b; arr[a]+=b; } for(ill i=1;i<=100000;i++){ k-=arr[i]; if(k<=0){ cout<<i; retur...
a.cc: In function 'int main()': a.cc:16:9: error: 'ill' was not declared in this scope; did you mean 'll'? 16 | for(ill i=1;i<=100000;i++){ | ^~~ | ll a.cc:16:17: error: 'i' was not declared in this scope 16 | for(ill i=1;i<=100000;i++){ | ^
s215675457
p03721
C++
#include<iostream> #include<vector> using namespace std; int main(){ long long n, k, a, b; cin >> n >> k; vector<long long> v; for(long long i = 0 ; i < n; i++){ cin >> a >> b; vector<long long> c(b, a); v.insert(v.end(), c.begin(), c.end()); } sort(v.begin(), v.end()); cout << v[k-1] << end...
a.cc: In function 'int main()': a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(v.begin(), v.end()); | ^~~~ | short
s993924788
p03721
C++
#include<bits/stdc++.h> using namespace std; using ll = long long; #define MM = 1000000000; #define mod = MM + 7; #define INF (ll)1e18 #define pi acos(-1.0) #define MAX 100005 #define NIL -1 #define rep(i, n) for(int i = 0; i < n; i++) int dx[4] = {0, 1, 0, -1}; int dy[4] = {1, 0, -1, 0}; int main(){ ll n, k; cin >...
a.cc: In function 'int main()': a.cc:16:5: error: 'sum' was not declared in this scope 16 | sum = 0; | ^~~
s976575571
p03721
C++
#include <iostream> #include <vector> using namespace std; typedef long long ll; #define INF (1e9) int main(int argc, const char *argv[]) { ll N, K, a, b; cin >> N >> K; vector<pair<ll, ll> > v; for (ll i = 0; i < N; i++) { cin >> a >> b; v.push_back(pair<ll, ll>(a, b)); } ...
a.cc: In function 'int main(int, const char**)': a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'? 21 | sort(v.begin(), v.end()); | ^~~~ | short
s134667711
p03721
C++
using namespace std; #include<bits/stdc++.h> #define BEGIN ios_base::sync_with_stdio(0);cin.tie(0) #define END return EXIT_SUCCESS #define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++) #define REP(I,N) FOR(I,0,N) #define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++) #define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--) #define IN(P) cin>>(P) ...
a.cc: In function 'void solve()': a.cc:38:41: error: conversion from '_Rb_tree_iterator<pair<[...],int>>' to non-scalar type '_Rb_tree_iterator<pair<[...],long int>>' requested 38 | for(map<int,long>::iterator it=v.begin();it!=v.end();it++){ | ~~~~~~~^~ a.cc:38:46: error: no ...
s876134370
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final int a; public final long b; public Tuple(int a, long b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { Scanner scanner = new Scanner(System...
Main.java:21: error: incompatible types: possible lossy conversion from long to int int b = scanner.nextLong(); ^ 1 error
s328845839
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final int a; public final long b; public Tuple(int a, long b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { Scanner scanner = new Scanner(System...
Main.java:21: error: incompatible types: possible lossy conversion from long to int int b = scanner.nextLong(); ^ 1 error
s654517029
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final int a; public final long b; public Tuple(int a, long b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { Scanner scanner = new Scanner(System...
Main.java:22: error: incompatible types: possible lossy conversion from long to int ab[i] = new Tuple(a, b); ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 1 error
s831456795
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final long a; public final long b; public Tuple(long a, long b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { Scanner scanner = new Scanner(Syst...
Main.java:16: error: incompatible types: possible lossy conversion from long to int int N = scanner.nextLong(); ^ Main.java:25: error: incompatible types: possible lossy conversion from long to int Arrays.sort(ab, (x, y) -> Integer.compare(x.a, y.a)); ...
s427907707
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final long a; public final long b; public Tuple(long a, long b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { Scanner scanner = new Scanner(Syst...
Main.java:18: error: incompatible types: possible lossy conversion from long to int Tuple[] ab = new Tuple[N]; ^ Main.java:19: error: incompatible types: int cannot be converted to Long for (Long i = 0; i < N; i++) { ^ Main.java:22: error: incompatible types: Long ca...
s209036417
p03721
Java
import java.io.*; import java.util.*; public class Main { private static class Tuple { public final int a; public final int b; public Tuple(int a, int b) { this.a = a; this.b = b; } } public static void main(String[] args) throws Throwable { return; Scanner scanner = new Scan...
Main.java:16: error: unreachable statement Scanner scanner = new Scanner(System.in); ^ 1 error
s133326968
p03721
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; long long intk; cin >> n >> k; vector<long long int> num(100001,0); for(int i = 0;i < n;i++){ int a,b; cin >> a >> b; num[a] += b; } long int count = 0; for(int i = 1;i <= 100000;i++){ count += num[i]; if(count >= k){ ...
a.cc: In function 'int main()': a.cc:6:15: error: 'k' was not declared in this scope 6 | cin >> n >> k; | ^
s099303841
p03721
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n,k; cin >> n >> k; vector<int> num(100001,0); for(int i = 0;i < n;i++){ int a,b; cin >> a >> b; num[a] += b; } int count = 0; for(int i = 1;i < 100001;i++){ count += num[i]; if(count >= k){ cout << i << endl; br...
a.cc: In function 'int main()': a.cc:19:4: error: expected '}' at end of input 19 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s946783479
p03721
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) #define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;} #define MAX_N 1002 #define i197 1000000007 using namespace std; typedef long long ll; typedef pair<ll,ll> P1; typedef pair<int,int> Pi; typedef ...
a.cc: In function 'int main()': a.cc:35:22: error: no matching function for call to 'max(int&, ll&)' 35 | r=max(r,a[i]); | ~~~^~~~~~~~ In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, ...
s514172246
p03721
C
#define _USE_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> #include <stdbool.h> #define inf (INT_MAX-1) #define INF 9223372036854775807; #define PI 3.14159265358979323846; #define EPS 1e-10 #define sq(n) ((n)*(n)) #define rep(i,n) for(i=0;i<n;i++) #d...
main.c:58:20: error: expected ']' before ';' token 58 | #define FMAX 100002; | ^ main.c:59:13: note: in expansion of macro 'FMAX' 59 | long long f[FMAX] = {0}; | ^~~~ main.c: In function 'main': main.c:68:17: error: 'f' undeclared (first use in this function) 68 | ...
s407562732
p03721
C++
#include<bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; int main() { int a,b; cin>>a>>b; //if(a*b/3%a!=0||a*b/3%b!=0) cout<<4; else cout<<a*b%3; }
a.cc: In function 'int main()': a.cc:10:9: error: 'else' without a previous 'if' 10 | else cout<<a*b%3; | ^~~~
s383705877
p03721
C++
#include<bits/stdc++.h> using namespace std; pair<int,int> v[1e5+10]; int main(){ long long n,k,i,j; cin>>n>>k; for(i=1;i<=n;i++){ int t1,t2; cin>>t1>>t2; v[i].first=t1; v[i].second=t2; } sort(v+1,v+n+1); int pre=0,ans; for(i=1;i<=n;i++){ if(pre<k&&k<=pre+v[i].second){ ans=v[i].first; break; ...
a.cc:3:20: error: conversion from 'double' to 'long unsigned int' in a converted constant expression 3 | pair<int,int> v[1e5+10]; | ~~~^~~ a.cc:3:20: error: could not convert '(1.0e+5 + (double)10)' from 'double' to 'long unsigned int' 3 | pair<int,int> v[1e5+10]; | ~...
s501515267
p03721
C++
#include<bits/stdc++.h> using namespace std; int v[100010]; int main(){ int n,k,i,j,k=0; cin>>n>>k; for(i=1;i<=n;i++){ int t1,t2; cin>>t1>>t2; for(j=1;j<=t2;j++){ v[++k]=t1; } } sort(v+1,v+k+1); cout<<v[k]; }
a.cc: In function 'int main()': a.cc:5:21: error: redeclaration of 'int k' 5 | int n,k,i,j,k=0; | ^ a.cc:5:15: note: 'int k' previously declared here 5 | int n,k,i,j,k=0; | ^
s561976977
p03721
C++
using ll = long long; const int AMAX = 100000; ll cnt[AMAX + 1]; int main(void) { int N; ll K; cin >> N >> K; for (int i = 0; i < N; ++i) { int A, B; cin >> A >> B; cnt[A] += B; } for (int ans = 1; ans <= AMAX; ++ans){ if (K <= cnt[ans]) { cout << ans...
a.cc: In function 'int main()': a.cc:7:5: error: 'cin' was not declared in this scope 7 | cin >> N >> K; | ^~~ a.cc:16:13: error: 'cout' was not declared in this scope 16 | cout << ans << endl; | ^~~~ a.cc:16:28: error: 'endl' was not declared in this scope 16 | ...
s308314256
p03721
C++
1 using ll = long long; 2 const int AMAX = 100000; 3 ll cnt[AMAX + 1]; 4 5 int main(void) { 6 int N; 7 ll K; 8 cin >> N >> K; 9 10 for (int i = 0; i < N; ++i) { 11 int A, B; 12 cin >> A >> B; 13 cnt[A] += B; 14 } 15 16 for (int ans = 1; ans <= AMAX; ++ans){ 17 if (K <= cnt[ans]) { 18 cout << ans << endl; 19 break; 20 }...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 using ll = long long; | ^ a.cc:2:1: error: expected unqualified-id before numeric constant 2 | 2 const int AMAX = 100000; | ^ a.cc:3:1: error: expected unqualified-id before numeric constant 3 | 3 ll cnt[AMAX + 1]; | ^ ...
s166511805
p03721
C++
#include<iostream> #include<vector> using namespace std; typedef long long ll; int main() { int n; ll k; cin >> n >> k; vector<pair<int, int>> v; for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; v.push_back(make_pair(a, b)); } sort(v.begin(), v.end()); vecto...
a.cc: In function 'int main()': a.cc:15:5: error: 'sort' was not declared in this scope; did you mean 'short'? 15 | sort(v.begin(), v.end()); | ^~~~ | short
s756953287
p03721
C++
#include<iostream> using namespace std; typedef pair<int, int> P; #define N 100000 int main() { int n, k; cin >> n >> k; int a[N], b[N]; P p[N]; for (int i = 0; i < n; i++) { cin >> a[i] >> b[i]; p[i] = {a[i], b[i]}; } sort(p, p + n); long long sum = 0; for (int i = 0...
a.cc: In function 'int main()': a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'? 14 | sort(p, p + n); | ^~~~ | short