submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s595306159 | p03721 | Java | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class Test {
static void solve(FastScanner sc, PrintWriter out) {
int N = sc.ni();
long K = sc.nl();
long[] array = new long[100001];... | Main.java:7: error: class Test is public, should be declared in a file named Test.java
public class Test {
^
1 error
|
s310358971 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define int long long
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0... | cc1plus: error: '::main' must return 'int'
|
s775340541 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define int long long
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0... | cc1plus: error: '::main' must return 'int'
|
s624064863 | p03721 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int pow(int a,int n) {
int ans = 1;
rep(i,n) ans *= a;
return ans;
}
int main() {
ll N,K;
cin >> N >> K;
vector<pair<ll,ll>> res;
rep(i,N) {
l... | a.cc: In function 'int main()':
a.cc:25:19: error: '\U000000e5' was not declared in this scope
25 | while(i < N &&å sum > K) {
| ^
a.cc:25:20: error: expected ')' before 'sum'
25 | while(i < N &&å sum > K) {
| ~ ^~~~
| )
a.cc:25:28: e... |
s209890372 | p03721 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <bitset>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld... | a.cc: In function 'int main()':
a.cc:51:5: error: 'memset' was not declared in this scope
51 | memset(d, sizeof(d), 0);
| ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
13 | #include <numeric>
+++ |+#include <cstring>
1... |
s661268416 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<... | a.cc: In function 'int main()':
a.cc:42:25: error: return-statement with no value, in function returning 'int' [-fpermissive]
42 | return;
| ^~~~~~
|
s654559893 | p03721 | C++ | a.cc:1:1: error: extended character is not valid in an identifier
1 |
| ^
a.cc:1:1: error: '\U00003000' does not name a type
1 |
| ^~
| |
s874728347 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long n,k; cin >> n >> k;
map<long long,long long> mp;
for(long long i=0;i<n;++i){
long long a,b; cin >> a >> b;
mp[a] += b;
}
long long sum=0;
for(auto itr : mp){
sum += mp.second;
if(sum >= k) cout <<... | a.cc: In function 'int main()':
a.cc:12:19: error: 'class std::map<long long int, long long int>' has no member named 'second'
12 | sum += mp.second;
| ^~~~~~
a.cc:13:33: error: 'class std::map<long long int, long long int>' has no member named 'first'
13 | if(sum >= k) cou... |
s802208385 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using long long ll;
int main(){
ll n,k; cin >> n >> k;
ll sum = 0;
bool flag = true;
for(ll i=0;i<n;i++){
ll a,b;
cin >> a >> b;
sum += b;
if(sum >= k && flag == true){
cout << a << endl;
flag = false;
... | a.cc:3:7: error: expected nested-name-specifier before 'long'
3 | using long long ll;
| ^~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
5 | ll n,k; cin >> n >> k;
| ^~
a.cc:5:20: error: 'n' was not declared in this scope; did you mean 'yn'?
... |
s671085808 | p03721 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007L... | a.cc: In function 'int main()':
a.cc:32:11: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<std::pair<long long int, long long int> >, std::pair<long long int, long long int> >::value_type' {aka 'std::pair<long long int, l... |
s494237152 | p03721 | C++ | //#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const int INF= 1e9+5;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007L... | a.cc: In function 'int main()':
a.cc:22:13: error: expected ';' before ')' token
22 | for(auto p){
| ^
| ;
a.cc:22:13: error: expected primary-expression before ')' token
a.cc:22:13: error: expected ';' before ')' token
22 | for(auto p){
| ^
| ... |
s314822363 | p03721 | C++ | #include<iostream>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
int main(){
int n, k;
cin >> n >> k;
pair<int, int> p[n];
rep(i, n) cin >> p[i].first >> p[i].second;
sort(p, p + n);
int ans;
int sm = 0;
for (int i = 0; sm < k; i++){
ans = p[i].first;
... | a.cc: In function 'int main()':
a.cc:12:5: error: 'sort' was not declared in this scope; did you mean 'short'?
12 | sort(p, p + n);
| ^~~~
| short
|
s990430155 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
signed main(){
long long n , k , a , b , array[100005]={} , c=0;
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>a>>b;
array[a]+=b;
}
int i=1;
while(true){
c+=array[i];
if(c>=k){
break;
} else {
... | a.cc: In function 'int main()':
a.cc:20:6: error: expected ';' at end of input
20 | c
| ^
| ;
a.cc:20:6: error: expected '}' at end of input
a.cc:3:14: note: to match this '{'
3 | signed main(){
| ^
|
s342455400 | p03721 | C++ | #include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main(){
int n
ll k;
cin >> n >> k;
vector<P> e;
rep(i, n) {
int a, b;
cin >> a >> b;
e.empla... | a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'll'
12 | ll k;
| ^~
a.cc:13:12: error: 'n' was not declared in this scope; did you mean 'yn'?
13 | cin >> n >> k;
| ^
| yn
a.cc:13:17: error: 'k' was not declared in this scope
13 ... |
s139297297 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina c... | a.cc: In function 'int main()':
a.cc:21:15: error: wrong number of template arguments (1, should be 2)
21 | vector<pair<ll>> c(n);
| ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from /usr/include/x8... |
s255065617 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextLong();
int c = b-b;
double ans = 0;
double d;
double [] in1 = new double [a];
int f,g;
for(int i=0;i<a;... | Main.java:6: error: incompatible types: possible lossy conversion from long to int
int b = sc.nextLong();
^
1 error
|
s034765923 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
Long b = sc.nextLong();
Long c = b-b;
int ans = 0;
double d;
double [] in1 = new double [a];
int f,g;
for(int i=0;i<a;i... | Main.java:18: error: incompatible types: double cannot be converted to Long
c+=(in1[i]-d)*1000000;
^
Main.java:19: error: incompatible types: possible lossy conversion from double to int
if(c>=b){ans=d;break;}
... |
s047464763 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
Long b = sc.nextLong();
Long c = b-b;
int ans = 0;
int d;
double [] in1 = new double [a];
int f,g;
for(int i=0;i<a;i++)... | Main.java:14: error: cannot find symbol
in1[i] = d+ge-6;
^
symbol: variable ge
location: class Main
Main.java:17: error: incompatible types: possible lossy conversion from double to int
for(int i=0;i<a;i++){d =... |
s417772562 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
Long b = sc.nextLong();
Long c = b-b;
int ans = 0;
int d;
double [] in1 = new double [a];
int f,g;
for(int i=0;i<a;i++)... | Main.java:22: error: <identifier> expected
System.out.println(ans);
^
Main.java:22: error: <identifier> expected
System.out.println(ans);
^
Main.java:24: error: class, interface, enum, or record expected
}
^
3 errors
|
s978890359 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
Long b = sc.nextLong();
Long c = b-b;
int ans = 0;
int d;
double [] in1 = new double [a];
int f,g;
for(int i=0;i<a;i++)... | Main.java:14: error: ';' expected
in1[i] = d+ge-6
^
Main.java:22: error: <identifier> expected
System.out.println(ans);
^
Main.java:22: error: <identifier> expected
System.out.println(ans);
... |
s211074212 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = 0;
int ans = 0;
int [] in1 = new int [a];
int [] in2 = new int [a];
int [] in3 = new int [a];
... | Main.java:19: error: incompatible types: int cannot be converted to boolean
for(int j=0;j<a;j++){if(in1[i] = in3[j]){c+=in2[j];}
^
1 error
|
s209338362 | 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 0;
... | a.cc: In function 'int main()':
a.cc:8:2: error: 'cin' was not declared in this scope
8 | cin >> N >> K;
| ^~~
a.cc:18:2: error: 'cout' was not declared in this scope
18 | cout << ans << endl;
| ^~~~
a.cc:18:17: error: 'endl' was not declared in this scope
18 | cout << ans << endl;
| ... |
s832454278 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
const int max_n = 1e6;
map<int,int> table;
int n;
typedef long long l;
ll k;
int main(){
cin >> n >> k;
vector<pair<ll, ll> > v(n);
for(int i=0 ; i<n ; i++){
cin >> v[i].first >> v[i].second;
}
sort(v.begin(), v.end());
ll sum = 0;
ll res = 0;
for(int i=... | a.cc:7:1: error: 'll' does not name a type; did you mean 'l'?
7 | ll k;
| ^~
| l
a.cc: In function 'int main()':
a.cc:9:15: error: 'k' was not declared in this scope
9 | cin >> n >> k;
| ^
a.cc:10:15: error: 'll' was not declared in this scope; did you mean 'l'?
10 | vecto... |
s300693353 | p03721 | C++ | #[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::iter::FromIterator;
// input macro
// https://qiita.com/tanakh/items/0ba42c7ca36cd29... | a.cc:1:6: error: invalid preprocessing directive #[
1 | #[allow(unused_imports)]
| ^
a.cc:3:6: error: invalid preprocessing directive #[
3 | #[allow(unused_imports)]
| ^
a.cc:5:6: error: invalid preprocessing directive #[
5 | #[allow(unused_imports)]
| ^
a.cc:46:... |
s997586284 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
int64_... | a.cc:33:11: error: expected primary-expression before 'n'
33 | int64_t n, k;
| ^
a.cc:33:10: error: expected ']' before 'n'
33 | int64_t n, k;
| ^~
| ]
a.cc:34:3: error: 'cin' does not name a type
34 | cin >> n >> k;
| ^~~
a.cc:35:30: error: 'n' was n... |
s810941936 | p03721 | C++ | #include<bits/stdc+.h>
using namespace std;
using ll = long long;
int main()
{
ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0);
ll n, k, a, b;
cin >> n >> k;
map<ll, ll> freq;
for(int i = 0; i < n; i++)
{
cin >> a >> b;
freq[a] += b;
}
for(pair<ll, ll>& x: freq)
{
if(x.seco... | a.cc:1:9: fatal error: bits/stdc+.h: No such file or directory
1 | #include<bits/stdc+.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s744102011 | p03721 | C++ | from operator import itemgetter
import sys
def read():
return sys.stdin.readline().rstrip()
n, k = map(int, input().split())
ab = sorted([[int(i) for i in read().split()] for _ in range(n)], key=itemgetter(0))
c = 0
for a, b in ab:
c += b
if c >= k:
print(a)
break | a.cc:1:1: error: 'from' does not name a type
1 | from operator import itemgetter
| ^~~~
|
s783909247 | p03721 | C++ | #include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
using namespace std;
typedef long long ll;
#define fup(i,a,b) for(register int i=a;i<b;++i)
#define dint __int128
dint read()
{
dint x;char a;while((a=getchar())<48||a>57);
for(x=a-48;(a=getchar())>47&&a<58;x=(x<<3)+(x<<1)+(a^48))
return x;
}
st... | a.cc: In function 'void Main()':
a.cc:24:20: error: 'b' was not declared in this scope
24 | scanf("%d",&n);b
| ^
a.cc:26:9: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
26 | fup(i,0,n)scanf("%d%d",&s[i].a,&s[i].b);
| ^
a.cc:7:37: ... |
s903733564 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
/*
i1 i2 i3 i4 ... iN
7 5
7 7 7 7 7
6 2
6 6
*/
ios::sync_with_stdio(0); cin.tie(0);
ll N, K; cin >> N >> K;
ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
for(int i = 1; i <= N; ... | a.cc: In function 'int main()':
a.cc:16:27: error: expected identifier before numeric constant
16 | ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
| ^
a.cc: In lambda function:
a.cc:16:37: error: expected '{' before '=' token
16 | ll Area[100005] = { [ 0 ... 10]... |
s290708005 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
/*
i1 i2 i3 i4 ... iN
7 5
7 7 7 7 7
6 2
6 6
*/
ios::sync_with_stdio(0); cin.tie(0);
ll N, K; cin >> N >> K;
ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
for(int i = 0; i < N; i... | a.cc: In function 'int main()':
a.cc:16:27: error: expected identifier before numeric constant
16 | ll Area[100005] = { [ 0 ... 10] = 0, [11 ... 100004] = 0};
| ^
a.cc: In lambda function:
a.cc:16:37: error: expected '{' before '=' token
16 | ll Area[100005] = { [ 0 ... 10]... |
s793272354 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N
long long K;
cin >> N >> K;
vector<pair<int, int>> AB(N);
for (int i = 0, a, b; i < N && cin >> a >> b; i++) AB.at(i) = {a, b};
sort(AB.begin(), AB.end());
int ans = 0
long long sum = 0;
for (int i = 0; i < N; i++) {
sum += AB.at(i... | a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'long'
6 | long long K;
| ^~~~
a.cc:7:10: error: 'N' was not declared in this scope
7 | cin >> N >> K;
| ^
a.cc:7:15: error: 'K' was not declared in this scope
7 | cin >> N >> K;
| ^... |
s581231212 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
// begin() end()
#define all(x) (x... | a.cc: In function 'int main()':
a.cc:54:2: error: expected '}' at end of input
54 | }
| ^
a.cc:38:11: note: to match this '{'
38 | int main(){
| ^
|
s927706772 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
//long long
using ll = long long;
//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
// begin() end()
#define all(x) (x... | a.cc: In function 'int main()':
a.cc:51:7: error: expected ';' before 'break'
51 | break;
| ^~~~~
a.cc:54:2: error: expected '}' at end of input
54 | }
| ^
a.cc:38:11: note: to match this '{'
38 | int main(){
| ^
|
s756825859 | p03721 | C++ | #include <iostream>
#include <vector>
#include <queue>
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define pb push_back
#define eb emplace_back
#define fi first
#define se... | a.cc: In function 'int main()':
a.cc:156:16: error: 'i' was not declared in this scope
156 | num+=v[i].second;
| ^
|
s030710286 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq... | a.cc: In function 'int main()':
a.cc:18:21: error: 'i' was not declared in this scope
18 | rep(_,0,N) cin>>A[i].first>>A[i].second;
| ^
|
s862765811 | p03721 | C++ | / | a.cc:1:1: error: expected unqualified-id before '/' token
1 | /
| ^
|
s856084035 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define MAX 1000000007
int main(){
int n
long long k; cin >> n >> k;
pair<int, long long> p[n];
for(int i = 0; i < n; i++){
int a,b; cin >> a >> b;
p[i] = make_pair(a,b);
}
for(int i = 0; i < n; i++){
if(p[i].second < k){
... | a.cc: In function 'int main()':
a.cc:6:5: error: expected initializer before 'long'
6 | long long k; cin >> n >> k;
| ^~~~
a.cc:6:25: error: 'n' was not declared in this scope; did you mean 'yn'?
6 | long long k; cin >> n >> k;
| ^
| ... |
s013433006 | p03721 | C++ | //#include<iostream>
//#include<algorithm>
//#include<string>
//#include <cmath>
//#include <vector>
#include <bits/stdc++.h>
#define ll long long
#define REP(x,n) for(int x=0;x<n;x++)
// vector 操作 size(), empty(), insert(itr,値), erase(itr) (first,last),
// sort(itr), find(all(x),値),reverse(itr)
#define vei vector<... | a.cc:45:1: error: expected declaration before '}' token
45 | }
| ^
|
s602521094 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll long long;
int main(){
ll N,K;
vector<ll> v;
map<ll,ll> m;
cin >> N >> K;
for (ll i=0;i<(N);i++){
ll ai,bi;
cin >> ai >> bi;
for(ll j=0;j<bi;j++){
v.push_back(ai);
}
}
sort(v.be... | a.cc:3:7: error: expected nested-name-specifier before 'll'
3 | using ll long long;
| ^~
a.cc: In function 'int main()':
a.cc:5:5: error: 'll' was not declared in this scope
5 | ll N,K;
| ^~
a.cc:6:14: error: template argument 2 is invalid
6 | vector<ll> v;
| ... |
s484606087 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int N, K;
int main(){
cin >> N >> K;
vector<ll> ab(100010, 0);
ll a, b;
for(int i = 1; i <= N; i++){
cin >> a >> b;
ab[a] += b;
}
ll sum = 0; int j = 1;
while(sum < K) sum += ab[j++]
cout << j-1 << endl;
return 0;
}
| a.cc: In function 'int main()':
a.cc:18:32: error: expected ';' before 'cout'
18 | while(sum < K) sum += ab[j++]
| ^
| ;
19 |
20 | cout << j-1 << endl;
| ~~~~
|
s035483999 | p03721 | C++ | #include <iostream>
using namespace std;
int main() {
int n, k; cin >> n >> k;
int *cnt = new int[100010];
int a, b;
for (int i = 0; i < n; i++) {
cin >> a >> b;
cnt[a] += b;
}
int c = 0;
for (int i = 1; i <= 100000; i++) {
if (c+cnt[i] >= k) {
cout <... | a.cc: In function 'int main()':
a.cc:20:15: error: invalid types 'int[int]' for array subscript
20 | c += b[i];
| ^
|
s203758045 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N, K;
cin >> N >> K;
vector<pair<int, int> > v;
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
v.push_back(make_pair(a, b));
}
sort(v.begin(), v.end());
long long sum = 0;
for (int i = 0; i < N; i++) {
... | a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
15 | sort(v.begin(), v.end());
| ^~~~
| short
|
s009288800 | p03721 | C++ | //ABC061C
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <climits>
#include <cfloat>
#include <string>
#include <unordered_map>
using namespace std;
int main(){
int n
long long int k;
cin >> n >> k;
vector<int> a(n), b(n), x(100000);... | a.cc: In function 'int main()':
a.cc:16:9: error: expected initializer before 'long'
16 | long long int k;
| ^~~~
a.cc:17:16: error: 'n' was not declared in this scope; did you mean 'yn'?
17 | cin >> n >> k;
| ^
| yn
a.cc:17:21: error: 'k' wa... |
s754845185 | p03721 | C++ | int main(void){
int n;
int k;
long long sum=0;
scanf("%d %d",&n,&k);
int data[n][2];
for(int i=0;i<n;i++){
scanf("%d %d",&data[i][0],&data[i][1]);
}
qsort(data, n, sizeof(data[0]), compare_int);//ソート関数(配列めい、総数、固定、比較方法)
for(int i=0;i<n;i++){
// pri... | a.cc: In function 'int main()':
a.cc:6:5: error: 'scanf' was not declared in this scope
6 | scanf("%d %d",&n,&k);
| ^~~~~
a.cc:15:37: error: 'compare_int' was not declared in this scope
15 | qsort(data, n, sizeof(data[0]), compare_int);//ソート関数(配列めい、総数、固定、比較方法)
| ... |
s079144106 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#d... | a.cc: In function 'int main()':
a.cc:22:35: error: expected ';' before 'long'
22 | sort(suji.begin(), suji.end())
| ^
| ;
a.cc:25:15: error: 'wa' was not declared in this scope
25 | while(k > wa) {
| ^~
a.c... |
s664387693 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
long k;
cin >> n >> k;
int a[n];
int b[n];
int i;
for(i=0;i<n;i++){
cin >> a[i] >> b[i];
}
vector<pair<int,int>> p(n);
for(i=0;i<n;i++){
p[i] = make_pair(a[i],b[i]);
}
sort(p.begin(),p.end());
int cnt = 0;
int tmp = 0;
... | a.cc: In function 'int main()':
a.cc:21:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
21 | cnt += p.second;
| ^~~~~~
|
s898570233 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
long k;
cin >> n >> k;
int a[n];
int b[n];
int i;
for(i=0;i<n;i++){
cin >> a[i] >> b[i];
}
vector<pair<int,int>> p(n);
for(i=0;i<n;i++){
p[i] = make_pair(a[i],b[i]);
}
sort(p.begin(),p.end());
int cnt = 0;
int tmp = 0;
... | a.cc: In function 'int main()':
a.cc:21:14: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
21 | cnt += p.second();
| ^~~~~~
|
s595455290 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
long k;
cin >> n >> k;
int a[n];
int b[n];
int i;
for(i=0;i<n;i++){
cin >> a[i] >> b[i];
}
pair<int,int> p(n);
for(i=0;i<n;i++){
p[i] = make_pair(a[i],b[i]);
}
sort(p.begin(),p.end());
int cnt = 0;
int tmp = 0;
for(i=0... | a.cc: In function 'int main()':
a.cc:13:20: error: no matching function for call to 'std::pair<int, int>::pair(int&)'
13 | pair<int,int> p(n);
| ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
from /usr/include/c++/14/algorithm:60,
from... |
s565035599 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int n;
long k;
cin >> n >> k;
int a[n];
int b[n];
int i;
for(i=0;i<n;i++){
cin >> a[i] >> b[i];
}
pair<int,int> p[n];
for(i=0;i<n;i++){
p[i] = make_pair(a[i],b[i]);
}
sort(p.begin(),p.end());
int cnt = 0;
int tmp = 0;
for(i=0... | a.cc: In function 'int main()':
a.cc:17:10: error: request for member 'begin' in 'p', which is of non-class type 'std::pair<int, int> [n]'
17 | sort(p.begin(),p.end());
| ^~~~~
a.cc:17:20: error: request for member 'end' in 'p', which is of non-class type 'std::pair<int, int> [n]'
17 | sort(p.b... |
s255462595 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define F(n) for(long i=0;i<n;++i)
long main()
{
long n,k;
cin >> n >> k;
long a,b;
vector<pair<long,long> > v;
F(n){
cin >> a >> b;
v.push_back(make_pair(a,b));
}
sort(v.begin(),v.end());
long ans=0,cnt=0;
F(v.size()){
... | cc1plus: error: '::main' must return 'int'
|
s144927026 | p03721 | C++ | #include<algorithm>//sort(all(変数),greater<型名>()) で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数:優先度付きキュー 最大値の探索が早い
#include<set>
#i... | a.cc: In function 'int main()':
a.cc:29:27: error: type/value mismatch at argument 1 in template parameter list for 'template<class _Tp, class _Alloc> class std::vector'
29 | vector<make_pair<int,int>> p,cnt(n);
| ^~
a.cc:29:27: note: expected a type, got 'make_pair<int, int>'
a.c... |
s029629080 | p03721 | C++ | #include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <ctime>
#include <climits>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <utility>
#include <cstdlib>
using namespace std;
long int pow107 = (int)pow(10, 9) + 7;
long int limit = LONG_MAX;
bool c... | a.cc: In function 'int main()':
a.cc:68:16: error: 'class std::vector<std::pair<int, int> >' has no member named 'second'
68 | t += v.second;
| ^~~~~~
a.cc:70:23: error: 'class std::vector<std::pair<int, int> >' has no member named 'first'
70 | cout << v.first << endl;
... |
s113723819 | p03721 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;
int main() {
ll n, k, a, b, cnt = 0, ans;
cin >> n >> k;
vector<pair<int, int>> p(n);
rep(i, n) cin >> p[i].first >> p[i].second;
sort(p.begin(), p.end());
for (int i ... | a.cc: In function 'int main()':
a.cc:17:12: error: 'x' was not declared in this scope
17 | cnt += x.second;
| ^
|
s946472242 | p03721 | C++ | #include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i, j, n) for (int i = j; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
int n,k;
cin >> n >> k;
... | a.cc: In function 'int main()':
a.cc:17:17: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
17 | cin >> p[i].first >> p[i].second;
| ^
a.cc:17:31: error: no match for 'operator[]' (operand types are 'std::pair<int, int>' and 'int')
17 | ci... |
s016353050 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0), cout.tie(0)
#define ll long long int
#define ld long double
#define fr first
#define se second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) (int)v.size()
#define sunq(v) so... | a.cc: In function 'int main()':
a.cc:53:13: error: no matching function for call to 'min(long long int&, int&)'
53 | k -= min(i.se, k);
| ~~~^~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
... |
s461506766 | p03721 | C++ | #include <bits/stdc++.h>
#define mod 1000000007
#define rep(i, n) for(int i=0; i<n; ++i)
using namespace std;
typedef long long ll;
const long long INF = 1LL << 60;
int main(void){
int N, K;
cin >> N >> K;
vector<pair<int, int>> ab(N);
rep(i, N)
cin >> ab[i].first >> ab[i].second;
sort(ab.begin()... | a.cc: In function 'int main()':
a.cc:27:31: error: 'i' was not declared in this scope
27 | if(count + ab[i].second >= K){
| ^
|
s004156918 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) lower_bound(all(v),k)-v.begin()
#define chmin(x,y) if(x>y)x=y
... | a.cc: In function 'int main()':
a.cc:5:17: error: expected primary-expression before '.' token
5 | #define all(a) a.begin(),a.end()
| ^
a.cc:29:9: note: in expansion of macro 'all'
29 | sort(all());
| ^~~
a.cc:5:27: error: expected primary-expression before '.' token
5 ... |
s443698727 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) lower_bound(all(v),k)-v.begin()
#define chmin(x,y) if(x>y)x=y
... | a.cc: In function 'int main()':
a.cc:29:13: error: 'b' was not declared in this scope
29 | sort(all(b));
| ^
a.cc:5:16: note: in definition of macro 'all'
5 | #define all(a) a.begin(),a.end()
| ^
|
s522863007 | p03721 | C++ | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<math.h>
typedef long long ll;
using namespace std;
int main()
{
long long N, K, a[100000], b[100000], sum = 0;
cin >> N >> K;
for (int i = 0;i < N;i++)cin >> a[i] >> b[i];
for (int i = 0;i < N;i++)
{
for (int j =... | a.cc: In function 'int main()':
a.cc:17:48: error: 'c' was not declared in this scope
17 | for (int j = 0;j < b[i];j++) { c[sum] = a[i];sum++; }
| ^
a.cc:26:37: error: redeclaration of 'int tmp'
26 | int tmp = b[i... |
s484186798 | p03721 | C++ | #include<stdio.h>
#include<vector>
#include<iostream> //c++
#include<algorithm>
/*
int main(){
int a=0;
char A[5];
for (int i = 0; i < 5; i++) {
scanf("%c\n", &A[i]);
}
for(int i = 0; i < 5; i++) {
if (A[i] =='A' &&A[i + 1]=='C') {
a = 1;
}
}
if (a == 1) {
printf("Yes");
}
else {
printf("No"... | a.cc: In function 'int main()':
a.cc:132:20: error: expected ';' before 't'
132 | cin t[i];
| ^~
| ;
|
s276399669 | p03721 | C++ | #include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#de... | a.cc: In function 'int main()':
a.cc:32:10: error: 'b' was not declared in this scope
32 | sum[0]=b[0];
| ^
|
s727526945 | p03721 | C++ | /*Function Template*/
#include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)
int Len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int Sint(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10... | a.cc:66:15: error: macro "rep" requires 2 arguments, but only 1 given
66 | rep(auto c:v){
| ^
a.cc:5:9: note: macro "rep" defined here
5 | #define rep(i, n) for(int i = 0; i < (n); i++)
| ^~~
a.cc: In function 'int main()':
a.cc:66:3: error: 'rep' was not declared in this scop... |
s372347130 | p03721 | C++ | n, k = map(int, input().split())
l = [0]*(10**5+10)
for i in range(n):
a, b = map(int, input().split())
l[a] += b
sum = 0
for i in range(len(l)):
sum += l[i]
if sum >= k:
print(i)
break
| a.cc:1:1: error: 'n' does not name a type
1 | n, k = map(int, input().split())
| ^
|
s125005149 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a,b;
cin >> a >>b;
vector<pair<long long,long long>> p(n);
long long int c[100010],d[100010];
for(int i=0;i<a;i++){
cin >>c[i] >> d[i];
p[i]=make_pair(c[i],d[i]);
}
sort(p.begin(),p.end());
for(int i=0;i<a;i++){
... | a.cc: In function 'int main()':
a.cc:9:39: error: 'n' was not declared in this scope
9 | vector<pair<long long,long long>> p(n);
| ^
|
s509760896 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main(){
long long int a,b;
cin >> a >>b;
vector<pair<long long,long long>> p(n);
long long int c[100010],d[100010];
for(int i=0;i<a;i++){
cin >>c[i] >> d[i];
p[i]=make_pair(a[i],b[i]);
}
sort(p.begin(),p.end());
for(int i=0;i<a;i++){
... | a.cc: In function 'int main()':
a.cc:9:39: error: 'n' was not declared in this scope
9 | vector<pair<long long,long long>> p(n);
| ^
a.cc:14:21: error: invalid types 'long long int[int]' for array subscript
14 | p[i]=make_pair(a[i],b[i]);
| ... |
s976451094 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow... | a.cc: In function 'int main()':
a.cc:79:13: error: cannot convert 'std::pair<int, int>' to 'int' in initialization
79 | for(int p:v){
| ^
a.cc:81:12: error: request for member 'second' in 'p', which is of non-class type 'int'
81 | ans+=p.second;
| ^~~~~~
a.cc:83:15: error:... |
s253131762 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow... | a.cc: In function 'int main()':
a.cc:81:11: error: 'i' was not declared in this scope
81 | cout<<a[i]<<endl;
| ^
|
s715256711 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main (){
int n,k,a,b,ans=0;
cin>>n>>k;
for(int i=0;i<n;i++){
cin>>a>>b;
ans+=b;
if(ans>=k);{
cout<<a<<endl;
return 0;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:14:2: error: expected '}' at end of input
14 | }
| ^
a.cc:3:12: note: to match this '{'
3 | int main (){
| ^
|
s383090355 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
long long c[2e5];
int main() {
long long n, k; cin >> n >> k;
while (n--) {
int a, b; cin >> a >> b;
c[a] += b;
}
int r = 0;
while (k > 0) {
k -= c[r++];
}
cout << --r << endl;
}
| a.cc:4:13: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
4 | long long c[2e5];
| ^~~
a.cc:4:13: error: could not convert '2.0e+5' from 'double' to 'long unsigned int'
4 | long long c[2e5];
| ^~~
| |
| ... |
s618854952 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(long long int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(long long int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)... | a.cc: In function 'int main()':
a.cc:42:10: error: 'class std::priority_queue<int>' has no member named 'begin'
42 | sort(v.begin(),v.end());
| ^~~~~
a.cc:42:20: error: 'class std::priority_queue<int>' has no member named 'end'
42 | sort(v.begin(),v.end());
| ^~~
a.cc:4... |
s644622689 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(long long int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(long long int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)... | a.cc: In function 'int main()':
a.cc:29:15: error: conflicting declaration 'std::vector<int> a'
29 | vector<int> a(n),b(n),v;
| ^
a.cc:26:7: note: previous declaration as 'int a'
26 | int a=0,b=0,c=0,d=0,k=0,n=0,count=0,ans=1000000;
| ^
a.cc:29:20: error: conflicting declaratio... |
s202560788 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
int int_len(long long int n) {
int s=0;
while(n!=0) s++, n/=10;
return s;
}
int int_sum(long long int n) {
int m=0,s=0,a=n;
while(a!=0) s++, a/=10;
for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)... | a.cc: In function 'int main()':
a.cc:29:15: error: conflicting declaration 'std::vector<int> a'
29 | vector<int> a(n),b(n),v;
| ^
a.cc:26:17: note: previous declaration as 'long long int a'
26 | long long int a=0,b=0,c=0,d=0,k=0,n=0,count=0,ans=1000000;
| ^
a.cc:29:20... |
s530826330 | p03721 | C++ | #include <iostream>
#include <vector>
int main()
{
std::vector<int> ns;
int a, b, K, N;
scanf("%d %d", &N, &K);
for(int i=0; i<N; i++){
scanf("%d %d", &a, &b);
for(int j=0; j<b; j++){
ns.push_back(a);
}
}
std::sort(ns.begin(), ns.end());
printf("%d\n", ns[K-1]);
return 0;
} | a.cc: In function 'int main()':
a.cc:15:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
15 | std::sort(ns.begin(), ns.end());
| ^~~~
| qsort
|
s005058482 | p03721 | Java | import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long k = sc.nextLong();
int[] a = new int[n];
int[] b = new int[n];
long sum = 0;
TreeMap<Integer,Integer> map = new TreeMap<Integer,Int... | Main.java:15: error: variable k is already defined in method main(String[])
int k = map.get(a[i]);
^
1 error
|
s457006119 | p03721 | C++ | #include <iostream>
using namespace std;
using ll=long long;
#include <tuple>
#include <string>
#include <vector>
//入力数の桁数を出力
//https://atcoder.jp/contests/abc057/tasks/abc057_c
int cnt_digits(ll n){
int digits =0;
while(n > 0){
digits++;
n /= 10;
}
return digits;
}
int main() {
... | a.cc: In function 'int main()':
a.cc:45:5: error: 'sort' was not declared in this scope; did you mean 'short'?
45 | sort(a_vc.begin(), a_vc.end());
| ^~~~
| short
|
s609159923 | p03721 | C++ | int main() {
int num1;
int num2;
vector<int> num;
//格納、出力用
vector<pair<int, int>> a_vc;
vector<int> b_vc;
//入力
int n;
int k;
cin >> n >> k;
//cout << "入力値" <<n << k;
//入力
for(int i = 0;i < n;i++){
cin >> num1 >> num2;
a_vc.emplace_back(num1,num2)... | a.cc: In function 'int main()':
a.cc:5:5: error: 'vector' was not declared in this scope
5 | vector<int> num;
| ^~~~~~
a.cc:5:12: error: expected primary-expression before 'int'
5 | vector<int> num;
| ^~~
a.cc:7:12: error: 'pair' was not declared in this scope
7 | vect... |
s191533616 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
// マクロ
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
// 型エイリアス
using ll = long long;
using vi = vector<int>;
using vs = vector<string>;
using vvi = vector<vi>;
using vvs = vector<vs>;
const int AMAX = 100000;
ll cnt[AMAX + 1];
int main(void) {
int N;
ll K;
... | a.cc: In function 'int main()':
a.cc:30:3: error: expected '}' at end of input
30 | }
| ^
a.cc:14:16: note: to match this '{'
14 | int main(void) {
| ^
|
s380745409 | p03721 | C++ | #include<iostream>
#include <algorithm>
using namespace std;
int main(void){
int a[10];
for(int i=0;i<9;++i){
a[i] = 0;
}
int n;
cin>>n;
int over=0;
for(int i=0;i<n;++i){
int tmp;
cin>>tmp;
if(tmp<=399){
a[1]=1;//gray
}
else if((400<... | a.cc: In function 'int main()':
a.cc:51:9: error: 'mmax' was not declared in this scope
51 | mmax=1;
| ^~~~
a.cc:54:9: error: 'mmax' was not declared in this scope
54 | mmax = sum+over;
| ^~~~
a.cc:56:8: error: 'mmax' was not declared in this scope
56 | if(mmax>8... |
s447507697 | p03721 | C++ | import java.util.*
fun main(args: Array<String>) {
val sc = Scanner(System.`in`)
val n = sc.nextInt()
val k = sc.nextLong()
val a = (0 until n).map { Class016c(sc.next().toInt(), sc.next().toInt()) }
println(problem061c(n, k, a))
}
fun problem061c(n: Int, k: Long, a: List<Class016c>): Int {
va... | a.cc:4:29: error: stray '`' in program
4 | val sc = Scanner(System.`in`)
| ^
a.cc:4:32: error: stray '`' in program
4 | val sc = Scanner(System.`in`)
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*
... |
s208755214 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, j, n) for (int i = j; i < n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)
#define MOD (1000000007)
/////////////////////////////////////////////////////////
bool comp(pair<ll ll> a, pair<ll, ll> b){
return a.first < ... | a.cc:11:16: error: two or more data types in declaration of 'type name'
11 | bool comp(pair<ll ll> a, pair<ll, ll> b){
| ^~
a.cc:11:21: error: wrong number of template arguments (1, should be 2)
11 | bool comp(pair<ll ll> a, pair<ll, ll> b){
| ^
In file included from... |
s657653120 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main(){
int N;
long long K;
cin >> N >> K;
int a[N+10],b[N+10];
for(int i = 0; i < N; i++){
cin >> a[i] >> b[i];
}
long long c[100010];
for(int i = 0; i < 100010; i++){
c[i] = 0;
}
for(int i = 0; i <... | a.cc: In function 'int main()':
a.cc:22:9: error: 'i' was not declared in this scope
22 | for(i = 1; i < 100010; i++){
| ^
|
s855637414 | p03721 | C++ | var i,n:longint;
a,b:array[1..200000] of longint;
tmp,k:qword;
procedure sort(l,r:longint);
var i,j,x,y: longint;
begin
i:=l; j:=r; x:=a[(l + r) >> 1];
repeat
while a[i] < x do i:=i + 1;
while x < a[j] do j:=j - 1;
if not(i > j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:... | a.cc:2:15: error: too many decimal points in number
2 | a,b:array[1..200000] of longint;
| ^~~~~~~~~
a.cc:1:1: error: 'var' does not name a type
1 | var i,n:longint;
| ^~~
a.cc:2:5: error: 'a' does not name a type
2 | a,b:array[1..200000] of longint;
| ^
a.cc:3:5:... |
s607473530 | p03721 | C++ | var i,n:longint;
a,b:array[1..200000] of longint;
tmp,k:qword;
procedure sort(l,r:longint);
var i,j,x,y: longint;
begin
i:=l; j:=r; x:=a[(l + r) >> 1];
repeat
while a[i] < x do i:=i + 1;
while x < a[j] do j:=j - 1;
if not(i > j) then
begin
y:=a[i];
a[i]:=a[j];
a[j]:... | a.cc:2:15: error: too many decimal points in number
2 | a,b:array[1..200000] of longint;
| ^~~~~~~~~
a.cc:1:1: error: 'var' does not name a type
1 | var i,n:longint;
| ^~~
a.cc:2:5: error: 'a' does not name a type
2 | a,b:array[1..200000] of longint;
| ^
a.cc:3:5:... |
s525027511 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using edge = pair<ll, P>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
using Graph = vector<vector<ll>>;
const int dx[4] = {1, 0, ... | a.cc: In function 'void Main()':
a.cc:36:9: error: 'print' was not declared in this scope; did you mean 'rint'?
36 | print(p);
| ^~~~~
| rint
|
s133086604 | p03721 | C++ | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N
long long K;
cin >> N >> K;
vector<long long> cnt(100001);
for (int i = 0; i < N; i++) {
int a, b;
cin >> a >> b;
cnt[a] += b;
}
long long c = 0;
for (int i = 0; i < 100001; i++) {
... | a.cc: In function 'int main()':
a.cc:7:5: error: expected initializer before 'long'
7 | long long K;
| ^~~~
a.cc:8:12: error: 'N' was not declared in this scope
8 | cin >> N >> K;
| ^
a.cc:8:17: error: 'K' was not declared in this scope
8 | cin >> N >> K;
| ... |
s419752838 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
11 | #include <math.h>
+++ |+#include <cstdint>
12 | using i8 = int8_t;
a.cc:15:13: error:... |
s032399617 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
11 | #include <math.h>
+++ |+#include <cstdint>
12 | using i8 = int8_t;
a.cc:15:13: error:... |
s625040453 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
11 | #include <math.h>
+++ |+#include <cstdint>
12 | using i8 = int8_t;
a.cc:15:13: error:... |
s613193907 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <utility>
#include <tuple>
#include <string>
#include <cctype>
#include <cstdio>
#include <math.h>
using i8 = int8_t;
using u8 = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t... | a.cc:13:12: error: 'uint8_t' does not name a type
13 | using u8 = uint8_t;
| ^~~~~~~
a.cc:12:1: note: 'uint8_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
11 | #include <math.h>
+++ |+#include <cstdint>
12 | using i8 = int8_t;
a.cc:15:13: error:... |
s822077354 | p03721 | C++ |
#include <iostream>
int main()
{
unsigned int N;
unsigned int K;
unsigned int arr[100000];
unsigned int a, b;
unsigned int sum = 0;
memset(arr, 0x0, sizeof(arr));
std::cin >> N >> K;
for (int i = 0; i < N; i++)
{
std::cin >> a >> b;
arr[a] += b;
}
for (int i = 0; i <= 100000... | a.cc: In function 'int main()':
a.cc:13:3: error: 'memset' was not declared in this scope
13 | memset(arr, 0x0, sizeof(arr));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include <iostream>
+++ |+#include <cstring>
... |
s851016981 | p03721 | C++ |
#include <iostream>
int main()
{
unsigned int N;
unsigned int K;
unsigned int arr[100000];
unsigned int a, b;
unsigned int sum = 0;
memset(arr, 0x0, sizeof(arr));
std::cin >> N >> K;
for (int i = 0; i < N; i++)
{
std::cin >> a >> b;
arr[a] += b;
}
for (int i = 0; i < 5; i++... | a.cc: In function 'int main()':
a.cc:14:3: error: 'memset' was not declared in this scope
14 | memset(arr, 0x0, sizeof(arr));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include <iostream>
+++ |+#include <cstring>
... |
s276227033 | p03721 | Java | import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
public class Main061 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
HashMap<Integer,Integer>m = new HashMap<Integer,Integer>();
int n = sc.nextInt();
long k = sc.nextInt();
int []a = new int [n]... | Main.java:5: error: class Main061 is public, should be declared in a file named Main061.java
public class Main061 {
^
1 error
|
s235157170 | p03721 | C++ | p#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int AMAX = 100000;
ll bucket[AMAX + 1];
int main()
{
int N, K;
cin >> N, K;
int bucket[N];
int a, b;
for (int i = 0; i < N; i++) {
cin >> a >> b;
bucket[a] = b;
}
for (int i = 0; i < AMAX; i++) {
if (K <= bucket[i])... | a.cc:1:2: error: stray '#' in program
1 | p#include <bits/stdc++.h>
| ^
a.cc:1:1: error: 'p' does not name a type
1 | p#include <bits/stdc++.h>
| ^
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
11 | cin >> N, K;
| ^~~
a.cc:22:7: error: 'cout' wa... |
s490003195 | p03721 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
long long in[100001];
memset(in,0,sizeof in);
for(int i=0;i<n;i++){
int a,b;
cin >> a >> b;
in[a] += b;
}
long long sum = 0;
int ans;
for(int i=1;... | a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
10 | memset(in,0,sizeof in);
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#include <cstring>
4... |
s331735440 | p03721 | C++ | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
long long in[100001];
memset(in,0,sizeof(in));
for(int i=0;i<n;i++){
int a,b;
cin >> a >> b;
in[a] += b;
}
long long sum = 0;
int ans;
for(int i=1... | a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
10 | memset(in,0,sizeof(in));
| ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
3 | #include<algorithm>
+++ |+#include <cstring>
... |
s562234071 | p03721 | C++ | #include <iostream>
typedef long long ll
using namespace std;
int main() {
ll n, k, a, b;
ll NMAX=1e5+1;
ll buckets[NMAX] = {0};
cin >> n >> k;
for(ll i=0; i<n; i++) {
cin >> a >> b;
buckets[a] += b;
}
ll i=0, sum=0;
while(sum+buckets[i]<k) sum += buckets[i++];
cout... | a.cc:3:1: error: expected initializer before 'using'
3 | using namespace std;
| ^~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'll' was not declared in this scope
6 | ll n, k, a, b;
| ^~
a.cc:7:7: error: expected ';' before 'NMAX'
7 | ll NMAX=1e5+1;
| ^~~~~
... |
s650607685 | p03721 | C++ | #include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int N;
long long K;
vector<pair<int,int> > v;
int main(){
cin >> N >> K;
int a,b;
for(int i=0;i<N;i++){
cin >> a >> b;
v.push_back(make_pair(a,b));
}
sort(v.begin(),v.end());
long long count = 0;
... | a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
12 | 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 <algorithm>
+++ |+#include <iostream>
4 |
a.cc:... |
s859838199 | p03721 | C++ | #include <vector>
#include <utility>
#include <algorithm>
using namespace std;
int N;
long long K;
vector<pair<int,int> > v;
int main(){
cin >> N >> K;
int a,b;
for(int i=0;i<N;i++){
cin >> a >> b;
v.push_back(make_pair(a,b));
}
sort(v.begin(),v.end());
long long count = 0;
... | a.cc: In function 'int main()':
a.cc:12:5: error: 'cin' was not declared in this scope
12 | 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 <algorithm>
+++ |+#include <iostream>
4 |
a.cc:... |
s724688897 | p03721 | C++ | #include<iostream>
using namespace std;
struct node{
long long f;
long long num;
};
struct node data[100010];
long long main(){
long long N,K;
while(cin>>N>>K){
for(long long i=0;i<N;i++){
cin>>data[i].f>>data[i].num;
}//输入数据
struct node temp;
for(long long i=... | cc1plus: error: '::main' must return 'int'
a.cc: In function 'int main()':
a.cc:12:18: error: reference to 'data' is ambiguous
12 | cin>>data[i].f>>data[i].num;
| ^~~~
In file included from /usr/include/c++/14/string:53,
from /usr/include/c++/14/bits/locale_classes... |
s904946279 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
long long K;
cin >> N >> K;
vector<int> A(pow(10, 5) + 1);
int a, b;
for (int i=0; i<N; ++i) {
cin >> a >> b;
A[a] += b;
}
long long cnt = 0;
for (int ans=1; ans<=pow(10, 5); ++ans) {
if (K <= cnt[ans]) {
cout << ... | a.cc: In function 'int main()':
a.cc:18:17: error: invalid types 'long long int[int]' for array subscript
18 | if (K <= cnt[ans]) {
| ^
a.cc:22:13: error: invalid types 'long long int[int]' for array subscript
22 | K -= cnt[ans];
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.