submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s869461523 | p03721 | C++ | #include<iostream>
using namespace std;
int main() {
int check[100000];
int n, k;
cin >> n >> k;
int cnt = 0;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
for (int j = 0; j < b; j++) {
check[cnt] = a;
cnt++;
}
}/*
for (int i =... | a.cc: In function 'int main()':
a.cc:19:5: error: 'sort' was not declared in this scope; did you mean 'short'?
19 | sort(check, check + n);
| ^~~~
| short
|
s820377874 | p03721 | C | #include<stdio.h>
int main(){
long long k,tmp=0,ans[100001]={0};
int n;scanf("%d%d",&n,&k);
int a,b,i;
long long tmp=0,ans[100001]={0};
for(i=0;i<n;i++){
scanf("%d%d",&a,&b);
ans[a]+=b;
}
for(i=1;i<100001;i++){
tmp+=ans[i];
if(tmp>=k){
printf("%d\n",i);
return 0;
}
}
}
| main.c: In function 'main':
main.c:7:27: error: redefinition of 'tmp'
7 | long long tmp=0,ans[100001]={0};
| ^~~
main.c:4:29: note: previous definition of 'tmp' with type 'long long int'
4 | long long k,tmp=0,ans[100001]={0};
| ... |
s516923466 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) FOR(i, n, 0)
#define MFOR(i, m) for(auto i=(m).begin();i!=(m).end();i++)... | a.cc:24:20: warning: use of 'auto' in template argument only available with '-fconcepts-ts'
24 | void printv(vector<auto> const& s) {
| ^~~~
a.cc:30:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
30 | void print(auto const s) {
|... |
s324355243 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(void){
int n, k, so[100010];
for(int i=;i<100010;++i) so[i] = 0;
cin >> n >> k;
for(int i=0;i<n;++i){
int a, b;
cin >> a >> b;
so[a] = b;
}
int sum = 0;
for(int i=0;i<n;++i){
sum += so[i];
if(sum >= k){
cout << i << endl;
... | a.cc: In function 'int main()':
a.cc:6:13: error: expected primary-expression before ';' token
6 | for(int i=;i<100010;++i) so[i] = 0;
| ^
a.cc:18:15: error: expected ';' before '}' token
18 | return 0
| ^
| ;
19 | }
| ~ ... |
s503927175 | p03721 | C++ | #include <iostream>
#include <vector>
#include <array>
#include <utility>
using namespace std;
int main(){
// 3 4
// 1 1
// 2 2
// 3 3
int N,K;
cin >> N >> K;
std::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());
fo... | a.cc: In function 'int main()':
a.cc:29:9: error: 'sort' was not declared in this scope; did you mean 'short'?
29 | sort(v.begin(), v.end());
| ^~~~
| short
|
s792313980 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long long mon[100005];
int main(){
int a;
long long b;
cin >> a >> b;
for (int i = 0; i < a; ++i) {
int aa, bb;
cin >> aa >> bb;
mon[aa] += bb;
}
for (int i = 1; i <= 100005; ++i){
if (b <= mon[ans]) {
cou... | a.cc: In function 'int main()':
a.cc:14:22: error: 'ans' was not declared in this scope; did you mean 'abs'?
14 | if (b <= mon[ans]) {
| ^~~
| abs
|
s857640333 | p03721 | C++ | /// Containers Start
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
... | a.cc: In function 'int main()':
a.cc:233:13: error: 'a' was not declared in this scope
233 | cout << a << nn;
| ^
|
s577616466 | p03721 | Java | import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
public class Main {
public static void main(String[] args) throws IOE... | Main.java:29: error: incompatible types: Entry<Long,Long> cannot be converted to Entry<Integer,Long>
for (Map.Entry<Integer, Long> e : map.entrySet()) {
^
1 error
|
s719099959 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long int n,k,sum=0,che,s=0;cin>>n>>k;
long long int a[n],b[n];
vector<long long int> v(n),w={};
for(long long int i=0;i<n;i++) cin>>a[i]>>b[i];
for(long long int i=0;i<n;i++) v.at(i)=a[i];
sort(v.begin(),v.end());
w.push_back(v.at(0));
che=v.... | a.cc:32:1: error: expected declaration before '}' token
32 | }
| ^
|
s171639354 | p03721 | Java | import java.util.*;
public class Main {
public static void main(Stirng args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
ArrayList<Integer> box = new ArrayList<>();
for (int i = 0; i < n; i++) {
int a = sc.nextInt();
int b = sc.nextIn... | Main.java:4: error: cannot find symbol
public static void main(Stirng args[]) {
^
symbol: class Stirng
location: class Main
1 error
|
s171203491 | p03721 | C++ | //17:14
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
ll max(ll a, ll b){return(a>b)?a:b;}
ll min(ll a, ll b){return(a<b)?a:b;}
ll abs(ll a){return(a<0)?-a:a;}
ll gcd(ll a, ll b){
if(b > a){
ll tmp = b;
b =... | a.cc:35:1: error: reference to 'tuple' is ambiguous
35 | tuple arr[100000];
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from a.cc:4:
/usr/include/c++/14/bits/stl_pair.h:92:11: note: candidates are: 'template<... |
s081215731 | p03721 | C++ | //17:14
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <map>
using namespace std;
typedef long long ll;
ll max(ll a, ll b){return(a>b)?a:b;}
ll min(ll a, ll b){return(a<b)?a:b;}
ll abs(ll a){return(a<0)?-a:a;}
ll gcd(ll a, ll b){
if(b > a){
ll tmp = b;
b =... | a.cc:35:1: error: reference to 'tuple' is ambiguous
35 | tuple arr[100000];
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from a.cc:4:
/usr/include/c++/14/bits/stl_pair.h:92:11: note: candidates are: 'template<... |
s103231190 | p03721 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
using namespace std;
int main() {
using ll = long long;
const int AMAX = 100000;
ll cnt[AMAX + 1];
int n, i, a, b, ans;
ll k;
cin >> n >> k;
for (i = 0; i < n; i++) {
cin >> a >> B;
cnt[a] += b;
}
for (ans = 1; ans <... | a.cc: In function 'int main()':
a.cc:19:29: error: 'B' was not declared in this scope
19 | cin >> a >> B;
| ^
|
s770817761 | p03721 | C++ | /*
|\_/|
|* *|
\_+_/
*/
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
int main(){
cin.tie(0); // cout と cin の同期を切る
ios::sync_with_stdio(false); /* cの stdioストリーム (printfとか)と*/
long logn N,K;
cin>>N>>K;
long long ans[100001]={ };
int a,b;
for(int i=0;i<... | a.cc: In function 'int main()':
a.cc:18:13: error: expected initializer before 'N'
18 | long logn N,K;
| ^
a.cc:20:8: error: 'N' was not declared in this scope
20 | cin>>N>>K;
| ^
a.cc:20:11: error: 'K' was not declared in this scope
20 | cin>>N>>K;
| ^
|
s018374727 | p03721 | C++ | #include<bits/stdc++.h>
#define MAX 100005
using namespace std;
int main(){
int n, a, b;
long long k;
map<int, long long> m;
scanf("%d%lld", &n, &k);
for(int i = 0; i < n; i++){
scanf("%d%d", &a, &b);
if(m.find(a) == m.end()) m[a] = b;
else m[a] += b;
}
map<int, int>::iterator it;
for(it =... | a.cc: In function 'int main()':
a.cc:16:20: error: no match for 'operator=' (operand types are 'std::map<int, int>::iterator' {aka 'std::_Rb_tree<int, std::pair<const int, int>, std::_Select1st<std::pair<const int, int> >, std::less<int>, std::allocator<std::pair<const int, int> > >::iterator'} and 'std::map<int, long ... |
s042640216 | p03721 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll n,k;cin>>n>>k;
map<ll,... | a.cc: In function 'int main()':
a.cc:23:32: error: expected ';' before '!=' token
23 | for(auto itr=mp.begin(),itr!=mp.end();itr++){
| ^~
| ;
a.cc:23:32: error: expected primary-expression before '!=' token
23 | for(auto itr=mp.begi... |
s534999922 | p03721 | C | #include<cstdio>
#include<utility>
#include<algorithm>
using namespace std;
int main(){
int j=0;
long n,k;
pair<long,long> a[100000];
scanf("%ld %ld",&n,&k);
for(int i=0;i<n;i++)
scanf("%ld %ld",&a[i].first,&a[i].second);
sort(a,a+n);
while(k>0){
k-=a[j].second;
j++;
}
printf("%ld\n",a[j-1... | main.c:1:9: fatal error: cstdio: No such file or directory
1 | #include<cstdio>
| ^~~~~~~~
compilation terminated.
|
s403348084 | p03721 | C++ |
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#def... | a.cc:41:17: error: 'P' does not name a type
41 | bool comp(const P& p1, const P&p2) {
| ^
a.cc:41:30: error: 'P' does not name a type
41 | bool comp(const P& p1, const P&p2) {
| ^
a.cc: In function 'bool comp(const int&, const int&)':
a.cc:42:19: error: req... |
s511110340 | p03721 | C++ |
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#def... | cc1plus: error: '::main' must return 'int'
|
s301494086 | p03721 | C++ |
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#def... | cc1plus: error: '::main' must return 'int'
|
s237441668 | p03721 | C++ | #include <iostream>
#include <cstdint>
#include <algorithm>
#include <utility>
#include <cstdlib>
int main() {
std::int_fast64_t n, k;
std::cin >> n >> k;
std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
for (std::pair<std::int_fast64_t, std::int_fast64_t>& query : queries) {
std::c... | a.cc: In function 'int main()':
a.cc:10:8: error: 'vector' is not a member of 'std'
10 | std::vector<std::pair<std::int_fast64_t, std::int_fast64_t>> queries(n);
| ^~~~~~
a.cc:6:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
5 | #incl... |
s944964204 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> V;
int main() {
ll n, k;
cin >> n >> k;
vector<pair<ll, ll>> ab(n);
for (int i = 0; i < n; i++) cin >> ab[i].first >> ab[i].second;
sort(ab.begin(), ab.end())... | a.cc: In function 'int main()':
a.cc:14:51: error: 'b' was not declared in this scope
14 | for (int i = 0; i < n-1; i++) ab[i+1].second += b[i].second;
| ^
a.cc:16:8: error: 'a' was not declared in this scope
16 | dump(a[x]);
| ^
a.cc:3:26: ... |
s920294571 | p03721 | C++ | line = gets
data = line.split(" ")
n = data[0].to_i
k = data[1].to_i
ai = Array.new
bi = Hash.new
n.times do |i|
line = gets
data = line.split(" ")
a = data[0].to_i
ai << a if !ai.include?(a)
if bi[a] == nil
bi[a] = data[1].to_i
else
bi[a] += data[1].to_i
end
end
ai.sort!
ai.each do |a|
k -= bi[... | a.cc:1:1: error: 'line' does not name a type
1 | line = gets
| ^~~~
|
s661536905 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload3(_1,_2,_3,n... | a.cc:38:8: error: 'AMAX' was not declared in this scope
38 | ll cnt[AMAX + 1];
| ^~~~
a.cc: In function 'int main()':
a.cc:48:1: error: 'cnt' was not declared in this scope; did you mean 'int'?
48 | cnt[A] += B;
| ^~~
| int
a.cc:51:26: error: 'AMAX' was not declared in this scope
51 | ... |
s793219190 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)
#define _overload3(_1,_2,_3,n... | a.cc: In function 'int main()':
a.cc:52:28: error: 'endll' was not declared in this scope
52 | cout<<s.first<<endll
| ^~~~~
|
s019315799 | p03721 | C++ | 10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 500000
| ^~
|
s361626103 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<l... | a.cc: In lambda function:
a.cc:39:54: error: 'P' {aka 'struct std::pair<long long int, long long int>'} has no member named 'frist'; did you mean 'first'?
39 | sort(ab.begin(),ab.end(),[&](P& l,P& r){return l.frist<r.first;});
| ^~~~~
| ... |
s047309227 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
int N
long long K;
cin >> N >> K;
int a[N], b[N];
long long c[100010]={};
for(int i = 0; i < N; i++){
cin >> a[i] >> b[i];
c[a[i]] += b[i];
}
int ans = 0;
for(int i = 1; i <100010; i++){
K -= c[i];
... | a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'long'
6 | long long K;
| ^~~~
a.cc:7:12: error: 'N' was not declared in this scope
7 | cin >> N >> K;
| ^
a.cc:7:17: error: 'K' was not declared in this scope
7 | cin >> N >> K;
| ... |
s351366049 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,m,a,b;
main(){
cin>>n>>m;
for(int i=0;i<n;i++){
long long p,p,q;
cin>>p>>q;
b+=q;
if(m<=b)break;
a=p;
}
cout<<a<<endl;
} | a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:9:17: error: redeclaration of 'long long int p'
9 | long long p,p,q;
| ^
a.cc:9:15: note: 'long long int p' previously declared here
9... |
s801265459 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
long long n,m,a,b;
main{
cin>>n>>m;
for(int i=0;i<n;i++){
long long q;
cin>>a>>q;
b+=q;
if(m<=b)break;
}
cout<<a<<endl;
} | a.cc:6:1: error: 'main' does not name a type
6 | main{
| ^~~~
|
s602688378 | p03721 | Java | import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;
import java.util.Map.Entry;
import atcoder.Main;
public class Main {
public static void main(String[] args) {
Main main = new Main();
main.run();
}
void run() {
Scanner sc = new Scanner(System.in);
Map<Integ... | Main.java:7: error: package atcoder does not exist
import atcoder.Main;
^
1 error
|
s544466234 | p03721 | C++ | #include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)
#else
#define DUMP(i)
#endif
using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i... | a.cc: In function 'int main()':
a.cc:48:20: error: 'sum' was not declared in this scope
48 | if(sum >= k){
| ^~~
|
s686427385 | p03721 | C++ | #include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i)
#else
#define DUMP(i)
#endif
using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i... | a.cc: In function 'int main()':
a.cc:39:15: error: 'i' was not declared in this scope
39 | vll V[i];
| ^
a.cc:43:17: error: 'V' was not declared in this scope
43 | V[a] += b;
| ^
a.cc:47:24: error: 'V' was not declared in this scope
47 | ... |
s984098207 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ll n,k; cin >> n >> k;
map<int,ll> m;
for(int i=0; i<n; i++) {
ll a,b; cin >> a >> b;
m[a]+=b;
}
ll sum = 0;
for(auto x:m){
sum += m.second;
if( sum >= k ) {
cout << x.first << endl;
brea... | a.cc: In function 'int main()':
a.cc:18:19: error: 'class std::map<int, long long int>' has no member named 'second'
18 | sum += m.second;
| ^~~~~~
|
s828981227 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef lon glong ll;
int main() {
ll n,k; cin >> n >> k;
map<int,ll> m;
for(int i=0; i<n; i++) {
ll a,b; cin >> a >> b;
m[a]+=b;
}
ll sum = 0;
for(auto x:m){
sum += m.second;
if( sum >= k ) {
cout << x.first << endl;
brea... | a.cc:3:9: error: 'lon' does not name a type; did you mean 'long'?
3 | typedef lon glong ll;
| ^~~
| long
a.cc: In function 'int main()':
a.cc:8:3: error: 'll' was not declared in this scope
8 | ll n,k; cin >> n >> k;
| ^~
a.cc:8:18: error: 'n' was not declared in this scope... |
s351054832 | p03721 | C | #include<stdio.h>
int main(void){
long n,k,i,ho=0;
scanf("%ld %ld",&n,&k);
long a,b;
long x[100000]={0};
for(i=0;i<n;i++){
scanf("%ld %ld",&a,&b);
x[a-1]+=b;
}
for(i=0;i<100000;i++){
ho+=x[i];
if(ho>=k){
ch=1;
break;
}
}
printf("%ld",i+1);
return 0;
}
| main.c: In function 'main':
main.c:14:7: error: 'ch' undeclared (first use in this function)
14 | ch=1;
| ^~
main.c:14:7: note: each undeclared identifier is reported only once for each function it appears in
|
s819178809 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int main(){
int n,k,i;
long long x;
cin >> n >> k;
vector <pair<int, int> > a(n);
for(i=0;i<n;i++){
cin >> x >> y;
a[i] = make_pair(x,y);
}
sort(a.begin(),a.end());
x = 0;
fo... | a.cc: In function 'int main()':
a.cc:13:21: error: 'y' was not declared in this scope
13 | cin >> x >> y;
| ^
|
s695597901 | p03721 | C++ | tmp = list(map(int,input().split()))
n, k = tmp[0],tmp[1]
an = []
for i in range(n):
tmp = list(map(int,input().split()))
an += [tmp[0]] * tmp[1]
an.sort()
print(an[k-1]) | a.cc:1:1: error: 'tmp' does not name a type
1 | tmp = list(map(int,input().split()))
| ^~~
|
s628944390 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repr(i,k,n) for(int i = (k); i < (n); i++)
#define rep(i,n) repr(i,0,n)
#define ALL(a) begin(a),end(a)
const int INF = 114514810;
const int MOD = 1000000007;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
int main() {
cin.tie(0);
ios::syn... | a.cc: In function 'int main()':
a.cc:20:21: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'vi' {aka 'std::vector<int>'})
20 | cin >> a >> b;
| ~~~ ^~ ~
| | |
| | vi {a... |
s971986417 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define repr(i,k,n) for(int i = (k); i < (n); i++)
#define rep(i,n) repr(i,0,n)
#define ALL(a) begin(a),end(a)
const int INF = 114514810;
const int MOD = 1000000007;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
int main() {
cin.tie(0);
ios::syn... | a.cc: In function 'int main()':
a.cc:16:12: error: conflicting declaration 'vi b'
16 | vi b;
| ^
a.cc:14:19: note: previous declaration as 'int b'
14 | int N,K,a,b;
| ^
a.cc:17:12: error: conflicting declaration 'vi a'
17 | vi a;
| ... |
s075583461 | p03721 | C++ | nclude <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
using namespace std;
int main() {
int N;
long long K,total;
cin >> N >> K;
map<int, long long> mp;
total = 0;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
mp[a] += b;
}
for (auto&& var : mp) {
total +... | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <iostream>
| ^~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
from /usr/include/c++/14/vector:62,
from a.cc:2:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cx... |
s419618904 | p03721 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
using namespace std;
int main() {
int N, K,total;
cin >> N >> K;
map<int, int> mp;
total = 0;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
... | a.cc: In function 'int main()':
a.cc:22:17: error: 'toral' was not declared in this scope; did you mean 'total'?
22 | toral += var.second;
| ^~~~~
| total
|
s694104331 | p03721 | C++ | #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<stack>
#include<map>
#include<string>
#include<algorithm>
#include<cstdio>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)
#define mp make_pair
#define pb push_back
#define P pair<int,int>
#define ll __int64
//#defi... | a.cc:16:12: error: '__int64' does not name a type; did you mean '__int64_t'?
16 | #define ll __int64
| ^~~~~~~
a.cc:18:7: note: in expansion of macro 'll'
18 | const ll M=1000000007;
| ^~
|
s216843090 | p03721 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.TreeMap;
public class Main {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
public static void main(String... args) throws IOException {
Strin... | Main.java:12: error: non-static variable br cannot be referenced from a static context
String[] params = br.readLine().split(" ");
^
Main.java:18: error: non-static variable br cannot be referenced from a static context
String[] data = br.readLine().split(" ");
... |
s603990940 | p03721 | C++ | // ------------------------------------
// Date:2018/ 3/ 8
// Problem:ABC 061 BigArray c.cpp
//
// ------------------------------------
#include <bits/stdc++.h>
using namespace std;
#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a... | a.cc: In function 'int main()':
a.cc:32:20: error: reference to 'data' is ambiguous
32 | REP(i, MAX_DATA) data[i] = make_pair(INF, INF);X
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bitset:52,
from /usr/include/x86_... |
s512154096 | p03721 | C++ | #include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n) int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout <<... | a.cc:27:2: error: 'Sun' does not name a type
27 | Sun[2000000];
| ^~~
a.cc: In function 'int main()':
a.cc:33:9: error: 'Sun' was not declared in this scope
33 | Sun[A]+=B;
| ^~~
a.cc:38:15: error: 'Sun' was not declared in this scope
38 | while(Sun[s]==0){
| ... |
s440527627 | p03721 | C++ | #include "bits/stdc++.h"
using namespace std;
int main()
{
int n
long long m;
scanf("%d %lld", &n, &m);
map<int, long long> a;
for(int i = 0, j, k; i < n; ++i)
{
scanf("%d %lld", &j, &k);
if(a.find(j) == a.end())
{
a.insert(make_pair(j, k));
}
else
{
a[j] += k;
}
}
for(auto i : a)
{
m -= ... | a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'long'
6 | long long m;
| ^~~~
a.cc:7:27: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | scanf("%d %lld", &n, &m);
| ^
| y... |
s514653021 | p03721 | C++ | #include <iostream>
#include <map>
int N, K;
using ll = long long;
int main() {
cin >> N >> K;
map<ll, ll> M;
for(int i = 0; i < N; ++i){
ll a,b;
cin >> a >> b;
M[a] += b;
}
ll sum = 0;
ll ans = 0;
auto it = M.begin();
while(sum < K) {
sum += it->second;
ans = it->first;
++it... | a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | 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; ///< Linked t... |
s313740070 | p03721 | C++ | #include <iostream>
#include <map>
int N, K;
int main() {
cin >> N >> K;
map<int, int> M;
for(int i = 0; i < N; ++i){
int a,b;
cin >> a >> b;
M[a] += b;
}
int sum = 0;
int ans = 0;
auto it = M.begin();
while(sum < K) {
sum += it->second;
ans = it->first;
++it;
}
cout << i... | a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | 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; ///< Linked t... |
s347633888 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct box
{
int a;
int b;
};
int main()
{
int n
long long k;
cin >> n >> k;
vector<box> x(n);
for(int i = 0; i < n; i++)
{
cin >> x[i].a >> x[i].b;
}
//sort(x.begin(), x.end(), [](const box& n, const box& m) {return n.a ... | a.cc: In function 'int main()':
a.cc:16:9: error: expected initializer before 'long'
16 | long long k;
| ^~~~
a.cc:17:16: error: 'n' was not declared in this scope
17 | cin >> n >> k;
| ^
a.cc:17:21: error: 'k' was not declared in this scope
17 | cin >... |
s324441129 | p03721 | C++ | #include<cstdio>
#include<vector>
#define rep(n) for(int i=0;i<n;i++)
#define Pii std::pair<int, int>
#define all(v) v.begin(), v.end()
int main(){
int length = 0, n, k;
scanf("%d %d", &n, &k);
std::vector<Pii> v(n);
rep(n) scanf("%d %d", &v[i].first, &v[i].second);
sort(all(v));
for(Pii p: v)... | a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
13 | sort(all(v));
| ^~~~
| short
|
s741431748 | p03721 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_que... | a.cc: In function 'int main()':
a.cc:36:8: error: invalid cast from type 'std::pair<int, int>' to type 'long long int'
36 | K-=(long long)S[i];
| ^~~~~~~~~~~~~~~
|
s120794572 | p03721 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_que... | a.cc: In function 'int main()':
a.cc:35:6: error: no match for 'operator-=' (operand types are 'long long int' and 'std::pair<long long int, long long int>')
35 | K-=S[i];
| ~^~~~~~
|
s632466535 | p03721 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_que... | a.cc: In function 'int main()':
a.cc:35:6: error: no match for 'operator-=' (operand types are 'long long int' and 'std::pair<int, int>')
35 | K-=S[i];
| ~^~~~~~
|
s536473641 | p03721 | Java | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int k = in.nextInt();
Map<Integer,Integer> vals = new TreeMap<>();
Set<Integer> valSet = new HashSet<>();
for... | Main.java:19: error: cannot find symbol
vals.add(a);
^
symbol: method add(int)
location: variable vals of type Map<Integer,Integer>
1 error
|
s481683531 | p03721 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int tests = sc.nextInt();
long indexVal = sc.nextLong();
int[] aVals = new int[tests];
int[] bVals = new int[tests];
int bSum = 0;
for (int i =... | Main.java:32: error: incompatible types: possible lossy conversion from long to int
System.out.println(finalResult[indexVal - 1]);
^
1 error
|
s362868118 | p03721 | C++ | #include<iostream>
using namespace std;
int main(){
int N;
__int64 E[100000];
__int64 K;
int i=0;
int a,b;
int c=0;
int ans;
for(i=0;i<100000;i++){
E[i]=0;
}
cin>>N>>K;
for(i=0;i<N;i++){
cin>>a>>b;
E[a-1]=E[a-1]+b;
}
for(i=0;i<N;i++){
c=c+E[i];
if(c>=K){
ans=i+1;
break;
}
}
cout<<an... | a.cc: In function 'int main()':
a.cc:5:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
5 | __int64 E[100000];
| ^~~~~~~
| __int64_t
a.cc:6:16: error: expected ';' before 'K'
6 | __int64 K;
| ^~
| ... |
s524695999 | p03721 | C++ | 10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 500000
| ^~
|
s695273152 | p03721 | C++ | #include <iostream>
#define b_MAX 100000;
using namespace std;
int ary[b_MAX+1];
int main(void){
int N; long long K;
cin >> N >> K;
int a, b;
for(int i=0; i<N; i++){
cin >> a >> b;
ary[a] += b;
}
long long ans = 0;
for(int i=1; ans<K && i<=b_MAX; i++){
ans += ary... | a.cc:2:21: error: expected ']' before ';' token
2 | #define b_MAX 100000;
| ^
a.cc:5:9: note: in expansion of macro 'b_MAX'
5 | int ary[b_MAX+1];
| ^~~~~
a.cc:5:14: error: expected unqualified-id before '+' token
5 | int ary[b_MAX+1];
| ^
a.cc: In f... |
s312464512 | p03721 | C++ | #include <iostream>
using namespace std;
int ary[1e5+1];
int main(void){
int N; long long K;
cin >> N >> K;
int a, b;
for(int i=0; i<N; i++){
cin >> a >> b;
ary[a] += b;
}
long long ans = 0;
for(int i=1; ans<K && i<=1e5; i++){
ans += ary[i];
}
cout << an... | a.cc:4:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
4 | int ary[1e5+1];
| ~~~^~
a.cc:4:12: error: could not convert '(1.0e+5 + (double)1)' from 'double' to 'long unsigned int'
4 | int ary[1e5+1];
| ~~~^~
| |
| ... |
s138828397 | p03721 | C++ | import std.stdio; // readln
import std.array; // split
import std.conv; // to
import std.typecons;
import std.range;
import std.algorithm;
void main(){
string[] s = split(readln());
int n = to!int(s[0]);
int k = to!int(s[1]);
alias Tuple!(int,int) pair;
pair[] p = new pair[](n);
for(int i = 0; i < n; i++){
s ... | a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio; // readln
| ^~~~~~
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 std.array; // split
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodul... |
s061191572 | p03721 | C++ | #include <iostream>
using namespace std;
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
int N,
long long K;
cin >> N >> K;
long long nums[100001] = {0};
for (int i = 0; i < N; ++i)
{
int a, b;
cin >> a >> b;
nums[a] += b;
}
long long res = 0;
... | a.cc: In function 'int main()':
a.cc:11:5: error: expected unqualified-id before 'long'
11 | long long K;
| ^~~~
a.cc:12:17: error: 'K' was not declared in this scope
12 | cin >> N >> K;
| ^
|
s474441467 | p03721 | C++ | #include<bits/stdc++.h>
#define loop(i, a, b) for(int i = a; i < b; i++)
#define rep(i, a) loop(i, 0, a)
using namespace std;
const int MOD = 1000000007;
const int inf = 1e8;
using vi = vector <int>;
using vvi = vector <vi>;
using vc = vector <char>;
using vvc = vector <vc>;
using vs = vector <string>;
using vvs = vec... | a.cc: In function 'int main()':
a.cc:20:17: error: no match for 'operator=' (operand types are 'std::vector<long long int>' and 'vi' {aka 'std::vector<int>'})
20 | a = b = vi(n);
| ^
In file included from /usr/include/c++/14/vector:72,
from /usr/include/c++/14/functional:64... |
s042394158 | p03721 | C++ | #include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(... | a.cc: In function 'int main()':
a.cc:22:5: error: 'lln' was not declared in this scope; did you mean 'll'?
22 | lln, k;
| ^~~
| ll
a.cc:22:10: error: 'k' was not declared in this scope
22 | lln, k;
| ^
a.cc:25:12: error: 'n' was not declared in this scope; did you mean '... |
s246170703 | p03721 | C++ | #include<iostream>
using namespace std;
__int64 x[100005]={0};
int main(){
int n,k;
cin>>n>>k;
int i=0;
int a,b;
for(i=0;i<n;i++){
cin>>a>>b;
x[a]+=b;
}
i=1;
while(1){
k-=x[i];
if(k<=0){
cout<<i<<endl;
break;
}
i++;
}
return 0;
}
| a.cc:3:1: error: '__int64' does not name a type; did you mean '__int64_t'?
3 | __int64 x[100005]={0};
| ^~~~~~~
| __int64_t
a.cc: In function 'int main()':
a.cc:11:17: error: 'x' was not declared in this scope
11 | x[a]+=b;
| ^
a.cc:15:20: error: 'x' was not decl... |
s250652626 | p03721 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
unsigned long long int flag[1000000] = {};
int N,K;
int a,b;
unsigned long long int sum = 0;
cin >> N >> K;... | a.cc: In function 'int main()':
a.cc:30:9: error: 'i' was not declared in this scope
30 | if (i == 100002) {
| ^
|
s096607152 | p03721 | C++ | #include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
unsigned long long int flag[1000000] = {};
int N,K;
int a,b;
unsigned long long int sum = 0;
cin >> N >> K;... | a.cc: In function 'int main()':
a.cc:30:9: error: 'i' was not declared in this scope
30 | if (i == 100002) {
| ^
|
s359298379 | p03721 | C++ | 10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 500000
| ^~
|
s893187448 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long list[100001];
int main(){
int n,k,ans=0,m=0;
long a,b;
scanf("%d %d",&n,&k);
int i;
for(i=0;i<n;i++){
scanf("%ld %ld",&a,&b);
list[a] += b;
}
for(i=0;i<100001;i++){
m = m + list[a];
if(m>=k){
ans = i;
break;
}
}
printf("%d\n",ans);
}
| a.cc: In function 'int main()':
a.cc:13:17: error: reference to 'list' is ambiguous
13 | list[a] += b;
| ^~~~
In file included from /usr/include/c++/14/list:65,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
from a.cc:1:
/usr/inclu... |
s569242360 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long list[100001];
int main(){
int n,k,ans=0;
long a,b;
scanf("%d %d",&n,&k);
int i;
for(i=0;i<n;i++){
scanf("%ld %ld",&a,&b);
list[a] += b;
}
for(i=0;i<100001;i++){
m = m + list[a];
if(m>=k){
ans = i;
break;
}
}
printf("%d\n",ans);
}
| a.cc: In function 'int main()':
a.cc:13:17: error: reference to 'list' is ambiguous
13 | list[a] += b;
| ^~~~
In file included from /usr/include/c++/14/list:65,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
from a.cc:1:
/usr/inclu... |
s796223517 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long list[100001];
int main(){
int n,k,ans=0;
long a,b;
scanf("%d %d",&n,&k);
int i;
for(i=0;i<n;i++){
scanf("%ld %ld,&a,&b);
list[a] += b;
}
for(i=0;i<100001;i++){
m = m + list[a];
if(m>=k){
ans = i;
break;
}
}
printf("%d\n",ans);
}
| a.cc:12:23: warning: missing terminating " character
12 | scanf("%ld %ld,&a,&b);
| ^
a.cc:12:23: error: missing terminating " character
12 | scanf("%ld %ld,&a,&b);
| ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:17:... |
s970604877 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int n;
long long k;
int a, b;
int i;
long long array[100010] = {};
cin >> n >> k;
for(i = 0; i < n; i++){
cin >> a >> b;
array[a] += b;
}
i = 1;
while(1){
k -= array[i];
if(k <= 0){
... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
... |
s592507608 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int n;
long long k;
int a, b;
int i;
long long array[100010] = {};
cin >> n >> k;
for(i = 0; i < n; i++){
cin >> a >> b;
array[a] += b;
}
i = 1;
while(1){
k -= array[i];
if(k <= 0){
... | a.cc:3:1: error: extended character is not valid in an identifier
3 |
| ^
a.cc:11:1: error: extended character is not valid in an identifier
11 |
| ^
a.cc:13:1: error: extended character is not valid in an identifier
13 |
| ^
a.cc:3:1: error: '\U000000a0' does not name a type
... |
s876683513 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int n;
long long k;
int a, b;
int i;
long long temp = 0;
int array[100010] = {};
cin >> n >> k;
for(i = 0; i < n; i++){
cin >> a >> b;
array[a] += b;
}
i = 0;
while(1){
k -= array[i];
... | a.cc: In function 'int main()':
a.cc:22:16: error: expected primary-expression before '=' token
22 | if(k < = 0){
| ^
|
s978275406 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void)
{
int n;
long long k;
int a, b;
int i;
long long temp = 0;
int array[100010] = {};
cin >> n >> k;
for(i = 0; i < n; i++){
cin >> a >> b;
array[a] += b;
}
i = 0;
while(1){
k -= array[i];
... | a.cc: In function 'int main()':
a.cc:22:16: error: expected primary-expression before '=' token
22 | if(k < = 0){
| ^
|
s991910493 | p03721 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
int main(void) {
int N,K;
cin >> N >> K;
vector< pair<int,int> > data(N);
for (int i = 0; i < N; ++i) {
cin >> data[i].first >> data[i].second;
}
sort(data.begin(),data.end());
bool find = false;
int count = 0;
... | a.cc: In function 'int main()':
a.cc:23:38: error: 'ind' was not declared in this scope; did you mean 'find'?
23 | cout << data[ind].first << endl;
| ^~~
| find
|
s875052300 | p03721 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
int n, k, a, b;
set<int> num;
map<int, long long> mp;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n >> k;
for (int i = 0; i < n; ++i) {
cin >> a >> b;
num.insert(a);
mp[a... | a.cc: In function 'int main()':
a.cc:24:52: error: 'i' was not declared in this scope; did you mean 'it'?
24 | for (auto it = num.begin(); it != num.end(); ++i) {
| ^
| it
|
s814864901 | p03721 | C++ | #include <iostream>
#include <vector>
#include <map>
#include <set>
using namespace std;
int n, k, a, b;
set<int> num;
map<int, long long> mp;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
cin >> n >> k;
for (int i = 0; i < n; ++i) {
cin >> a >> b;
num.insert(a);
mp[a... | a.cc: In function 'int main()':
a.cc:24:52: error: 'i' was not declared in this scope; did you mean 'it'?
24 | for (auto it = num.begin(); it != num.end(); ++i) {
| ^
| it
|
s027803012 | p03721 | C | #include<stdio.h>
int main(){
int N,K,i,j;
int a[100001];
int b[100001];
scanf("%d %d",&N,&K);
j=K;
for(i=0;i<N;i++){
scanf("%d %d",&a[i],&b[i]);
}
for(i=0;i<N;i++){
if(j>0){
j=j-b[i];
if(j<=0){
printf("%d\n",a[i]);
return 0;
}
}
} | main.c: In function 'main':
main.c:19:1: error: expected declaration or statement at end of input
19 | }
| ^
|
s045280301 | p03721 | C++ | #include <iostream>
using namespace std;
long long ANUM[100001];
int main(){
int N;
long long K;
cin >>N >>K;
for(int i=0; i < N; i++){
int a,b;
cin >>a >>b;
ANUM[a]+=b;
}
for(int i=1;i<=100000;i++){
if(K<=ANUM[i]){
cout<<i<<endl;
brea... | a.cc: In function 'int main()':
a.cc:21:14: error: expected '}' at end of input
21 | return 0;
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s188306463 | p03721 | C | #include <stdio.h>
int main(void){
long long int i,n,a,b,k;
long long int num[100001]={0};
scanf( "%lld %lld",&n,&k );
for( i = 0; i < n; i++ ){
scanf( "%lld %lld",&a,&b);
num[a] = num[a] + b;
}
for( i = 1; i < 100001; i++ ){
k = k - num[i]
... | main.c: In function 'main':
main.c:17:23: error: expected ';' before 'if'
17 | k = k - num[i]
| ^
| ;
18 | if( k <= 0 ){
| ~~
|
s913839313 | p03721 | C++ | #include <algorithm>
#include <vector>
#include <map>
using namespace std;
int main(){
int n,k,a,b,i;
vector <pair<int,int> > pairs(100000);
cin>>n>>k;
for(i=0;i<n;i++){
cin>>a>>b;
pairs[i]=make_pair(b,a);
}
sort(pairs.begin(),pairs.end());
/* for(i=0;i<n-1;i++) for(j=0;j<n-1;j++) if(a[j]>a[j... | a.cc: In function 'int main()':
a.cc:10:3: error: 'cin' was not declared in this scope
10 | cin>>n>>k;
| ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
3 | #include <map>
+++ |+#include <iostream>
4 | using namespace std;... |
s536218229 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define se second
#define fi first
typedef long long ll;
int main() {
ll n,k;
cin >> n >> k;
ll ska,b;
for(int i = 0;i<n;i++){
cin >> ska >> b;
sk.push_back(make_pair(ska,b));
}
sort(sk.begin(),sk.end());
ll sum = 0;
for(int i = 0;i<n;i++){
sum += sk[i].s... | a.cc: In function 'int main()':
a.cc:16:17: error: 'sk' was not declared in this scope; did you mean 'ska'?
16 | sk.push_back(make_pair(ska,b));
| ^~
| ska
a.cc:18:14: error: 'sk' was not declared in this scope; did you mean 'ska'?
18 | sort(sk.b... |
s126605294 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define se second
#define fi first
typedef long long ll;
int main() {
ll n,k;
cin >> n >> k;
ll ska,b;
for(int i = 0;i<n;i++){
cin >> ska >> b;
sk.push_back(make_pair(ska,b));
}
sort(sk.begin(),sk.end());
ll sum = 0;
for(int i = 0;i<n;i++){
sum += sk[i].s... | a.cc: In function 'int main()':
a.cc:16:17: error: 'sk' was not declared in this scope; did you mean 'ska'?
16 | sk.push_back(make_pair(ska,b));
| ^~
| ska
a.cc:18:14: error: 'sk' was not declared in this scope; did you mean 'ska'?
18 | sort(sk.b... |
s633198370 | p03721 | C | #include <stdio.h>
int main()
{
int N,i,a,b,K,c[100001]={};
scanf("%d%d",&N,&K);
for(i=0;i<N;i++){
scanf("%d%d",&a,&b);
c[a]+=b;
}
for(i=1;i<100001;i++){
K-=c[i]
if(K<=0){
printf("%d\n",i);
break;
}
}
return 0;
} | main.c: In function 'main':
main.c:11:16: error: expected ';' before 'if'
11 | K-=c[i]
| ^
| ;
12 | if(K<=0){
| ~~
|
s299203275 | p03721 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
typedef pair<int, int> P;
int main() {
int N, K;
cin >> N >> K;
vector<P> p;
int a, b;
for (int i = 0; i < N; i++) {
cin >> a >> b;
p.push_back(P(a, b));
}
sort(p.begin(), p.end());
for (int i = 0; i < p.size(); i++) {
if (K < ... | a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
10 | vector<P> p;
| ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
2 | #include <algorithm>
+++ |+#include <vector>
3 | using nam... |
s245089554 | p03721 | Java |
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
private static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int N = 0;
int K = 0;
List<MyClass> list = null;
try {
N = Integer.parseInt... | Main.java:24: error: variable list is already defined in method main(String[])
List<MyClass> list = new ArrayList<MyClass>();
^
1 error
|
s980424543 | p03721 | Java |
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
private static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
try {
int N = Integer.parseInt(scan.next());
int K = Integer.parseInt(scan... | Main.java:23: error: cannot find symbol
for (int i = 0; i < N; i++) {
^
symbol: variable N
location: class Main
Main.java:28: error: cannot find symbol
list.add(new MyClass(a, b));
^
symbol: variable list
location: class Main
Main.java:36: error: cannot find symbol
Collections... |
s938173493 | p03721 | Java |
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class Main {
private static Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int N = Integer.parseInt(scan.next());
int K = Integer.parseInt(scan.next());
Lis... | Main.java:52: error: cannot find symbol
System.out.println(ans);
^
symbol: variable ans
location: class Main
1 error
|
s098004616 | p03721 | Java | import java.io.IOException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws IOException {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextlong();
int k = scanner.nextlong();
int count = 0;
for(int i=0;i<n*2-1;i++){
int p = scanner.nextlong();
... | Main.java:8: error: cannot find symbol
int n = scanner.nextlong();
^
symbol: method nextlong()
location: variable scanner of type Scanner
Main.java:9: error: cannot find symbol
int k = scanner.nextlong();
^
symbol: method nextlong()
location: variable scanner of type Sc... |
s711277504 | p03721 | C++ | #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
int main() {
int n, k;
cin >> n >> k;
map<int, ll> mp;
for(int i = 0; i < n; i++) {
}
int a, b;
cin >> a >> b;
mp[a] += b;
}
ll s = 0;
for(auto&& e : mp) {
s += e.second;
if(s ... | a.cc:19:5: error: expected unqualified-id before 'for'
19 | for(auto&& e : mp) {
| ^~~
a.cc:28:5: error: expected unqualified-id before 'return'
28 | return 0;
| ^~~~~~
a.cc:29:1: error: expected declaration before '}' token
29 | }
| ^
|
s538461749 | p03721 | Java | import java.util.Arrays;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO 自動生成されたメソッド・スタブ
Scanner scan = new Scanner(System.in);
long N = scan.nextInt();
long K = scan.nextInt();
int [] A = new int [100001];
Arrays.fill(A, 0);
... | Main.java:26: error: reached end of file while parsing
}
^
1 error
|
s646184548 | p03721 | C++ |
#include <iostream>
#include <math.h>
#include<algorithm>
typedef unsigned long long ulong;
using namespace std;
int main(int argc, const char * argv[]) {
long N,K;
cin>>N>>K;
ulong * array=new ulong[N];
long a,b;
for (long i = 0; i < N; i++) {
cin >>a>>b;
arr... | a.cc:6:28: error: conflicting declaration 'typedef long long unsigned int ulong'
6 | typedef unsigned long long ulong;
| ^~~~~
In file included from /usr/include/stdlib.h:514,
from /usr/include/c++/14/cstdlib:79,
from /usr/include/c++/14/ext/string_... |
s379794887 | p03721 | C++ | #include<stdio.h>
int main(){
long long int N,K,i,sum=0;
long long int n[100001]={};
scanf("%d%d",&N,&K);
for(i=1;i<=N;i++){
scanf("%lld %lld",&a,&b);
n[a]+=b;
}
for(i=1;i<=N;i++){
sum+=n[i];
if(sum>=K) break;
}
printf("%d",i);
return 0;
} | a.cc: In function 'int main()':
a.cc:8:28: error: 'a' was not declared in this scope
8 | scanf("%lld %lld",&a,&b);
| ^
a.cc:8:31: error: 'b' was not declared in this scope
8 | scanf("%lld %lld",&a,&b);
| ^
|
s244991686 | p03721 | Java | import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
try {
main.solve(args);
} catch (Exception e) {
e.printStackTrace();
}
}
public void solve(String[] ... | Main.java:36: error: incompatible types: Object cannot be converted to Integer
for (Integer nKey : mapkey) {
^
1 error
|
s014373715 | p03721 | Java | import java.io.*;
import java.util.*;
import java.lang.Math.*;
public class Main {
public static void main(String[] args) {
Main main = new Main();
try {
main.solve(args);
} catch (Exception e) {
e.printStackTrace();
}
}
public void solve(String[] ... | Main.java:34: error: incompatible types: Object[] cannot be converted to Integer[]
Integer[] mapkey = map.keySet().toArray();
^
1 error
|
s828128590 | p03721 | C++ | #define MAX 100000
using namespace std;
int main(){
long long int data[MAX];
for(int i=0;i<MAX;i++){
data[i]=0;
}
long long int n,m;
cin>>n>>m;
for(int i=0;i<n;i++){
long long int a,b;
cin>>a>>b;
data[a-1]+=b;
}
int count=0;
for(int i=0;;i++){
count+=data[i];
if(count>=m){
cout<<i+1<<endl;
br... | a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
9 | cin>>n>>m;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | #define MAX 100000
a.cc:19:25: e... |
s004620076 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
int n;
long long k;
vector<pii> f[100005];
int main() {
cin >> n >> k;
for(int i = 1; i <= n; ++i) {
int a, b; cin >> a >> b;
f.push_back(pii(a, b));
}
sort(f.begin(), f.end());
long long t = 0;
for(int i = 0; i < n; ++i) {
t += f[i]... | a.cc: In function 'int main()':
a.cc:11:8: error: request for member 'push_back' in 'f', which is of non-class type 'std::vector<std::pair<int, int> > [100005]'
11 | f.push_back(pii(a, b));
| ^~~~~~~~~
a.cc:13:8: error: request for member 'begin' in 'f', which is of non-class type 'std::vector<std:... |
s131524568 | p03721 | Java | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
static void quick_sort(int[] d, int[] e, int left, int right) {
if (left>=right) {
return;
}
... | Main.java:25: error: method quick_sort in class Main cannot be applied to given types;
quick_sort(d, left, r); // ????????????????
^
required: int[],int[],int,int
found: int[],int,int
reason: actual and formal argument lists differ in length
Main.java:26: error: method quick_sort in class Main... |
s128089999 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define FORr(i, j, k) for(int i = j; i >= k; --i)
#define repr(i, j) FOR(i, j, 0)
#define INF (1 << 30)
#define MOD 1e9 + 7
typedef long long ll;
typedef unsigned long long ull;
typedef p... | a.cc: In function 'int main()':
a.cc:25:17: error: reference to 'array' is ambiguous
25 | array.insert(array.begin(), b, a);
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.