submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s804816396 | p03720 | C++ | #include <iostream>
#include <vector>
#include <cstdint>
using namespace std;
int main()
{
int_least32_t n, m;
cin >> n >> m;
vector<int_least32_t> v( n. 0 );
int_least32_t a, b;
for(auto& x : v) {
cin >> a >> b;
++v[a - 1];
++v[b - 1];
}
for(auto$ x : v) {
cout << x << endl;
}
}
| a.cc: In function 'int main()':
a.cc:12:37: error: expected unqualified-id before numeric constant
12 | vector<int_least32_t> v( n. 0 );
| ^
a.cc:20:13: error: 'auto$' was not declared in this scope; did you mean 'auto'?
20 | for(auto$ x : v) {
| ... |
s754976172 | p03720 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
int m, n;int a[55];
ios::sync_with_stdio;
cin >> m >> n;
memset(a, 0, sizeof(a));
for (int i = 0; i < n; i++) {
int aa, bb;
cin >>... | a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
15 | memset(a, 0, sizeof(a));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <cstdlib>
+++ |+#include <cstrin... |
s423207501 | p03720 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
using namespace std;
int a[1000];
int main()
{
int m, n;
cin >> m >> n;
memset(a, 0, sizeof(a));
for (int i = 0; i < n; i++) {
int aa, bb;
cin >> aa >> bb;
if (aa ... | a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
15 | memset(a, 0, sizeof(a));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <cstdlib>
+++ |+#include <cstrin... |
s274033292 | p03720 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void)
{
int n, m, *ccnt, cnt;
scanf("%d %d", &n, &m);
ccnt = (int)malloc(sizeof(int) * n);
memset(ccnt, 0, m);
for(cnt = 0; cnt < m; cnt++)
{
scanf("%d %d", a, b);
ccnt[a - 1] +=1;
ccnt[b - 1] +=1;
}
for(cnt = 0... | a.cc: In function 'int main()':
a.cc:9:12: error: cast from 'void*' to 'int' loses precision [-fpermissive]
9 | ccnt = (int)malloc(sizeof(int) * n);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:12: error: invalid conversion from 'int' to 'int*' [-fpermissive]
9 | ccnt = (int)malloc(sizeof(int)... |
s074090162 | p03720 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <cstdio>
#include <cstdlib>
using namespace std;
int a[1000];
int main()
{
int m, n;
cin >> m >> n;
memset(a, 0, sizeof(a));
for (int i = 0; i < n; i++) {
int aa, bb;
cin >> aa >> bb;
a[aa]++... | a.cc: In function 'int main()':
a.cc:15:9: error: 'memset' was not declared in this scope
15 | memset(a, 0, sizeof(a));
| ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
8 | #include <cstdlib>
+++ |+#include <cstrin... |
s889027809 | p03720 | C++ | #include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
int i, j = 0;
int N, M = 0;
int A[50] = {};
int a, b = 0;
cin >> N;
cin >> M;
for (i = 0; i <= M-1; i++) {
cin >> a;
cin >> b;
A[a-1] += 1;
A[b-1] += 1;
}
for (j = 0; j <= N-1; j++) {
printf("%d\n", A[j]);
}
cin >> i;... | a.cc: In function 'int main()':
a.cc:12:9: error: 'cin' was not declared in this scope
12 | cin >> N;
| ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
2 | #include <string.h>
+++ |+#include <iostream>
3 |
|
s168752378 | p03720 | C | include<stdio.h>
int main(void){
int n,m,a[100],b[100],i,j,count;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){
scanf("%d %d",&a[i],&b[i]);
}
count = 0;
for(i=0;i<n;i++){
count = 0;
for(j=0;j<m;j++){
if(a[j]==i+1){
count = c... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s427220796 | p03720 | C | include<stdio.h>
int main(void){
int n,m,a[100],b[100],i,j,count;
scanf("%d %d",&n,&m);
for(i=0;i<m;i++){;
scanf("%d %d",&a[i],&b[i]);
}
count = 0;
for(i=0;i<n;i++){
count = 0;
for(j=0;j<m;j++){
if(a[j]==i+1){
count = coun... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s058186878 | p03720 | C | #include<stdio.h>
int main(void){
int n, m;
int i;
int a, b;
int city[1000] = {0};
scanf("%d%d",&n,&m);
for(i = 0;i < N; ++i){
scanf("%d%d", &a, &b);
city[a] += 1;
city[b] += 1;
}
for(i = 1;i <= m; i++) printf("%d\n", city[i]);
return 0;
} | main.c: In function 'main':
main.c:9:16: error: 'N' undeclared (first use in this function)
9 | for(i = 0;i < N; ++i){
| ^
main.c:9:16: note: each undeclared identifier is reported only once for each function it appears in
|
s372269929 | p03720 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main() {
int N, M;
cin >> N >> M;
int a[M], b[M];
for (int i = 0; i < M; i++) {
cin >> a[i] >> b[i];
}
int c[M];
for (int i = 0; i < M; i++) c[i] = 0;
for (int i = 0; i < M; i++) {
if (a[i] == i+1) c[i]++;
if (b[i] == i+1) ... | a.cc: In function 'int main()':
a.cc:22:14: error: expected ';' before '}' token
22 | c[i] /= 2
| ^
| ;
23 | }
| ~
|
s803575098 | p03720 | C++ | #include <cstdio>
#include <cstring>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for... | a.cc: In function 'int main()':
a.cc:23:13: error: 'count' was not declared in this scope
23 | cout << count(vec.begin(), vec.end(), i) << endl;
| ^~~~~
|
s766358706 | p03720 | C++ | #include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(int argc, char* argv[]) {
int n, m; cin >> n >> m;
vector<int> a, b;
for (int i = 0; i < m; i++) {
int aa, bb; cin >> aa >> bb;
a.pushback(aa);
b.pushback(bb);
}
vector<int> ans;
for (int i = 0; i < n; i++) {
ans.pushba... | a.cc: In function 'int main(int, char**)':
a.cc:11:19: error: 'class std::vector<int>' has no member named 'pushback'; did you mean 'push_back'?
11 | a.pushback(aa);
| ^~~~~~~~
| push_back
a.cc:12:19: error: 'class std::vector<int>' has no member named ... |
s850069407 | p03720 | C++ | 8 8
1 2
3 4
1 5
2 8
3 7
5 2
4 1
6 8 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 8 8
| ^
|
s331944572 | p03720 | C++ | 8 8
1 2
3 4
1 5
2 8
3 7
5 2
4 1
6 8 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 8 8
| ^
|
s252161530 | p03720 | C++ | #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include<iomanip>
using namespace std;
int main() {
vector<int> load;
int n, m;
int s, e;
cin >> n >> m;
load.resize(n);
for (int& v : load) {
v = 0;
}
while (cin >> s >> e) {
load[s - 1]++;... | a.cc: In function 'int main()':
a.cc:36:18: error: expected '}' at end of input
36 | return 0;
| ^
a.cc:12:12: note: to match this '{'
12 | int main() {
| ^
|
s424697930 | p03720 | C | /*ABC*/
#include<stdio.h>
int main(){
int n,m;
scanf("%d %d",&n,&m);
int a[m],b[m],ans[n];
int i;
for(i=0;i<n;i++){
ans[i]=0;
}
for(i=0;i<m;i++){
scanf("%d %d",a[i],b[i]);
ans(a[i])++;
ans(b[i])++;
}
for(i=0;i<n;i++){
printf("%d\n",ans[i]);
}
return 0;
}
| main.c: In function 'main':
main.c:13:5: error: called object 'ans' is not a function or function pointer
13 | ans(a[i])++;
| ^~~
main.c:6:17: note: declared here
6 | int a[m],b[m],ans[n];
| ^~~
main.c:14:5: error: called object 'ans' is not a function or function pointer
... |
s121699315 | p03720 | C++ | #include <stdio.h>
void main(){
int n,m;
int road[100];
for(int i =0; i < 100; i++){
road[i] = 0;
}
scanf("%d%d", &n, &m);
for(int i =0; i < m; i++){
int a,b;
scanf("%d%d", &a, &b);
road[a-1]++;
road[b-1]++;
}
for(int i =0; i < n; i++){
printf("%d\n", road[i]);
}
}
| a.cc:3:1: error: '::main' must return 'int'
3 | void main(){
| ^~~~
|
s355774291 | p03720 | C | /*ABC*/
#include<stdio.h>
int main(){
int n,m;
scanf("%d %d",&n,&m);
int a[m],b[m],ans[n];
for(int i=0;i<n;i++){
ans[i]=0;
}
for(i=0;i<m;i++){
scanf("%d %d",a[i],b[i]);
ans(a[i])++;
ans(b[i])++;
}
for(i=0;i<n;i++){
printf("%d\n",ans[i]);
}
return 0;
}
| main.c: In function 'main':
main.c:10:7: error: 'i' undeclared (first use in this function)
10 | for(i=0;i<m;i++){
| ^
main.c:10:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:5: error: called object 'ans' is not a function or function pointer
12 ... |
s637128020 | p03720 | C++ | #include<stdio.h>
int main()
{
int N,M;
int a[50],b[50],town[50];
int i;
scanf("%d %d",&N,&M);
for(i=0;i<M;i++)
scanf_n("%d %d",&a[i],&b[i]);
for(i=0;i<M;i++)
{
town[a[i]]++;
town[b[i]]++;
}
for(i=0;i<M;i++)
printf("%d\n",town[i]);
return 0;
} | a.cc: In function 'int main()':
a.cc:9:1: error: 'scanf_n' was not declared in this scope; did you mean 'scanf'?
9 | scanf_n("%d %d",&a[i],&b[i]);
| ^~~~~~~
| scanf
|
s188520237 | p03720 | C++ | int main() {
int N, M, a, b, R[50] = { 0 };
scanf("%d %d", &N, &M);
for (int i = 0; i < M; i++) {
scanf("%d %d", &a, &b);
R[a - 1]++;
R[b - 1]++;
}
for (int i = 0; i < N; i++)
printf("%d\n", R[i]);
while (true);
} | a.cc: In function 'int main()':
a.cc:3:9: error: 'scanf' was not declared in this scope
3 | scanf("%d %d", &N, &M);
| ^~~~~
a.cc:10:17: error: 'printf' was not declared in this scope
10 | printf("%d\n", R[i]);
| ^~~~~~
a.cc:1:1: note: 'printf' is define... |
s258253836 | p03720 | C++ | #include <iostream>
using namespace std;
int main(){
int n, m;
cin > n >> m;
int a[m], b[m];
for(int i=0; i<m; i++) cin >> a[i] >> b[i];
int r[n];
for(int i=0; i<n; i++) r[i]=0;
for(int i=0; i<m; i++){
r[a[i]-1] += 1;
}
for(int i=0; i<m; i++){
r[b[i]-1] += 1;
}
for(int i=0; i<n; i++) cout << r[i] << ... | a.cc: In function 'int main()':
a.cc:6:13: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
6 | cin > n >> m;
| ~~~ ^ ~~~~~~
| | |
| | int
| std::istream {aka std::basic_istream<c... |
s694233147 | p03720 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define ist istream_iterator
#define ost ostream_iterator
ll const inf = 100 * 1000;
int const N = (1 << 17) + 16;
int main() {
cin.tie(0);
cin.sync_with_stdio(0);
int n, m;
vector<int> cnt(n+1);
for(int i = 0; i < m; ++i) {
int x, ... | a.cc: In function 'int main()':
a.cc:22:5: error: 'a' was not declared in this scope
22 | a[x]++;
| ^
a.cc:26:10: error: 'a' was not declared in this scope
26 | copy_n(a.begin()+1, n, ostream_iterator<int>(cout, "\n"));
| ^
|
s927924530 | p03720 | 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:178:13: error: 'i' was not declared in this scope
178 | res(i, m) {
| ^
a.cc:178:9: error: 'res' was not declared in this scope; did you mean 'rep'?
178 | res(i, m) {
| ^~~
| rep
|
s689053900 | p03720 | C++ | #include <iostream>
#include <map>
#include <numeric>
int main()
{
int n, m;
std::cin >> n >> m;
std::vector<std::vector<int> > v(n, std::vector<int>(n, 0));
for (int i = 0; i < m; i++) {
int a, b;
std::cin >> a >> b;
a--;
b--;
v[a][b] = 1;
v[b][a] = 1;
}
for (int i = 0; i < n; i++) {
std::cou... | a.cc: In function 'int main()':
a.cc:11:14: error: 'vector' is not a member of 'std'
11 | std::vector<std::vector<int> > v(n, std::vector<int>(n, 0));
| ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
3 | #inc... |
s137881029 | p03720 | 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:174:12: error: extended character ↲ is not valid in an identifier
174 | ll n, m, Q;↲
| ^
a.cc:173:1: error: expected initializer before 'int'
173 | int lst[120000];
| ^~~
a.cc:174:12: error: '\U000021b2' does not name a type
174 | ll n, m, Q;↲
| ^
|
s659524942 | p03720 | C++ | #include <string>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
using ll = long long int;
int arr[60];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < m; i++) {
int a, b;
cin >> a >> b;
arr[a]++;
arr[b]++;
}
for (int i = 1; i <= n; i++) {
cout << arr[i] << e... | a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
15 | cin >> n >> m;
| ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
4 | #include <map>
+++ |+#include <iostream>
5 |
a.c... |
s041847964 | p03720 | C++ | #include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define r(i,n) for(int i=0;i<n;i++)
int main(){
int n,m;
cin>>n>>m;
int a[n]={};
while(m--){
int q,w;
cin>>q>>w;
a[q-1]++;
q[w-1]++;
}
for(int i=0;i<n;i++)
cout<<a[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:14:6: error: invalid types 'int[int]' for array subscript
14 | q[w-1]++;
| ^
|
s802073118 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int H, W;
int seen[10000][10000];
char S[10000][10000];
vector<pair<ll, ll>> prime_factorize(ll n) { //素因数分解と各素数の個数
vector<pair<ll, ll>> res;
for (ll i = 2; i * i <= n; i++)
{
if (n % i != 0)
{
continue;
... | In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterato... |
s671508837 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int H, W;
int seen[10000][10000];
char S[10000][10000];
vector<pair<ll, ll>> prime_factorize(ll n) { //素因数分解と各素数の個数
vector<pair<ll, ll>> res;
for (ll i = 2; i * i <= n; i++)
{
if (n % i != 0)
{
continue;
... | a.cc: In function 'int main()':
a.cc:117:21: error: request for member 'second' in 'p.std::map<long long int, long long int>::operator[](i)', which is of non-class type 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'}
117 | sum += p[i].second;
| ^~~~~~
a.cc... |
s349518482 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int H, W;
int seen[10000][10000];
char S[10000][10000];
vector<pair<ll, ll>> prime_factorize(ll n) { //素因数分解と各素数の個数
vector<pair<ll, ll>> res;
for (ll i = 2; i * i <= n; i++)
{
if (n % i != 0)
{
continue;
... | a.cc: In function 'int main()':
a.cc:114:19: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'second'
114 | sum += pa.second;
| ^~~~~~
a.cc:115:33: error: 'class std::vector<std::pair<long long int, long long int> >' has no member named 'first'
... |
s744224034 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int H, W;
int seen[10000][10000];
char S[10000][10000];
vector<pair<ll, ll>> prime_factorize(ll n) { //素因数分解と各素数の個数
vector<pair<ll, ll>> res;
for (ll i = 2; i * i <= n; i++)
{
if (n % i != 0)
{
continue;
... | a.cc: In function 'int main()':
a.cc:100:21: error: no matching function for call to 'std::vector<long long int>::push_back(std::pair<long long int, long long int>)'
100 | pa.push_back(make_pair(a[i], b[i]));
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/vector:... |
s754226921 | p03721 | C++ | /*Allah Vorosha*/
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define ull unsigned long long
#define pb push_back
#define n_p next_permutation
#define p_p prev_permutation
#define in insert
#define rev reverse
#define pf push_front
#define pob pop_back
#define uniq(v) v.resize(distance(v... | a.cc: In function 'void solve()':
a.cc:49:9: error: redeclaration of 'int mx'
49 | int mx = *max_element(all(a));
| ^~
a.cc:43:9: note: 'int mx' previously declared here
43 | int mx = -1;
| ^~
|
s141145300 | p03721 | C++ | #include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
/*
time:90m23s
wa:
反省:
考察:
*/
int main() {
int n;
long long k;
cin >> n >> k;
int a[100001], b[100001];
long long c[100001] = {0};
for(int i = 0; i < n; i++) {
cin ... | a.cc: In function 'int main()':
a.cc:21:13: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int [100001]')
21 | cin >> a >> b;
| ~~~ ^~ ~
| | |
| | int [100001]
| std::istream {aka std::... |
s846643537 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define plong pair<long,long>;
int main(){
int N;cin>>N;
long K;cin>>K;
vector<plong> A(N);
for(int i=0;i<N;i++){
long X,Y;cin>>X>>Y;
A.at(i)=make_pair(X,Y);
}
sort(A.begin(),A.end());
int X=0;
long count=0;
int ans=1;
while(true){
while(tr... | a.cc: In function 'int main()':
a.cc:4:15: error: template argument 1 is invalid
4 | #define plong pair<long,long>;
| ^~~~~~~~~~~~~~~
a.cc:9:10: note: in expansion of macro 'plong'
9 | vector<plong> A(N);
| ^~~~~
a.cc:4:15: error: template argument 2 is invalid
4 | #defi... |
s170994189 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define pl pair<long,long>;
int main(){
int N;cin>>N;
long K;cin>>K;
vector<pl> A(N);
for(int i=0;i<N;i++){
long X,Y;cin>>X>>Y;
A.at(i)=make_pair(X,Y);
}
sort(A.begin(),A.end());
int X=0;
long count=0;
int ans=1;
while(true){
while(true){
... | a.cc: In function 'int main()':
a.cc:4:12: error: template argument 1 is invalid
4 | #define pl pair<long,long>;
| ^~~~~~~~~~~~~~~
a.cc:9:10: note: in expansion of macro 'pl'
9 | vector<pl> A(N);
| ^~
a.cc:4:12: error: template argument 2 is invalid
4 | #define pl pair<long... |
s270510131 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long N,K;cin>>N>>K;long long M=0;
map<long long,long long>mp;
for(int X=0;X<N;X++){
int A,B;cin>>A>>B;
map[A]+=B;
}
for(auto p:mp){
long long A=p.first;long long B=p.second;M+=B;
if(M>K){
cout<<A<<emdl;break;
}
}
}
| a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'auto A'
8 | map[A]+=B;
| ^
a.cc:7:9: note: previous declaration as 'int A'
7 | int A,B;cin>>A>>B;
| ^
a.cc:8:11: error: expected initializer before '+=' token
8 | map[A]+=B;
| ^~... |
s711238435 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
long long N,K;cin>>N>>K;long long M=0;
map<long long,long long>mp;
for(int X=0;X<N;X++){
int A,B;cin>>A>>B;
map[A]+=B;
}
for(auto p:mp){
long long A=p.first;long long B=p.second;M+=B;
if(M>K)
cout<<A<<emdl;break;
}
} | a.cc: In function 'int main()':
a.cc:8:9: error: conflicting declaration 'auto A'
8 | map[A]+=B;
| ^
a.cc:7:9: note: previous declaration as 'int A'
7 | int A,B;cin>>A>>B;
| ^
a.cc:8:11: error: expected initializer before '+=' token
8 | map[A]+=B;
| ^~... |
s504140530 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using pl pair<long,long>;
int main(){
long N,K;cin>>N>>K;
vector<pl> A(N);
for(int i=0;i<N;i++){
long X,Y;cin>>X>>Y;
A.at(i)=make_pair(X,Y);
}
sort(A.begin(),A.end());
int X=0;
long count=0;
int ans=1;
while(true){
while(true){
if(S.at(... | a.cc:4:7: error: expected nested-name-specifier before 'pl'
4 | using pl pair<long,long>;
| ^~
a.cc: In function 'int main()':
a.cc:8:10: error: 'pl' was not declared in this scope
8 | vector<pl> A(N);
| ^~
a.cc:8:12: error: template argument 1 is invalid
8 | vector<pl> A(N);
... |
s476707228 | p03721 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:72: error: incompatible types: ArrayList<Long> cannot be converted to ArrayList<Integer>
ArrayList<Integer> one = nextLongArray();
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
|
s129804971 | p03721 | Java | import java.util.*; import java.io.*; import java.math.*;
public class Main{
//Don't have to see. start------------------------------------------
static class InputIterator{
ArrayList<String> inputLine = new ArrayList<String>(1024);
int index = 0; int max; String read;
InputIterator(){
BufferedReader br = ne... | Main.java:83: error: incompatible types: int cannot be converted to Long
map.put(A, B);
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
|
s357457432 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const ll INF = 1e12;
const ll MOD = 1000000000 + 7;
#define PB push_back
#define PF push_front
#define fi first
#define se second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpi vector<pii>... | a.cc: In function 'void solve()':
a.cc:81:3: error: 'mll' was not declared in this scope; did you mean 'll'?
81 | mll mp;
| ^~~
| ll
a.cc:82:13: error: 'mp' was not declared in this scope
82 | rep(i, n) mp[a[i]] += b[i];
| ^~
a.cc:84:17: error: 'mp' was not declared in this s... |
s935788965 | p03721 | C++ | 10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 10 500000
| ^~
|
s512013904 | p03721 | C++ | #include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<stack>
#include<queue>
using namespace std;
typedef long long ll;
const int maxn = 200010;
lll n,m,k,cnt;
ll bas[maxn],a[maxn],b[maxn],arr[maxn],pre[maxn];
ll read(){ ll s=0,f=1; char ch=getchar(); while(ch<'0' || ch>'... | a.cc:13:1: error: 'lll' does not name a type; did you mean 'll'?
13 | lll n,m,k,cnt;
| ^~~
| ll
a.cc: In function 'int main()':
a.cc:20:9: error: 'm' was not declared in this scope; did you mean 'tm'?
20 | m = 0, cnt = 0;
| ^
| tm
a.cc:20:16: error: 'cnt' was not de... |
s831453383 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll = long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll n,k;
cin >> n >> k;
vector<pair<ll,ll>> vec;
rep(i,n){
ll x,y;
cin >> x >> y;
vec.push_back(make_pair(x,y));
}
sort(vec.begin(),vec.end());
ll now=0;
rep(i... | a.cc:6:4: error: expected ';' before 'main'
6 | int main() {
| ^~~~~
| ;
|
s688258982 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
ll n,k;
cin >> n >> k;
vector<pair<ll,ll>> vec;
rep(i,n){
ll x,y;
cin >> x >> y;
vec.push_back(make_pair(x,y));
}
sort(vec.begin(),vec.end());
ll now=0;
rep(i,n){
now+=vec[i].... | a.cc: In function 'int main()':
a.cc:6:3: error: 'll' was not declared in this scope
6 | ll n,k;
| ^~
a.cc:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
7 | cin >> n >> k;
| ^
| yn
a.cc:7:15: error: 'k' was not declared in this scope
7 | cin ... |
s544288760 | 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.nextInt();
HashMap<Integer, Long> map = new HashMap<Integer, Long>();
for(int i = 0; i < n; i++) {
int a = sc.nextInt();
long b = sc... | Main.java:19: error: incompatible types: Set<Integer> cannot be converted to ArrayList<Integer>
ArrayList<Integer> list = map.keySet();
^
1 error
|
s822583974 | p03721 | C++ | #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vl;
int main() {
ll N, K;
cin >> N >> K;
ll A(N), B(N);
rep(i, N) {
cin >> A[i] >> B[i];
}
int i = 0;
while (K... | a.cc: In function 'int main()':
a.cc:14:17: error: invalid types 'll {aka long long int}[int]' for array subscript
14 | cin >> A[i] >> B[i];
| ^
a.cc:14:25: error: invalid types 'll {aka long long int}[int]' for array subscript
14 | cin >> A[i] >> B[i];
| ... |
s527598983 | p03721 | Java | import java.util.*;
public class Main {
public static void main(final String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
long k = sc.nextLong();
Map<Integer, Long> map = new TreeMap<>();
for (int i = 0; i < n; i++) {
int key = sc.nextInt(... | Main.java:12: error: incompatible types: int cannot be converted to Long
long count = map.getOrDefault(key, 0 );
^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
|
s399744619 | 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 main(){
const int nmax = 100100;
int n,k;
int m[nmax];
cin >> n >> k;
rep(i,n){
int a,b;
cin >> a >> b;
m[a] += b;
}
int ans;
for (int i = 1; i <= ... | a.cc: In function 'int main()':
a.cc:20:24: error: 'AMAX' was not declared in this scope
20 | for (int i = 1; i <= AMAX; ++i){
| ^~~~
|
s270929677 | p03721 | C++ | #include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long int;
const int INF = 1000000000;
const int LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;
const int M = 1e5 + 5;
int main(void)
{
int N, K;
cin >> N >> K;
vector<int> list(M, 0);
int value, cnt;
... | a.cc:4:19: error: declaration does not declare anything [-fpermissive]
4 | typedef long long int;
| ^~~
a.cc:6:18: warning: overflow in conversion from 'long int' to 'int' changes value from '1000000000000000000' to '-1486618624' [-Woverflow]
6 | const int LINF = 1000000000000000000; //1... |
s060054465 | p03721 | C++ | #include <stdio.h>
#include <iostream>
int main(void)
{
long long n, k;
long long a, b;
const int AMAX = 100000;
long long cnt1[AMAX + 1];
long long cnt2[AMAX + 1];
long long c = 0;
long long t = 1;
std::cin >> n >> k;
for(long long i = 0; i < n; i++)
{
std::cin >> a >> b;
cnt1[c] = ... | a.cc: In function 'int main()':
a.cc:25:8: error: 'J' was not declared in this scope
25 | if(J == (c-2) && t <= k)
| ^
|
s912397251 | p03721 | C++ | #include <stdio.h>
#include <iostream>
int main(void)
{
long long n, k;
long long a, b;
const int AMAX = 100000;
long long cnt[AMAX + 1];
long long c = 0;
long long t = 0;
std::cin >> n >> k;
for(long long i = 0; i < n; i++)
{
std::cin >> a >> b;
cnt1[c] = a;
cnt2[c++] = b;
}
... | a.cc: In function 'int main()':
a.cc:18:5: error: 'cnt1' was not declared in this scope; did you mean 'cnt'?
18 | cnt1[c] = a;
| ^~~~
| cnt
a.cc:19:5: error: 'cnt2' was not declared in this scope; did you mean 'cnt'?
19 | cnt2[c++] = b;
| ^~~~
| cnt
a.cc:24:9: error... |
s492668022 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
#define SWAP(x,y,z) {if ( y > z ) swap(y,z); if ( x > y ) swap(x,y); if (y > z) swap(y,z);}
typedef long long ll;
typedef unsigned long long ull;
double const eps = 1e-6;
double const pi = 3.1415926535;
ll const mod = 1e9+7;
ll a[100005];
int main()
{
ios_base... | a.cc: In function 'int main()':
a.cc:37:6: error: expected '}' at end of input
37 | }
| ^
a.cc:16:1: note: to match this '{'
16 | {
| ^
|
s536867459 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll=long long int;
#define rep(i,n) for(int i=0;i<(n);i++)
int main(){
ll n;
ll k;
cin>>n>>k;
vector<pair<int,int>>c(n);
rep(i,n){
cin>>c[i].first>>c[i].second;
}
sort(c.begin(),c.end());
int ans;
for(int i=1;i<n;i++){... | a.cc: In function 'int main()':
a.cc:26:2: error: expected '}' at end of input
26 | }
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s388261569 | p03721 | C++ | #include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define ll long long
ll l1[100005];
int main()
{
ll n,m;
cin>>n>>m;
ll a,b,y=0,x=0;
for(int i=1;i<=n;i++){
cin>>a>>b;
x+=b;
//if(x>=m&&y==0)y=a;
l1[a]+=b;
}
for(int i=1;i<=100000;i++){
if(k<=... | a.cc: In function 'int main()':
a.cc:20:12: error: 'k' was not declared in this scope
20 | if(k<=l1[i]){
| ^
a.cc:23:9: error: 'k' was not declared in this scope
23 | k-=l1[i];
| ^
|
s199967751 | p03721 | C++ | #include<bits/stdc++.h>
#include<cstring>
using namespace std;
#define ll long long
ll l1[55];
int main()
{
ll n,m;
cin>>n>>m;
ll a,b,y=0,x=0;
for(int i=1;i<=n;i++){
cin>>a>>b;
x+=b;
if(x>=m&&y=0)y=a;
}
cout<<y<<endl;
}
| a.cc: In function 'int main()':
a.cc:16:16: error: lvalue required as left operand of assignment
16 | if(x>=m&&y=0)y=a;
| ~~~~^~~
|
s475399934 | p03721 | C++ | #include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
using n... | a.cc: In function 'int main()':
a.cc:38:7: error: 'return0' was not declared in this scope
38 | return0;
| ^~~~~~~
|
s324613256 | p03721 | C++ | #include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
using n... | a.cc: In function 'int main()':
a.cc:26:9: error: 'intA' was not declared in this scope; did you mean 'int'?
26 | intA, B;
| ^~~~
| int
a.cc:26:15: error: 'B' was not declared in this scope
26 | intA, B;
| ^
a.cc:27:14: error: 'A' was not declared in... |
s414916670 | p03721 | C++ | #include <stdio.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <sstream>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <deque>
using namespace std;
using ll=longlong;
const int AMAX=100000;
ll ... | a.cc:17:10: error: 'longlong' does not name a type
17 | using ll=longlong;
| ^~~~~~~~
a.cc:19:1: error: 'll' does not name a type
19 | ll cnt[AMAX+1];
| ^~
a.cc: In function 'int main()':
a.cc:23:3: error: 'll' was not declared in this scope
23 | ll K;
| ^~
a.cc:24:11: error: 'K'... |
s654953625 | p03721 | C++ | #include<iostream>
#define MAX 100010
using namespace std;
int main(){
long long n,k;
cin >> n >> k;
long long c[MAX] = {0};
for(int i = 0;i < n;i++){
long long a,b;
cin >> a >> b;
c[a] += b;
}
for(int ans = 0;ans < MAX;i++){
if(k <= c[ans]){
cout <<... | a.cc: In function 'int main()':
a.cc:15:31: error: 'i' was not declared in this scope
15 | for(int ans = 0;ans < MAX;i++){
| ^
|
s478968197 | p03721 | C++ | #include<iostream>
#define MAX 100010
using namespace std;
int main(){
int n,k;
cin >> n >> k;
int c[MAX] = {0};
for(int i = 0;i < n;i++){
int a,b;
cin >> a >> b;
c[a] += b;
}
for(int ans = 0;ans < MAX;i++){
if(k <= c[ans]){
cout << ans << endl;
... | a.cc: In function 'int main()':
a.cc:15:31: error: 'i' was not declared in this scope
15 | for(int ans = 0;ans < MAX;i++){
| ^
|
s822942387 | p03721 | C++ | #include<bits/stdc++.h>
#define MAX 100010
using namespace std;
int main(){
int n,k;
cin >> n >> k;
int c[MAX] = {0};
for(int i = 0;i < n;i++){
int a,b;
cin >> a >> b;
c[a] += b;
}
for(int ans = 0;ans < k;i++){
if(k <= c[ans]){
cout << ans << endl;
... | a.cc: In function 'int main()':
a.cc:15:29: error: 'i' was not declared in this scope
15 | for(int ans = 0;ans < k;i++){
| ^
|
s082927475 | p03721 | C++ | #include<iostream>
#define MAX 100010
using namespace std;
int main(){
int n,k;
cin >> n >> k;
int c[MAX] = {0};
for(int i = 0;i < n;i++){
int a,b;
cin >> a >> b;
c[a] += b;
}
for(int ans = 0;ans < k;i++){
if(k <= c[ans]){
cout << ans << endl;
... | a.cc: In function 'int main()':
a.cc:15:29: error: 'i' was not declared in this scope
15 | for(int ans = 0;ans < k;i++){
| ^
|
s619263899 | p03721 | C++ | #include<iostream>
#include<vector>
#include<utility>
using namespace std;
int main(){
int n,k;
cin >> n >> k;
vector < pair <int, int> > p(n);
for(int i = 0;i < n;i++){
int a,b;
cin >> a >> b;
p.at(i) = make_pair(a, b);
}
sort(p.begin(), p.end());
int count = 0;
... | a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'short'?
16 | sort(p.begin(), p.end());
| ^~~~
| short
|
s990559766 | p03721 | C | #include<stdio.h>
int main(){
int n;
long long int k;
scanf("%d%lld",&n,&k);
long long int num[100001] = {0};
for(int i = 1; i < =n; i++){
int a,b;
scanf("%d%d",&a,&b);
num[a] += b;
}
for(int i = 1; i <= 100000; ++i){
k = k-num[i];
if( k <= 0 ){
printf("%d",i);
return ... | main.c: In function 'main':
main.c:9:22: error: expected expression before '=' token
9 | for(int i = 1; i < =n; i++){
| ^
main.c:11:19: error: 'a' undeclared (first use in this function)
11 | scanf("%d%d",&a,&b);
| ^
main.c:11:19: note: each undeclared ide... |
s393519606 | p03721 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end() //昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y)... | a.cc: In function 'int main()':
a.cc:65:19: error: expected primary-expression before ')' token
65 | rep2(i,1,100001)){
| ^
|
s592263667 | p03721 | C++ | #include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end() //昇順
#define RALL(x) (x).rbegin(), (x).rend() // 降順
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y)... | a.cc:65:14: error: macro "rep" passed 3 arguments, but takes just 2
65 | rep(i,1,n+1){
| ^
a.cc:3:9: note: macro "rep" defined here
3 | #define rep(i, n) for (int i = 0; i < n; i++)
| ^~~
a.cc: In function 'int main()':
a.cc:65:3: error: 'rep' was not declared in this scope
... |
s589406800 | p03721 | C++ | // include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
// func
// ------------------------------------------------
int CalcSumOfDigit(int n); // 各桁の和を計算する。
int getDigit(int n); // 数字の桁数を取得する。
string upper(string str); // 英字を... | a.cc: In function 'int main()':
a.cc:72:17: error: 'comp' was not declared in this scope
72 | sort(all(h),comp);
| ^~~~
|
s973800288 | p03721 | C++ | int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n , k;
cin >> n >> k;
long long arr[100001] = {};
for (int i = 0 ; i < n ; i++){
int num , qty;
cin >> num >> qty;
arr[num] += qty;
}
long long count = 0;
for (int i = 1 ; i < 100001 ; i++ ){
cou... | a.cc: In function 'int main()':
a.cc:2:5: error: 'ios' has not been declared
2 | ios::sync_with_stdio(false);
| ^~~
a.cc:3:5: error: 'cin' was not declared in this scope
3 | cin.tie(0);
| ^~~
a.cc:16:10: error: 'cout' was not declared in this scope; did you mean 'count'?
16 | ... |
s596677124 | p03721 | C | #include<stdio.h>
#include<stdlib.h>
long max(long a, long b){
if(a > b) return a;
else return b;
}
long min(long a, long b){
if(a < b) return a;
else return b;
}
int sort(const void *a, const void *b){
return *(int*)a -*(int*)b;
}
int main(){
int n,k;
scanf("%d%d",&n,&k);
int num[100000] = {0};
... | main.c:32:7: warning: built-in function 'index' declared as non-function [-Wbuiltin-declaration-mismatch]
32 | int index = 0;
| ^~~~~
main.c:33:3: error: expected identifier or '(' before 'for'
33 | for(int i = 0; i < 100000; ++i){
| ^~~
main.c:33:20: error: expected '=', ',', ';', 'asm' o... |
s838024422 | p03721 | C | 10 500000
1 100000
1 100000
1 100000
1 100000
1 100000
100000 100000
100000 100000
100000 100000
100000 100000
100000 100000 | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 10 500000
| ^~
|
s103195204 | p03721 | C++ | #include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstd... | a.cc: In function 'int main()':
a.cc:42:32: error: expected '}' at end of input
42 | cout << a[ans] << endl;
| ^
a.cc:24:12: note: to match this '{'
24 | int main() {
| ^
|
s250306401 | p03721 | C++ | nclude <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio... | a.cc:1:1: error: 'nclude' does not name a type
1 | nclude <iostream> // cout, endl, cin
| ^~~~~~
In file included from /usr/include/c++/14/bits/char_traits.h:42,
from /usr/include/c++/14/string:42,
from a.cc:2:
/usr/include/c++/14/bits/postypes.h:68:11: error: 'ptrdiff_t' doe... |
s968023917 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,N) for(int i = 0; i < (N); i++)
template<class T> inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a, T b) {
if (a < b) {
a = ... | a.cc: In function 'int main()':
a.cc:37:37: error: 'i' was not declared in this scope
37 | for (int ans = 1; ans < 100050; i++){
| ^
|
s918319641 | p03721 | C++ | #include <bits/stdc++.h>
using ll = long long;
const int AMAX = 100000;
ll cnt[AMAX + 1];
int main(void) {
int N;
ll K;
cin >> N >> K;
for (int i = 0; i < N; ++i) {
int A, B;
cin >> A >> B;
cnt[A] += B;
}
for (int ans = 1; ans <= AMAX; ++ans){
if (K <= cnt[ans]) {
cout << ans << ... | a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> N >> K;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: ... |
s166117165 | p03721 | C++ | #include <bits/stdc++.h>
using ll = long long;
const int AMAX = 100000;
ll cnt[AMAX + 1];
int main(void) {
int N;
ll K;
cin >> N >> K;
for (int i = 0; i < N; ++i) {
int A, B;
cin >> A >> B;
cnt[A] += B;
}
for (int ans = 1; ans <= AMAX; ++ans){
if (K <= cnt[ans]) {
cout << ans << ... | a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
9 | cin >> N >> K;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: ... |
s358186421 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
long long gcd(long x,long y){
if(y==0)return x;
return gcd(y,x%y);
}
long long lcm(long x,long y){
return x*y/gcd(x,y);
}
long long ctoi(char c) {
if (c >= '0' && c <= '9') {
return c - '0';
}
return 0;
}
long long main()
{
long long K,N,a,b;
m... | cc1plus: error: '::main' must return 'int'
|
s942907147 | p03721 | C++ | include<bits/stdc++.h>
using namespace std;
int main(){
vector<int> vec(100000,0);
int N, K;
cin >> N >> K;
for(int i = 0; i < N; i++){
int a,b;
cin >> a >> b;
vec[a] += b;
}
for(int i = 0; true; i++){
K -= vec[i];
if(K <= 0){
cout << i << endl;
return 0;
}
}
}
... | a.cc:1:1: error: 'include' does not name a type
1 | include<bits/stdc++.h>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
5 | vector<int> vec(100000,0);
| ^~~~~~
a.cc:5:10: error: expected primary-expression before 'int'
5 | vector<int> v... |
s570591090 | p03721 | C++ | #include<iostream>
#include<numeric>
#include<set>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long li;
#define chmin(a,b) (a>(b)?a=(b),1:0)
#define abs(n) max((n),-(n))
#define dist(a,b) max((a)-(b),(b)-(a))
#define chmax(a,b) (a<(b)?a=(b),1:0)
#define repa(i,a,n) for(int i=(a)... | a.cc: In function 'int main()':
a.cc:38:24: error: 'f' was not declared in this scope
38 | v.push_back({a,b});f
| ^
|
s447476128 | p03721 | C++ | #include <iostream>
#include <vector>
#include <utility>
#include<algorithm>
using namespace std;
#define MAX 100000
int solve(int N,int K, int a[],int b[])
{
vector<pair<int, int>> ab;
for (int i = 0; i < N; ++i)
{
pair<int, int> temp;
temp.first = a[i];
temp.second = b[i];
ab.push_back(temp);
}
sort(a... | a.cc: In function 'int solve(int, int, int*, int*)':
a.cc:26:24: error: expected primary-expression before 'unsigned'
26 | sum += unsigned long long(itr->second);
| ^~~~~~~~
|
s787494319 | p03721 | C++ | #include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<((ll)n))
#define SHIFT_LEFT(n) (1LL<<((ll)n))
#define SUBS(s,f,t) ((s).su... | a.cc: In function 'int main()':
a.cc:28:18: error: 'class std::priority_queue<std::pair<long long int, long long int>, std::vector<std::pair<long long int, long long int> >, std::greater<void> >' has no member named 'front'
28 | ll num = que.front().F;
| ^~~~~
a.cc:29:18: error: 'class std... |
s520869948 | p03721 | C++ |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
long long k;
cin >> n >> k;
vector<pair<int, int>> ans(n);
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
ans.at(i).first = a;
ans.at(i).second = b;
}
sort(ans.begin(), ans.end());
long long k = 0;
for (int i ... | a.cc: In function 'int main()':
a.cc:17:14: error: redeclaration of 'long long int k'
17 | long long k = 0;
| ^
a.cc:7:13: note: 'long long int k' previously declared here
7 | long long k;
| ^
a.cc:19:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
... |
s538457349 | p03721 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
int main(){
int N,K;
cin >> N >> K;
set<int> A;
map<int, int> AtoB;
rep(i, N){
int a, b;
cin >> a >> b;
A.insert(a);
AtoB[a] += b;
}
sort(A.begin(),A.end());
int ans;
for(int i: A){
... | In file included from /usr/include/c++/14/algorithm:61,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterato... |
s406401101 | p03721 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
//桁数を求める
int main(){
int N,K;
cin >> N >> K;
set<int> A;
map<int, int> AtoB;
rep(i, N){
int a, b;
cin >> a >> b;
A.insert(a);
AtoB[a] += b;
}
sort(A.begin(),A.end());
for(int i: A){
... | a.cc: In function 'int main()':
a.cc:24:16: error: expected ';' before 'int'
24 | K -= AtoB[i]
| ^
| ;
25 | int ans = i;
| ~~~
a.cc:31:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
31 | cout << ans << endl;
| ... |
s267570397 | p03721 | C++ | #include<bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
//桁数を求める
int main(){
int N,K;
cin >> N >> K;
set<int> A;
map<int, int> AtoB;
rep(i, N){
int a, b;
cin >> a >> b;
set.insert(a);
map[a] += b;
}
sort(A.begin(),A.end());
for(int i: A){
... | a.cc: In function 'int main()':
a.cc:16:8: error: expected unqualified-id before '.' token
16 | set.insert(a);
| ^
a.cc:17:9: error: conflicting declaration 'auto a'
17 | map[a] += b;
| ^
a.cc:14:9: note: previous declaration as 'int a'
14 | int a, b;
| ^
a.... |
s181642106 | p03721 | C++ |
cout<<ans<<en | a.cc:3:5: error: 'cout' does not name a type
3 | cout<<ans<<en
| ^~~~
|
s320348201 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
vector <pair<int, int> > vec;
int main(){
int n, k;
scanf("%d%d", &n, &k);
for(int i = 0; i < n; i++) {
int a, b;
scanf("%d%d", &a, &b);
vec.push_back(make_pair(a, b));
}
sort(vec.begin(), vec.end());
for(int i = 0; i < n; i++) {
k -= a[i].second;
if(k <= ... | a.cc: In function 'int main()':
a.cc:16:22: error: 'a' was not declared in this scope
16 | k -= a[i].second;
| ^
|
s786198059 | p03721 | C++ | #include <bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1000000007;
const double PI=3.14159265358979;
const ll INF= pow(10,18);
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
string abc="abcdefghijklmnopqrst... | a.cc: In function 'int main()':
a.cc:26:13: error: 'i' was not declared in this scope
26 | cnt +=p[i].second;
| ^
|
s484659125 | p03721 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
//#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) ... | a.cc:33:13: error: '::main' must return 'int'
33 | #define int ll
| ^~
a.cc:34:1: note: in expansion of macro 'int'
34 | int main() {
| ^~~
|
s680373725 | p03721 | C++ | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <numeric>
#include <iomanip>
#include <map>
#include <set>
#include <deque>
#include <utility>
//#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) ... | a.cc:33:13: error: '::main' must return 'int'
33 | #define int ll
| ^~
a.cc:34:1: note: in expansion of macro 'int'
34 | int main() {
| ^~~
|
s743842155 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N;
int64_t K;
cin>>N>>K;
map<int,int64_t>M;
for(int i=0;i<N;i++){
int a,
int64_t b;
if(M.count(a))
M.at(a)+=b;
else
M[a]=b;
}int ans;
int64_t sum=0;
for(auto p:M){
auto k=p.first;
auto v=p.second;
sum+=v;
... | a.cc: In function 'int main()':
a.cc:10:13: error: expected initializer before 'b'
10 | int64_t b;
| ^
a.cc:12:16: error: 'b' was not declared in this scope
12 | M.at(a)+=b;
| ^
a.cc:14:12: error: 'b' was not declared in this scope
14 | M[a]=b;
| ... |
s812268982 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
vector<pair<int,int>>M;
for(int i=0;i<N;i++){
int a,b;
cin>>a>>b;
pair<int,int>c=(b,a);
M.push_back(c);
}int ans;
int sum=0;
for(int i=0; ;i++){
sum+=M.at(i).first;
if(K<=sum){
ans=M.at(i).second; break;
... | a.cc: In function 'int main()':
a.cc:10:22: error: conversion from 'int' to non-scalar type 'std::pair<int, int>' requested
10 | pair<int,int>c=(b,a);
| ^
|
s060351334 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
vector<pair<int,int>>M={};
for(int i=0;i<N;i++){
int a,b;
cin>>a>>b;
c=make_pair(b,a);
M.push_back(c);
}int ans;
int sum=0;
for(int i=0; ;i++){
sum+=M.at(i).first;
if(K<=sum){
ans=M.at(i).second; break;
}... | a.cc: In function 'int main()':
a.cc:10:4: error: 'c' was not declared in this scope
10 | c=make_pair(b,a);
| ^
|
s153232108 | p03721 | C++ | #include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
vector<pair<int,int>>M={};
for(int i=0;i<N;i++){
int a,b;
cin>>a>>b;
c=make_pair(b,a);
M.push_back(c);
}int ans;
int sum=0;
for(int i=0; ;i++){
sum+=A.at(i).first;
if(K<=sum){
ans=A.at(i).second; break;
}... | a.cc: In function 'int main()':
a.cc:10:4: error: 'c' was not declared in this scope
10 | c=make_pair(b,a);
| ^
a.cc:15:8: error: 'A' was not declared in this scope
15 | sum+=A.at(i).first;
| ^
|
s814460231 | p03721 | C++ | #include<bits/stdc++h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
map<int,int>M;
for(int i=0;i<N;i++){
int a,b;
cin>>a>>b;
if(M.count(a))
M.at(a)+=b;
else
M[a]=b;
}int ans;
int sum=0;
for(auto p:M){
auto k=p.first;
auto v=p.second;
sum+=v;
if(K<=sum){
ans=... | a.cc:1:9: fatal error: bits/stdc++h: No such file or directory
1 | #include<bits/stdc++h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s974544754 | p03721 | C++ | #include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
return vector<decltype(make_vec<T>(ts.... | a.cc: In function 'int main()':
a.cc:2:27: error: expected primary-expression before ')' token
2 | #define ALL(obj) begin(obj), end(obj)
| ^
a.cc:45:10: note: in expansion of macro 'ALL'
45 | sort(ALL(P));
| ^~~
a.cc:2:37: error: expected primary-expression befo... |
s342491343 | p03721 | Java | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int count = 0;
int ans = 0;
int [] in = new int [100000];
int a,b;
for(int i=0;i<n;i++){a = sc.nextInt();... | Main.java:15: error: variable a might not have been initialized
for(int i=0;i<a;i++){count+=in[i];
^
1 error
|
s741893755 | p03721 | C | import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int k = sc.nextInt();
int count = 0;
int ans = 0;
int [] in = new int [100000];
int a,b;
for(int i=0;i<n;i++){a = sc.nextInt();... | main.c:1:1: error: unknown type name 'import'
1 | import java.util.*;
| ^~~~~~
main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
1 | import java.util.*;
| ^
main.c:2:1: error: unknown type name 'public'
2 | public class Main {
| ^~~~~~
main.c:... |
s818559949 | p03721 | C++ | #include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)... | a.cc: In function 'int main()':
a.cc:24:9: error: reference to 'list' is ambiguous
24 | list[a]+=b;
| ^~~~
In file included from /usr/include/c++/14/list:65,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
from a.cc:1:
/usr/include/c++/14/bits/stl_... |
s405921436 | p03721 | C++ | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N; long long K;
cin >> N >> K;
vector<pair<long long, long long> > v(N);
for (int i = 0; i < N; ++i) cin >> v[i].first >> v[i].second;
// ソート
sort(v.begin(), v.end());
// a_i が小さい順に b_i を合... | a.cc: In function 'int main()':
a.cc:25:16: error: expected ';' at end of input
25 | cout << res
| ^
| ;
a.cc:25:16: error: expected '}' at end of input
a.cc:6:12: note: to match this '{'
6 | int main() {
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.