submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s626865012 | p03721 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;
ll N,K;
ll num[100001];
int main(){
cin >> N >> K;
set<int> s;
for(int i=0;i<N;i++){
int a,b;
cin >> a >> b;
s.insert(a);
num[a]+=b;
}
for(set<int> ::iterator itr = s.begin();itr!=s... | a.cc:7:1: error: 'll' does not name a type
7 | ll N,K;
| ^~
a.cc:8:1: error: 'll' does not name a type
8 | ll num[100001];
| ^~
a.cc: In function 'int main()':
a.cc:10:10: error: 'N' was not declared in this scope
10 | cin >> N >> K;
| ^
a.cc:10:15: error: 'K' was not declared in... |
s522887631 | p03721 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main() {
int N,K;
cin >> N >> K;
int a[N], b[N];
for(int i = 0; i < N; i++) {
cin >> a[i] >> b[i];
}
vector<pair<int,int> > v;
for(int i = 0; i < N; i++) {
v.push_back(pair<int,int>(a[i],b[i]));
}
sort(v.begin()... | a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:7:12: note: to match this '{'
7 | int main() {
| ^
|
s434694847 | p03721 | C++ | #include <iostream>
using namespace std;
long long int cnt[100002];
int main(){
int N, K;
cin>>N>>K;
int number, pcs;
for(int i = 0; i < N; i++){
cin>>number>>pcs;
if(cnt[number] != 0){
cnt[number] += pcs;
}else{
cnt[number] = pcs;
}
}
unsigned long long int index = 0;
... | a.cc: In function 'int main()':
a.cc:24:23: error: missing template arguments before '[' token
24 | index += cnt[array[i]] ;
| ^
a.cc:26:18: error: missing template arguments before '[' token
26 | cout<<array[i]<<endl;
| ^
|
s964202029 | p03721 | C | #include <stdio.h>
#include <stdlib.h>
typedef struct SArray {
int num;
int quant;
SArray* next;
} SArray;
SArray* GetAdd(SArray* arr, int a);
void PutNode(SArray* arr, int a, int b);
void FreeArr(SArray* arr);
int main(void)
{
int n, k, i, a, b, temp;
scanf("%d %d", &n, &k);
SArray* arr = (SArray*)malloc(size... | main.c:7:2: error: unknown type name 'SArray'
7 | SArray* next;
| ^~~~~~
main.c: In function 'main':
main.c:37:9: error: assignment to 'SArray *' from incompatible pointer type 'int *' [-Wincompatible-pointer-types]
37 | asTemp = arr->next;
| ^
main.c:44:10: error: assignment to 'SArray *'... |
s253273078 | p03721 | C++ | // bigArray.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
int a, b;
long long array[100000] = { 0 };
for (int i = 0; i < n; i++)
{
cin >> a >> b;
array[a - 1] += b;
}
for (int i = 0; i < 100000; i++)
{
k -= ... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s978897696 | p03721 | C++ | // bigArray.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int n, k;
cin >> n >> k;
int a, b;
int array[100000] = { 0 };
for (int i = 0; i < n; i++)
{
cin >> a >> b;
array[a - 1] += b;
}
for (int i = 0; i < 100000; i++)
{
k -= array[... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s623174343 | p03721 | C++ | import java.util.Scanner;
import java.util.Arrays;
import java.util.TreeMap;
import java.util.Iterator;
public class Main{
static long n;
static long k;
TreeMap<long, long> map = new TreeMap<long, long>();
Main(){
Scanner cin = new Scanner(System.in);
this.n = cin.nextLong();
this.k = cin.nextLong();
for... | a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.util.Arrays;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-t... |
s716027235 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
long long K;
cin >> N >> K;
vector< pair<int, int> > v(N);
for (int i = 0; i < N; ++i) {
int a,b;
cin >> a >> b;
v[i] = pair<int, int>(a,b);
}
sort(v.begin(), v.end());
//for (int i = 0; i < N; ++i) {
// cout << "(" << v[... | a.cc: In function 'int main()':
a.cc:20:9: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(v.begin(), v.end());
| ^~~~
| short
|
s260287401 | p03721 | C | #include <stdio.h>
int main()
{
int n,k;
const int max=10001;
scanf("%d%d",&n,&k);
int num[max]={0};
int a,b;
for(int i=0;i<n;i++)
{
scanf("%d%d",&a,&b);
num[a]=b;
}
for(int i=1;i<max;i++)
{
k-=num[i];
if(k<=0)
{
printf("%d",i);
break;
}
}
return 0;
} | main.c: In function 'main':
main.c:9:22: error: variable-sized object may not be initialized except with an empty initializer
9 | int num[max]={0};
| ^
|
s307648663 | p03721 | C++ | #include <iostream>
#define MAX 100000
using namespace std;
int main(void)
{
int n,m,temp;
cin >> n >> m;
int b[100001];
for (int i=0;i<n;i++) {
itn a,b;
cin >> a >> b;
b[a] += b;
}
for (int i=1;MAX > i;i++) {
if (m <= b[i];)
m -= b[i];
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:11:25: error: 'itn' was not declared in this scope; did you mean 'int'?
11 | itn a,b;
| ^~~
| int
a.cc:12:32: error: 'a' was not declared in this scope
12 | cin >> a >> ... |
s009799190 | p03721 | C++ | #include <iostream>
using namespace std;
using ll = long long;
int main(void)
{
int n;
ll m;
cin >> n >> m;
int a[n],b[n];
for (int i=0;i<n;i++) {
cin >> a[i] >> b[i];
}
for (int i=0;i<n-1;i++) {
for (int j=0;j<n-1-i;j++) {
if (a[j]>a[j+1]) {
temp = a[j];
a[j] = a[j+1];
a[j+1] = temp;
tem... | a.cc: In function 'int main()':
a.cc:17:33: error: 'temp' was not declared in this scope; did you mean 'tm'?
17 | temp = a[j];
| ^~~~
| tm
|
s974257462 | p03721 | Java | package AtCoder;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;
import java.io.PrintWriter;
public class TaskC {
long[] arr = new long[100000+1];
public void solve(int testNumber, Scanner in, PrintWriter out) {
int n = in.nextInt();
int k = in.nextInt();
... | Main.java:8: error: class TaskC is public, should be declared in a file named TaskC.java
public class TaskC {
^
1 error
|
s151995266 | p03721 | C++ | #include<bits/stdc++.h>
#define rep(i,start,lim) for(lld i=start;i<lim;i++)
#define repd(i,start,lim) for(lld i=start;i>=lim;i--)
#define scan(x) scanf("%lld",&x)
#define print(x) printf("%lld ",x)
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define br printf("\n")
#define sz(a) lld((a).s... | a.cc: In function 'int main()':
a.cc:34:17: error: 'k' was not declared in this scope
34 | cin>>n>>k;
| ^
a.cc:37:39: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(lld&, int&)'
37 | rep(i,1,n) curr+=v[i].s,sum.pb(curr,v[0].f);
| ... |
s598646422 | p03721 | Java | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int K = sc.nextInt();
int[] a = new int[100000];
for(int i=0; i<100000; i++){
a[i] = 0;
}
for(int i=0; i<N; i++){
... | Main.java:27: error: reached end of file while parsing
}
^
1 error
|
s559373998 | p03721 | C++ | int main()
{
int N, K;
cin >> N;
cin >> K;
map<int, int> mii;
for (auto i = 0; i < N; i++)
{
int index, val;
cin >> index;
cin >> val;
mii[index] += val;
}
int counter = 0;
auto ind = mii.begin();
while (counter += ind->second < K) ind++;
cout << ind->first;
//char c = 'c';
//cin >> c;
return ... | a.cc: In function 'int main()':
a.cc:4:9: error: 'cin' was not declared in this scope
4 | cin >> N;
| ^~~
a.cc:6:9: error: 'map' was not declared in this scope
6 | map<int, int> mii;
| ^~~
a.cc:6:13: error: expected primary-expression before 'int'
6 | map<... |
s411548360 | p03721 | C++ | #include <iostream>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
void main()
{
int N, K;
cin >> N;
cin >> K;
map<int, int> mii;
for (auto i = 0; i < N; i++)
{
int index, val;
cin >> index;
cin >> val;
mii[index] += val;
}
int counter = 0;
auto ind = mii.begin();
while (... | a.cc:7:1: error: '::main' must return 'int'
7 | void main()
| ^~~~
|
s670276932 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void){
long long int N, K;
cin >> N >> K;
int A, B;
long long int ans[100001];
for(int i = 0; i < N; ++i){
cin >> A >> B;
ans[A] += B;
}
for(int i = 1; i <= 100000; ++i){
if(K <= ans[i]){
cout << i << endl;... | a.cc: In function 'int main()':
a.cc:21:1: error: break statement not within loop or switch
21 | break;
| ^~~~~
|
s308216836 | p03721 | C++ | #include <iostream>
using namespace std;
int main(void){
int N, K;
cin >> N >> K;
int A, B;
for(int i = 0; i < N; ++i){
cin >> A >> B;
ans[A] += B
}
for(int i = 1; i <= 100000; ++i){
if(K <= ans[i]){
cout << i << endl;
break;
}
... | a.cc: In function 'int main()':
a.cc:9:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
9 | ans[A] += B
| ^~~
| abs
a.cc:12:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
12 | if(K <= ans[i]){
| ^~~
|... |
s844105906 | p03721 | C++ | #include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int main()
{
int N,K;
scanf ("%d %d", &N, &K);
vector<pair<int, int>> V;
V.reserve(N);
for (int i = 0; i < N; i++) {
int a,b;
scanf("%d %d", &a, &b);
V.push_back({a, b});
}
sort(V.begin(), V.end());
for (aut... | a.cc: In function 'int main()':
a.cc:10:3: error: 'scanf' was not declared in this scope
10 | scanf ("%d %d", &N, &K);
| ^~~~~
a.cc:22:7: error: 'printf' was not declared in this scope
22 | printf("%d\n", v.first);
| ^~~~~~
a.cc:4:1: note: 'printf' is defined in header '<cstdio>'; this... |
s162985318 | p03721 | C++ | #include <iostream>
#include <cstdint>
#include <valarray>
using namespace std;
int main(void) {
int N;
long long K;
cin >> N >> K;
valarray<long long> s(0, 100000);
for (int n = 0; n < N; n++) {
int a, b;
cin >> a >> b;
s[a - 1] += b;
}
for (int n = 0; n < 1... | a.cc: In function 'int main()':
a.cc:13:36: error: call of overloaded 'valarray(int, int)' is ambiguous
13 | valarray<long long> s(0, 100000);
| ^
In file included from a.cc:3:
/usr/include/c++/14/valarray:639:5: note: candidate: 'std::valarray<_Tp>::valarray(const _Tp*, ... |
s442161648 | p03721 | C | #include <iostream>
#include <cstdint>
#include <valarray>
using namespace std;
int main(void) {
int N;
int64_t K;
cin >> N >> K;
valarray<int> s(0, 100000);
for (int n = 0; n < N; n++) {
int a, b;
cin >> a >> b;
s[a - 1] += b;
}
for (int n = 0; n < 100000; n... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s307952763 | p03721 | C | #include <iostream>
#include <cstdint>
#include <valarray>
using namespace std;
int main(void) {
int N;
int64_t K;
cin >> N >> K;
valarray<int> s(0, 100000);
for (int n = 0; n < N; n++) {
int a, b;
cin >> a >> b;
s[a - 1] += b;
}
for (int n = 0; n < 100000; n... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s268848661 | p03721 | C | #include <iostream>
#include <cstdint>
#include <valarray>
using namespace std;
int main(void) {
int N;
int64_t K;
cin >> N >> K;
valarray<int> s(0, 100000);
for (int n = 0; n < N; n++) {
int a, b;
cin >> a >> b;
s[a - 1] += b;
}
for (int n = 0; n < 100000; n... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s328421373 | p03721 | C++ | #include<iostream>
using namespace std;
int main(void)
{
int N = 0, K = 0, i = 0, count = 0, I = 0, ans = 0;
int a[100000], b[100000];
cin >> N >> K;
int min = 100000;
for (i = 0; i < N; i++) {
cin >> a[i] >> b[i];
}
do {
I = 0;
min = 100000;
for (i = 0; i < N; i++) {
if (min> a[i]) {
min = a[i]... | a.cc: In function 'int main()':
a.cc:29:2: error: expected 'while' at end of input
29 | }
| ^
a.cc:29:2: error: expected '(' at end of input
29 | }
| ^
| (
a.cc:29:2: error: expected primary-expression at end of input
a.cc:29:2: error: expected ')' at end of input
29 | }
| ^
|... |
s473519900 | p03721 | Java | //Do what you can't.
import java.io.*;
import java.util.*;
import java.math.BigInteger;
public class CB061A {
public static void main(String[] args) {
InputReader in = new InputReader(System.in);
PrintWriter w = new PrintWriter(System.out);
int n=in.nextInt(),k=in.nextInt();
obj[] a=new obj[n];
... | Main.java:6: error: class CB061A is public, should be declared in a file named CB061A.java
public class CB061A {
^
1 error
|
s573618152 | p03721 | Java | public class Main {
public static void main(String args[]) throws Exception {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
long K = sc.nextLong();
for (int i = 0; i < N; i++) {
int res = sc.nextInt();
long count = sc.nextLong();
K -= count;
if (K <= 0) {
System.out.println(res);
... | Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s178345445 | p03721 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
struct AB{
int a;
int b;
};
bool operator<(const AB& left, const AB& right) {
return left.a < right.a;
}
int main(){
int N
long K;
cin >> N >> K;
AB ab[N];
for (int i = 0; i < N; i++) {
cin >> ab[i].a >> ab[i].b;
... | a.cc: In function 'int main()':
a.cc:16:5: error: expected initializer before 'long'
16 | long K;
| ^~~~
a.cc:17:12: error: 'N' was not declared in this scope
17 | cin >> N >> K;
| ^
a.cc:17:17: error: 'K' was not declared in this scope
17 | cin >> N >> K;
| ... |
s443539757 | p03721 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<vector<int>>a(n, vector<long long>(2, 0));
for (int i = 0; i < n; i++) {
cin >> a[i][0] >> a[i][1];
if (i > 1 && a[i][0] == a[i - 1][0]) {
a[i][1] += a[i - 1][1];
a[i - 1][0] = 0;
... | a.cc: In function 'int main()':
a.cc:11:56: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int&, std::vector<long long int>)'
11 | vector<vector<int>>a(n, vector<long long>(2, 0));
| ^
In file included from /usr/inc... |
s765824620 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long long v[100000]
int main() {
long long n,k;
cin >> n >> k;
for(int i = 0;i < n;i++){
long long a,b;
cin >> a >> b;
v[a - 1] += b;
}
for(int i = 0;i < 100000;i++){
if(v[i] >= k){
cout << i + 1 << endl;
return 0;
}
k -= ... | a.cc:6:1: error: expected initializer before 'int'
6 | int main() {
| ^~~
|
s082574968 | p03721 | C++ | #include<cstdio>
const int MAX = 100000;
int main() {
int N;
int64_t K;
scanf("%d %ld\n", &N, &K);
int64_t num[MAX+1];
for (int i = 0; i < N; i++) {
int a, b;
scanf("%d %d", &a, &b);
num[a] += b;
}
int64_t mid_sum = 0;
int i = 1;
while (true) {
mid_sum += num[i];
if (mid_sum >= K) {
printf("%... | a.cc: In function 'int main()':
a.cc:6:9: error: 'int64_t' was not declared in this scope
6 | int64_t K;
| ^~~~~~~
a.cc:2:1: note: 'int64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
1 | #include<cstdio>
+++ |+#include <cstdint>
2 | con... |
s843062616 | p03721 | C++ | #include <cstdio>
#include <stdio.h>
#include <string>
#include <string.h>
#include <algorithm>
#include <vector>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)... | a.cc: In function 'int main()':
a.cc:17:9: error: 'longlong' was not declared in this scope
17 | longlong K;
| ^~~~~~~~
a.cc:18:17: error: expected ';' before 'num'
18 | longlong num[100011] = {0};
| ^~~~
| ;
a.cc:21:23: error: 'K' was not ... |
s922027532 | p03721 | C | #include <iostream>
#include <vector>
using namespace std;
long long v[100000];
int main() {
long long n,k;
cin >> n >> k;
for(int i = 0; i < n; i++){
long long a,b;
cin >> a >> b;
v[a - 1] += b;
}
for(int i = 0;i < 100000;i++){
if(v[i] >= k){
cout << i + 1 << endl;
return 0;
}
k -= v[i];
}
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s112617630 | p03721 | C | #include <iostream>
#include <vector>
using namespace std;
long long v[100000];
int main() {
long long n,k;
cin >> n >> k;
for(int i = 0; i < n; i++){
long long a,b;
cin >> a >> b;
v[a - 1] += b;
}
for(int i = 0;i < 100000;i++){
if(v[i] >= k){
cout << i + 1 << endl;
return 0;
}
k -= v[i];
}
... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s325441050 | p03721 | C | #include <bits/stdc++.h>
using namespace std;
long long v[100000];
int main() {
long long n,k;
cin >> n >> k;
for(int i = 0; i < n; i++){
long long a,b;
cin >> a >> b;
v[a - 1] += b;
}
for(int i = 0;i < 100000;i++){
if(v[i] >= k){
cout << i + 1 << endl;
return 0;
}
k -= v[i];
}
return 0;
}
| main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
1 | #include <bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s478362476 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
long long N,K,key=0;
cin>>N>>K;
vector<pair<int,int> >v(n);
for(int i=0;i<N;i++){
cin>>v[i].first>>v[i].second;
}
sort(v.begin(),v.end());
for(int i=0;i<N;i++){
key+=v[i].second;
if(key>=K){
cout<<v[i].first<<endl;
break;
... | a.cc: In function 'int main()':
a.cc:7:27: error: 'n' was not declared in this scope
7 | vector<pair<int,int> >v(n);
| ^
|
s685715865 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int mainc() {
int N, K; cin >> N >> K;
vector<int> backet(N+1, 0);
int a, b, i;
for (i=0; i<N; i++) {
cin >> a >> b;
backet[b] += a;
}
for (i=1; K>0; i++) {
K -= backet[i];
}
cout << i << endl;
} | a.cc: In function 'int mainc()':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 ex... |
s744465265 | p03721 | C++ | #include <iostream>
using namespace std;
using ll = long long;
const int AMAX = 100000;
ll cnt[AMAZ + 1];
int main(){
int N;
ll K;
cin >> N >> K;
for(int i = 0; i < N; ++i){
int A, B;
cnt[A] += B;
}
for(int ans = 1; ans <= AMAX; ++ans){
if(K <= cnt[ans]) {
... | a.cc:5:8: error: 'AMAZ' was not declared in this scope; did you mean 'AMAX'?
5 | ll cnt[AMAZ + 1];
| ^~~~
| AMAX
a.cc: In function 'int main()':
a.cc:14:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
14 | cnt[A] += B;
| ^~~
| int
... |
s024698591 | p03721 | Java | //package com.zhangyong.algorithm;
import java.io.*;
import java.util.StringTokenizer;
public class Solution {
FastScanner in;
PrintWriter out;
class FastScanner {
BufferedReader br;
StringTokenizer st;
private FastScanner(File f) {
try {
br = new Bu... | Main.java:6: error: class Solution is public, should be declared in a file named Solution.java
public class Solution {
^
1 error
|
s854304475 | p03721 | C++ | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#define int long long
using namespace std;
map<int, int>a;
signed main() {
int b; cin >> b;
int T; cin >> T;
for (int c = 0; c < b; c++) {
int d, e; cin >> d >> e;
a[d] += e;
}
int sum = 0;
for (auto i : ... | a.cc:9:1: error: extended character is not valid in an identifier
9 |
| ^
a.cc:9:1: error: '\U000000a0' does not name a type
9 |
| ^
a.cc: In function 'int main()':
a.cc:16:17: error: 'a' was not declared in this scope
16 | a[d] += e;
| ^
a.cc:19:23: er... |
s137403284 | p03721 | C | #include<stdio.h>
long long k, j, b[100001] { 0};
int main(void){
int i;
int a, b;
int r;
scanf("%d %lld", &n, &k);
while(n--){
scanf("%d", &a);
scanf("%d", &b);
r[a] += b;
}
j = 0;
for(i = 1; i < 100001; i++){
j += r[i];
if(j >= k){
printf("%d\n", i );
break;
}
}
printf("\n");
}
| main.c:2:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
2 | long long k, j, b[100001] { 0};
| ^
main.c: In function 'main':
main.c:9:27: error: 'n' undeclared (first use in this function)
9 | scanf("%d %lld", &n, &k);
| ... |
s614700887 | 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;
}
K -= cnt[ans];
}
return ... | a.cc: In function 'int main()':
a.cc:9:9: error: 'cin' was not declared in this scope
9 | cin >> N >> K;
| ^~~
a.cc:18:24: error: expected primary-expression before '=' token
18 | if(K <== cnt[ans]){
| ^
a.cc:19:25: error: 'cout' was not declared... |
s642260123 | p03721 | C++ | #define ll long long
#define rep(i,n) for (int i=0;i<(n);i++)
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<map>
#define SIZE 100001
#define MOD 1000000007
#define INF 100000000
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
ll k;
cin >> n >> k;
int a,b;
map... | a.cc: In function 'int main()':
a.cc:26:34: error: invalid types 'int[int]' for array subscript
26 | k -= mp[a[i]];
| ^
a.cc:28:46: error: invalid types 'int[int]' for array subscript
28 | cout << int(a[i]) << endl;
... |
s835444716 | p03721 | C++ | #include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;
#define FOR(i,s,e) for (int i = int(s); i < int(e); i++)
#define FORIT(i,c) for (typeof((c).begin()) i = (c).begin();... | a.cc: In function 'int main()':
a.cc:19:9: error: expected initializer before 'long'
19 | long long int K;
| ^~~~
a.cc:20:16: error: 'N' was not declared in this scope
20 | cin >> N >> K;
| ^
a.cc:20:21: error: 'K' was not declared in this scope
20 | c... |
s175307167 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define N 100000
int main() {
int n;
long long int k;
cin>>n>>k;
long long int hoge[N]={};
int a,b;
for(int i=0;i<n;i++){
cin>>a>>b;
hoge[a-1]+=b;
}
for(int i=0;i<N;i++){
k=k-a[i]
if(k<=0){
cout<<i+1<<endl;
break;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:16:22: error: invalid types 'int[int]' for array subscript
16 | k=k-a[i]
| ^
|
s052394155 | p03721 | C++ | using namespace std;
int main() {
long long int n;
int k;
cin>>n>>k;
vector<long long int> hoge;
long long int a[n];
long long int b[n];
for(int i=0;i<n;i++){
cin>>a[i]>>b[i];
for(int j=0;j<b[i];j++){
hoge.push_back(a[i]);
}
}
sort(hoge.begin(),hoge.end());
cout<<hoge[k-1]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin>>n>>k;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:7:9: e... |
s816935733 | p03721 | C++ | #include <iostream>
#include <map>
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
int N, K;
typedef pair <int,int> P;
vector<P> array;
int main() {
cin >> N >> K;
for(int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
array.push_back(P(a,b));
}
sort(array.begin(... | a.cc: In function 'int main()':
a.cc:18:5: error: reference to 'array' is ambiguous
18 | array.push_back(P(a,b));
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/string:51,
from /usr/include/c++/14/bits/locale_classes.... |
s196125796 | p03721 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <pair>
using namespace std;
int main(void){
int n,k;scanf("%d%d",&n,&k);
vector <pair<int,int> > v;
for(int i=0; i<n; i++){
int a,b;scanf("%d%d",&a,&b);
v.push_back(make_pair(a,b));
}
sort(v.begin(), v.end());
int index=0;
... | a.cc:5:10: fatal error: pair: No such file or directory
5 | #include <pair>
| ^~~~~~
compilation terminated.
|
s487310974 | p03721 | C++ | // ConsoleApplication1.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//
#include "stdafx.h"
#include<cmath>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<iostream>
#include<queue>
typedef long long i64;
using namespace std;
int main() {
int n;
i64 k;
vector<pair<i64, i64>> vec;
scanf("%d%lld", &n, &k);... | a.cc:4:10: fatal error: stdafx.h: No such file or directory
4 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s861553661 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cstdint>
using namespace std;
using elem_t = pair<int_least32_t, int_least32_t>;
int main()
{
int_least32_t n;
int_least64_t k;
cin >> n >> k;
vector<elem_t> v( n );
for(auto& x : v) {
cin >> x.first >> x.second;
}
sor... | a.cc:24:9: error: extended character is not valid in an identifier
24 | int_least32_t result;
| ^
a.cc: In function 'int main()':
a.cc:24:9: error: 'int_least32_t\U00003000result' was not declared in this scope
24 | int_least32_t result;
| ^~~~~~~~~~~~~~~~~~~~~
a.cc:2... |
s504250431 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
struct St {
int a;
int b;
bool operator<( const St& right ) const {
return a == right.a ? a < right.a : a < right.a;
}
};
int main()
{
int N;
long long int K;
cin >> N >> K;
vector<St> st(N)... | a.cc: In function 'int main()':
a.cc:19:5: error: expected initializer before 'long'
19 | long long int K;
| ^~~~
a.cc:20:12: error: 'N' was not declared in this scope
20 | cin >> N >> K;
| ^
a.cc:20:17: error: 'K' was not declared in this scope
20 | cin >> N >> K;
... |
s199300587 | p03721 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long long int D = 0;
long long int N = sc.nextInt();
long long int K = sc.nextInt();
int c[] = new int[100000];
for(long long int i = 0; i<N; i++){
long long int a = sc.n... | Main.java:7: error: not a statement
long long int D = 0;
^
Main.java:7: error: ';' expected
long long int D = 0;
^
Main.java:7: error: not a statement
long long int D = 0;
^
Main.java:7: error: ';' expected
long long int D = 0;
^
Main.java:8: error: not a statement
long long int N = ... |
s817951148 | p03721 | Java | import java.util.Scanner;
public class Main {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
long long int D = 0;
long long int N = sc.nextlong long int();
long long int K = sc.nextlong long int();
long long int c[] = new long long int[100000];
for(long long int i =... | Main.java:7: error: not a statement
long long int D = 0;
^
Main.java:7: error: ';' expected
long long int D = 0;
^
Main.java:7: error: not a statement
long long int D = 0;
^
Main.java:7: error: ';' expected
long long int D = 0;
^
Main.java:8: error: not a statement
long long int N = ... |
s336256881 | p03721 | C | #include <stdio.h>
int main(void) {
int N, K;
scanf("%d %d", &N, &K);
int a, b;
for (int n = 0; n < N; n++) {
scanf("%d %d", &a, &b);
K -= b;
if (K <= 0) break
}
printf("%d", a);
}
| main.c: In function 'main':
main.c:11:26: error: expected ';' before '}' token
11 | if (K <= 0) break
| ^
| ;
12 | }
| ~
|
s808560170 | p03721 | C++ | #include<iostream>
#include <cstdlib>
#include<list>
#include<stdio.h>
#include<algorithm>
#include<string>
#include<stack>
using namespace std;
int main() {
int n, k, a[1000001] = { 0 }; cin >> n >> k; k--;
for (int i = 0; i < n; i++)
{
int b, c;
cin >> b >> c;
a[b-1] += c;
}int i=0;
while(1)
{ if (k - a... | a.cc:25:1: error: extended character is not valid in an identifier
25 |
| ^
a.cc: In function 'int main()':
a.cc:25:1: error: '\U000000a0' was not declared in this scope
25 |
| ^
|
s301329812 | p03721 | C++ | #include<algorithm>
#include<stdio.h>
using namespace std;
struct node
{
long long int nu,cou;
};
struct node nod[1000010];
bool comp(struct node p1, struct node p2)
{
if(p1.num>p2.num) return false;
if(p1.num<=p2.num) return true;
}
int main() {
long long int n,i,k;
scanf("%lld %lld",&n,&k);
for(i=0; i<n; i++)
... | a.cc: In function 'bool comp(node, node)':
a.cc:11:15: error: 'struct node' has no member named 'num'; did you mean 'nu'?
11 | if(p1.num>p2.num) return false;
| ^~~
| nu
a.cc:11:22: error: 'struct node' has no member named 'num'; did you mean 'nu'?
11 | ... |
s662293038 | p03721 | Java | import java.util.Scanner;
public class Atcoder061c {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int D = 0;
int N = sc.nextInt();
int K = sc.nextInt();
int c[] = new int[100000];
for(int i = 0; i<N; i++){
int a = sc.nextInt();
int b = sc.nextInt();
c... | Main.java:3: error: class Atcoder061c is public, should be declared in a file named Atcoder061c.java
public class Atcoder061c {
^
1 error
|
s802960095 | p03721 | C | #include <cstdio>
#include <queue>
using namespace std;
struct t
{
int x,y;
}a[1001],b;
struct cmp
{
bool operator()(const struct t &a,const struct t &b)
{
return a.x>b.x;
}
};
int main()
{
int n,i,j,k,l;
scanf("%d%d",&n,&k);
for(i=0;i<n;i++)
scanf("%d%d",&a[i].x,&a[i].y);
priority_queue <t,vector<t>,cmp> q... | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s924236857 | p03721 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int main(){
int N,K,ans,x=0;
cin>>N>>K;
int a[N],b[N];
long long big[10000000000];
bool ansDefined=false;
//N=number of times putting the value
//ans=Kth smallest number
for(int i=0;i<N;i++){
cin>>a[i]>>b[i];
}
for(in... | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s766600779 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#define FOR(i,k,n) for((i)=(k);(i)<(n);(i)++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define pb push_back
#define all(a) (a).begin(),(a).end() //greater<int>()
#define ll long long
using namespace std;
int main(){
int N,i,j,a,b,v1,v2;
ll... | a.cc: In function 'int main()':
a.cc:15:9: error: expected initializer before 'int'
15 | int cnt=0;
| ^~~
a.cc:16:17: error: 'K' was not declared in this scope
16 | cin>>N>>K;
| ^
a.cc:40:17: error: 'cnt' was not declared in this scope; did you mean 'int'?
40... |
s336088084 | p03721 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
import util.Utils;
public class Main {
public static void main(String args[]) {
try (Scanner in = new Scanner(System.in)) {
int N = in.nextInt();
int K = in.nextInt();
int[] a = new int... | Main.java:5: error: package util does not exist
import util.Utils;
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s429956333 | p03721 | C++ | #include<bits/stdc++.h>
#define LL long long
using namespace std;
LL hash[100050];
int main(){
// freopen("input.txt","r",stdin);
LL n,k;
scanf("%I64d%I64d",&n,&k);
for(int i=1;i<=n;i++){
LL a,b;
scanf("%I64d%I64d",&a,&b);
hash[a]+=b;
}
for(int i=1;i<=100050;i++){
... | a.cc: In function 'int main()':
a.cc:12:9: error: reference to 'hash' is ambiguous
12 | hash[a]+=b;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
... |
s527107046 | p03721 | C++ | /
#include <iostream>
//#include <algorithm>
using namespace std;
void QuickSort(int array[],int b[], int begin, int end)
{
int i = begin;
int j = end;
int pivot;
int temp;
pivot = array[(begin + end) / 2];
while (1)
{
while (array[i] < pivot) { ++i; }
while (array[j] > pivot) { --j; }
if (i >= j)brea... | a.cc:1:1: error: expected unqualified-id before '/' token
1 | /
| ^
In file included from /usr/include/c++/14/iosfwd:42,
from /usr/include/c++/14/ios:40,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:3:
... |
s806400445 | p03721 | C++ | #include <iostream>
#include <algorithm>
#include <unordered_map>
using namespace std;
int main() {
int operate_num, k;
cin >> operate_num >> k;
unordered_map<int, int> map;
for (int i = 0; i < operate_num; i++) {
int num, push_num;
cin >> num >> push_num;
map[num] += push_num;
}
vector<int> k... | a.cc: In function 'int main()':
a.cc:16:3: error: 'vector' was not declared in this scope
16 | vector<int> keys;
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #include <unordered_map>
+++ |+#include <vector>
4 | ... |
s744442342 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int hash[100050];
int main(){
// freopen("input.txt","r",stdin);
int n,k;
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++){
int a,b;
scanf("%d%d",&a,&b);
hash[a]+=b;
}
for(int i=1;i<=100050;i++){
if(hash[i]) k-=hash[i];
... | a.cc: In function 'int main()':
a.cc:11:9: error: reference to 'hash' is ambiguous
11 | hash[a]+=b;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
... |
s644626139 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int hash[100050];
int main(){
// freopen("input.txt","r",stdin);
int n,k;
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++){
int a,b;
scanf("%d%d",&a,&b);
hash[a]+=b;
}
for(int i=1;i<=100050;i++){
if(hash[i]) k-=hash[i];
... | a.cc: In function 'int main()':
a.cc:11:9: error: reference to 'hash' is ambiguous
11 | hash[a]+=b;
| ^~~~
In file included from /usr/include/c++/14/string_view:50,
from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
... |
s741177491 | p03721 | C++ | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cmath>
#include <map>
#include <set>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define ll long long
#define ull unsigned long long
#... | a.cc: In function 'int main()':
a.cc:41:15: error: 'z' was not declared in this scope
41 | sum+=b[i];z
| ^
|
s948876042 | p03721 | C++ | # coding: utf-8
x={}
n,k=map(int,input().split())
for i in range(n):
a,b=map(int,input().split())
if a in x:
x[a]+=b
else:
x[a]=b
sorted(x)
a=0
for i in x.items():
a+=i[1]
if(a>=k):
print(i[0])
break; | a.cc:1:3: error: invalid preprocessing directive #coding
1 | # coding: utf-8
| ^~~~~~
a.cc:2:1: error: 'x' does not name a type
2 | x={}
| ^
a.cc:3:1: error: 'n' does not name a type
3 | n,k=map(int,input().split())
| ^
|
s907200627 | p03721 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(void){
int N,K;
cin >> N >> K;
vector<int> val[N];
for(int i = 0;i < N;++i){
int tmp;
cin >> tmp;
val.push_back(tmp);
}
sort(val.begin(),val.end());
if(val.size() <= K){
cout << val[N-1] << endl... | a.cc: In function 'int main()':
a.cc:17:9: error: request for member 'push_back' in 'val', which is of non-class type 'std::vector<int> [N]'
17 | val.push_back(tmp);
| ^~~~~~~~~
a.cc:19:12: error: request for member 'begin' in 'val', which is of non-class type 'std::vector<int> [N]'
19 | sort(... |
s458905156 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
struct AB {
int a;
int b;
bool operator<( const AB& right ) const {
return a == right.a ? a < right.a : b < right.b;
}
};
int main()
{
int N, K;
cin >> N >> K;
vector<AB> ab(N);
for( int i = 0; i < N; ++i ){
... | a.cc: In function 'int main()':
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'?
28 | sort(ab.begin(), ab.end());
| ^~~~
| short
|
s426099293 | p03721 | Java | import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = Long.parseLong(sc.next());
long K = Long.parseLong(sc.next());
long a = 0;
long cnt = 0;
for(long i=0;i<N... | Main.java:20: error: cannot find symbol
System.out.print(c);
^
symbol: variable c
location: class Main
1 error
|
s091628619 | p03721 | C++ | #include<iostream>
using namespace std;
int main()
{
int N;
unsigned long long K;
unsigned long long j = 0;
int a[100000], b[100000];
int Array[100000];
cin >> N >> K;
for (int i = 0; i < N; i++) {
cin >> a[i] >> b[i];
}
for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
for (int*p_Array = Arr... | a.cc: In function 'int main()':
a.cc:19:27: error: expected unqualified-id before 'int'
19 | for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
| ^~~
a.cc:19:26: error: expected ';' before 'int'
19 | for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
... |
s144475541 | p03721 | C++ | #include<iostream>
using namespace std;
int main()
{
int N;
unsigned long long K;
unsigned long long j = 0;
int a[100000], b[100000];
int Array[100000];
cin >> N >> K;
for (int i = 0; i < N; i++) {
cin >> a[i] >> b[i];
}
#if 0
for (int i = 0; i < N; i++) {
for (; j < b[i]; j++) {
Array[j] = a[i];... | a.cc: In function 'int main()':
a.cc:29:27: error: expected unqualified-id before 'int'
29 | for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
| ^~~
a.cc:29:26: error: expected ';' before 'int'
29 | for (int*p_a = a, int*p_b = b; p_a<p_a+N; p_a++, p_b++) {
... |
s899359520 | p03721 | Java | import java.util.*;
import java.lang.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long N = Long.parseLong(sc.next());
long W = Long.parseLong(sc.next());
int c;
long cnt = 0;
for(int i=0;i<... | Main.java:18: error: cannot find symbol
c = Integer.parseLong(sc.next());
^
symbol: method parseLong(String)
location: class Integer
Main.java:19: error: cannot find symbol
cnt += Integer.parseLong(sc.next());
^
symbol: method parseLon... |
s562590615 | p03721 | C++ | #include<iostream>
#include<stdio.h>
#include<vector>
#include<utility>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin>>n>>k;
vector< pair<int,int> > a(n);
for(int i=0;i<n;i++){
cin>>a[i].first;
cin>>a[i].second;
}
pair<int,int> temp;
/*sort
for(int ... | a.cc: In function 'int main()':
a.cc:29:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'length'
29 | sort(a,a.length());
| ^~~~~~
|
s092341590 | p03721 | Java | package beginner061;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class ProbC {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int k = sc... | Main.java:10: error: class ProbC is public, should be declared in a file named ProbC.java
public class ProbC {
^
1 error
|
s580838456 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
struct Data {
int no;
int a;
int b;
bool operator<( const Data& right ) const {
return a == right.a ? no < right.no : a < right.a;
}
};
int main() {
int N, K;
int a, b;
cin >> N >> K;
vector<Data> d(N);
for(int... | a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'?
24 | sort(d.begin(), d.end());
| ^~~~
| short
|
s202906657 | p03721 | C++ | //#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned int ruio[1000001];
int main() {
memset(ruio, 0, sizeof(ruio));
unsigned int N, K;
cin >> N >> K;
unsigned int sum = 1;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
if (a >= ruio[sum - 1]) {
for (int j ... | a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
7 | memset(ruio, 0, sizeof(ruio));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#include <... |
s112410285 | p03721 | C | #include<stdio.h>
int main(void){
int n, k;
int a, b;
int array[10001] = {0};
int i;
int cnt, ans;
scanf("%d%d",&n, &k)k;
for(i = 0;i < n; ++i){
scanf("%d%d", &a, &b);
array[a] += b;
}
ans = 0;
cnt = 0;
for(i = 0; cnt < k; ++i){
ans = i;
cnt += array[i];
}
printf("%d\n", ans);
return 0;
} | main.c: In function 'main':
main.c:9:29: error: expected ';' before 'k'
9 | scanf("%d%d",&n, &k)k;
| ^
| ;
|
s299941603 | p03721 | C++ | //#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned int ruio[1000001];
int main() {
memset(ruio, 0, sizeof(ruio));
unsigned int N, K;
cin >> N >> K;
unsigned int sum = 1;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
if (a >= ruio[sum - 1]) {
for (int j ... | a.cc: In function 'int main()':
a.cc:7:9: error: 'memset' was not declared in this scope
7 | memset(ruio, 0, sizeof(ruio));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#include <... |
s003656049 | p03721 | C++ | //#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
unsigned
int unsigned ruio[1000001];
int main() {
memset(ruio, 0, sizeof(ruio));
unsigned int N, K;
cin >> N >> K;
unsigned int sum = 1;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
if (a >= ruio[sum - 1]) {
f... | a.cc:6:6: error: duplicate 'unsigned'
6 | int unsigned ruio[1000001];
| ^~~~~~~~
| --------
a.cc: In function 'int main()':
a.cc:8:9: error: 'memset' was not declared in this scope
8 | memset(ruio, 0, sizeof(ruio));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in hea... |
s208699720 | p03721 | C | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef struct {
int a;
int b;
} ab;
int cmp( const void *p, const void *q ) {
return ((ab*)p)->a - ((ab*)q)->a;
}
int main (){
int i;
int n,k;
ab lst[10050] = {0};
int ans = 0;
scanf("... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s204460875 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef pair<ll, ll> ii;
ii v[10000050];
ll n, k,x;
int main(){
scanf("%lld%lld", &n, &k);
for(int i=0;i<n;i++){
scanf("%lld%lld", &(v[i].first), &(v[i].second));
}
sort(v, v + n);
for(int i=0;i<n;i++){
x += v[i].second;
if(x >= k) {printf("%lld\n", v[... | a.cc:3:14: error: 'll' was not declared in this scope
3 | typedef pair<ll, ll> ii;
| ^~
a.cc:3:18: error: 'll' was not declared in this scope
3 | typedef pair<ll, ll> ii;
| ^~
a.cc:3:20: error: template argument 1 is invalid
3 | typedef pair<ll, ll> ii;
| ... |
s940544643 | p03721 | C++ | #include<algorithm>
#include<vector>
#include<list>
#include<iostream>
#include<utility>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<iterator>
#include<map>
#include<limits>
#include<iomanip>
#include<ctime>
#include<cmath>
const int INF=2147483647;
const long long MOD=1e9+7;
using names... | a.cc: In function 'int main()':
a.cc:32:5: error: expected initializer before 'cin'
32 | cin>>n>>k;
| ^~~
a.cc:42:21: error: 'k' was not declared in this scope
42 | for(int i=0; ct<k; i++){
| ^
|
s111843402 | p03721 | C++ | #include<iostream>
#include<cstdint>
#include<map>
#include<vector>
using namespace std;
#define MAX 100000
int main() {
int N, a, b;
int64_t K;
cin >> N >> K;
vector<pair<int, int> > add(N);
for (int i = 0;i < N;i ++) {
cin >> a >> b;
add[i] = make_pair(a, b);
}
sort(add.begin(), add.end());
for (int i... | a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(add.begin(), add.end());
| ^~~~
| short
|
s436181175 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(int argc, const char * argv[]) {
long long n, k;
long long a, b;
pair<long long, long long> p;
vector<pair<long long, long long>> v;
long long cnt, ans;
cin >> n >> k;
for (int i = 0; i < n; i++) {
//入力
... | a.cc: In function 'int main(int, const char**)':
a.cc:23:5: error: 'sort' was not declared in this scope; did you mean 'short'?
23 | sort(v.begin(), v.end());
| ^~~~
| short
|
s756500953 | p03721 | C++ | #include <string.h>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <iterator>
#include <functional>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <... | a.cc: In function 'int main()':
a.cc:53:12: error: expected ';' before numeric constant
53 | break 0;
| ^~
| ;
|
s360382063 | p03721 | C++ | #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cstring>
#include <set>
#include <utility>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#include <map>
#define ll long long
#define read(x) scanf("%d",&x);
#define readll(x) cin>>x;
#define ... | a.cc: In function 'int main()':
a.cc:30:14: error: 'k' was not declared in this scope
30 | cin>>k>>endl;
| ^
|
s884353273 | p03721 | Java | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.io.*;
public class Main {
void solve() {
int N = sc.nextInt();
long K = sc.nextLong();
int[] a = new int[N];
int[] b = new int[N];
for (int i = 0; i < N; i++) {
a[i] = sc.nextInt();
b[i] = sc.nextInt();
... | Main.java:20: error: incompatible types: possible lossy conversion from long to int
int mi = (hi + lo) / 2;
^
1 error
|
s000574986 | p03721 | C++ | #include <iostream>
#include <tuple>
#include <string>
#include <map>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <stdio.h>
#include <queue>
#include <stack>
#include <deque>
#include <math.h>
#include <sstream>
#include <stdlib.h>
#include <functional>
using namespace std;
#define ... | a.cc: In function 'int main()':
a.cc:182:23: error: no match for 'operator+=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int> >, std::vector<long long int> >::value_type' {aka 'std::vector<long long int>'} and 'll' {aka 'long long int'})
182 | dh[a] += b;
a.cc:1... |
s242731352 | p03721 | C++ | #include <cstdio>
#ifdef _MSC_VER
#include <conio.h>
#else
#define getch()
#endif
#define LIMIT 100000
#define int long long int
int main(){
int Data[LIMIT]={};
int N=0;
int K=0;
scanf(" %d %d",&N,&K);
for(int i=0;i<N;i++){
int TempA=0;
int TempB=0;
scanf(" %d %d",&TempA,&TempB);
Data[TempA-1]+=TempB;
... | a.cc:10:23: error: '::main' must return 'int'
10 | #define int long long int
| ^~~
a.cc:12:1: note: in expansion of macro 'int'
12 | int main(){
| ^~~
|
s475643960 | p03721 | C++ | #include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdint>
#include <cstdio>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include... | a.cc: In function 'int main()':
a.cc:30:11: error: expected initializer before 'K'
30 | int64 K;
| ^
a.cc:33:17: error: 'K' was not declared in this scope
33 | cin >> N >> K;
| ^
|
s792447151 | p03721 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
int N, K;
int num[100001];
memset(num, 0, sizeof(int) * 100001);
cin >> N >> K;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
num[a] += b;
}
long long sum = 0;
for (int i = 0; i < 100001; i++) {
if (sum <... | a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
10 | memset(num, 0, sizeof(int) * 100001);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#i... |
s136670518 | p03721 | C | #include<stdio.h>
long count[100001];
int main(int argc, char const *argv[]){
long i,n,k,c=0;
scanf("%ld %ld",&n,&k);
for(i=0;i<n;i++){
scanf("%ld %ld",&a,&b);
count[a]+=b;
}
for(i=1;i<=100000;i++){
c+=count[i];
if(c>=k){
printf("%ld\n",i);
break;
}
}
return 0;
} | main.c: In function 'main':
main.c:7:34: error: 'a' undeclared (first use in this function)
7 | scanf("%ld %ld",&a,&b);
| ^
main.c:7:34: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:37: error: 'b' undeclared (f... |
s452214079 | p03721 | C | #include<stdio.h>
long count[100001];
int main(int argc, char const *argv[]){
long i,n,k,c=0;
scanf("%ld %ld",&n,&k);
for(i=0;i<n;i++){
scanf("%ld %ld",a,b);
count[a]+=b;
}
for(i=1;i<=100000;i++){
c+=count[i];
if(c>=k){
printf("%ld\n",i);
break;
}
}
return 0;
} | main.c: In function 'main':
main.c:7:33: error: 'a' undeclared (first use in this function)
7 | scanf("%ld %ld",a,b);
| ^
main.c:7:33: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:35: error: 'b' undeclared (firs... |
s380736436 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
signed main(){
int n;
cin>>n;
P p[n];
for(int i=0;i<n;i++) cin>>p[i].first>>p[i].second;
int k;
cin>>k;
sort(p.begin(),p.end());
for(int i=0;i<n;i++){
if(k>p[i].second) k-=p[i].second;
else{
cout<<p... | a.cc: In function 'int main()':
a.cc:12:10: error: request for member 'begin' in 'p', which is of non-class type 'P [n]' {aka 'std::pair<long long int, long long int> [n]'}
12 | sort(p.begin(),p.end());
| ^~~~~
a.cc:12:20: error: request for member 'end' in 'p', which is of non-class type 'P [n]' {a... |
s192843452 | p03721 | C++ | #include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#define syosu(x) fixed<<setprec... | a.cc: In function 'int main()':
a.cc:52:9: error: expected initializer before 'for'
52 | for(int i=0;i<n;i++){
| ^~~
a.cc:52:21: error: 'i' was not declared in this scope; did you mean 'vi'?
52 | for(int i=0;i<n;i++){
| ^
| vi
a.cc:... |
s107150896 | p03722 | Java | import java.util.*;
import java.io.*;
public class Main{
private static final int mod =(int)1e9+7;
public static void main(String[] args) throws Exception {
Scanner sc=new Scanner(System.in);
PrintWriter out=new PrintWriter(System.out);
int n=sc.nextInt();
long m=sc.nextLong();
pair []aa=new pair[m]... | Main.java:12: error: incompatible types: possible lossy conversion from long to int
pair []aa=new pair[m];
^
1 error
|
s530632780 | p03722 | C++ | #include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i < (n+1); ++i)
const double PI =3.141592653589793238463;
using namespace std;
using ll = long long;
const ll INF = +10010010000;
typedef pair<int,int> P;
const int mod = 1e9+7;
struct mi... | a.cc:79:10: error: redefinition of 'const ll INF'
79 | const ll INF = 1LL << 50;
| ^~~
a.cc:8:10: note: 'const ll INF' previously defined here
8 | const ll INF = +10010010000;
| ^~~
|
s233453241 | p03722 | C++ | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define sz size()
#define bgn begin()
#define en end()
#define pb push_b... | a.cc: In function 'bool find_negative_roop(std::vector<std::pair<std::pair<long long int, long long int>, long long int> >&, std::vector<long long int>&)':
a.cc:559:30: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'} to non-scalar type '... |
s665944583 | p03722 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
typedef pair<int,int> P;
typedef long long ll;
const int INF = 1001001001;
const ll INFL = 1e17;
const int MOD = 1e9+7;
struct edge{ll from,to,cost;};
vector<bool> negative(1010,false);
bool Bellman_Ford(int s, int V, vector<ll>& di... | a.cc: In function 'bool Bellman_Ford(int, int, std::vector<long long int>&, std::vector<edge>&)':
a.cc:26:30: error: 'v' was not declared in this scope
26 | if(loop == 2*v-1){
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.