submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s605148407 | p02264 | C++ | #include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)
void *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
void *enQ(struct proc *data){
int newEnd;
newEnd = (eoq+1)%QSIZE;
Q[eoq] = data;
eoq = newEnd;
}
void *deQ(){
int oldSt;
if(soq==eoq){
return NULL;
}
oldS... | a.cc: In function 'void* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
30 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc... |
s429848692 | p02264 | C++ | #include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)
void *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
void *enQ(void *data){
int newEnd;
newEnd = (eoq+1)%QSIZE;
Q[eoq] = data;
eoq = newEnd;
}
void *deQ(){
int oldSt;
if(soq==eoq){
return NULL;
}
oldSt = soq... | a.cc: In function 'void* enQ(void*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
30 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc... |
s110502533 | p02264 | C++ | #include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)
void *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
struct proc *enQ(struct proc *data){
int newEnd;
newEnd = (eoq+1)%QSIZE;
Q[eoq] = data;
eoq = newEnd;
}
struct proc *deQ(){
int oldSt;
if(soq==eoq){
return NU... | a.cc: In function 'proc* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: In function 'proc* deQ()':
a.cc:27:17: error: invalid conversion from 'void*' to 'proc*' [-fpermissive]
27 | return Q[oldSt];
| ~~~~~~~^
| ... |
s997295031 | p02264 | C++ | #include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)
struct proc *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
struct proc *enQ(struct proc *data){
int newEnd;
newEnd = (eoq+1)%QSIZE;
Q[eoq] = data;
eoq = newEnd;
}
struct proc *deQ(){
int oldSt;
if(soq==eoq){
re... | a.cc: In function 'proc* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
30 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc... |
s615120828 | p02264 | C++ | #include <stdio.h>
#include <stdlib.h>
#define QSIZE (100000)
struct proc *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
struct proc *enQ(struct proc *data){
int newEnd;
newEnd = (eoq+1)%QSIZE;
Q[eoq] = data;
eoq = newEnd;
}
struct proc *deQ(){
int oldSt;
if(soq==eoq){
re... | a.cc: In function 'proc* enQ(proc*)':
a.cc:18:1: warning: no return statement in function returning non-void [-Wreturn-type]
18 | }
| ^
a.cc: At global scope:
a.cc:30:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
30 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc... |
s150887974 | p02264 | C++ | #include <stdio.h>
#define QSIZE (100000)
struct proc *Q[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int time;
};
struct proc *enQ(struct proc *data){
Q[eoq] = data;
eoq = (eoq+1)%QSIZE;
return data
}
struct proc *deQ(){
int oldSt;
if(soq==eoq){
return NULL;
}
oldSt = soq;
soq = (so... | a.cc: In function 'proc* enQ(proc*)':
a.cc:15:14: error: expected ';' before '}' token
15 | return data
| ^
| ;
16 | }
| ~
a.cc: At global scope:
a.cc:28:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
28 | main(){
... |
s977295429 | p02264 | C++ | #include<stdio.h>
#include<stdlib.h>
#define QSIZE (100000)
struct proc *Qu[QSIZE];
int soq=0,eoq=0;
struct proc{
char name[11];
int ti;
};
struct proc *enQ(struct proc *data){
Qu[eoq] = data;
eoq = (eoq+1)%QSIZE;
return data;
}
struct proc *deQ(){
int oldSt;
if(soq==eoq){
return NULL;
}
oldSt... | a.cc: In function 'int main()':
a.cc:36:18: error: invalid conversion from 'void*' to 'proc*' [-fpermissive]
36 | data = malloc(sizeof(struct proc));
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~
| |
| void*
|
s599106568 | p02264 | C++ | #include<iostream>
#include<queue>
using namespace std;
struct process { char name[10]; int time; };
int main () {
int n, q;
cin >> n >> q;
queue<process> TQ;
//input
for(int i = 0; i < n; i++) {
process qu;
cin >> qu.name >> qu.time;
TQ.push(qu);
}
//process -> output
int sum = 0;
while ( !TQ.empty() ) ... | a.cc: In function 'int main()':
a.cc:18:17: error: 'qu' was not declared in this scope; did you mean 'q'?
18 | qu = TQ.front();
| ^~
| q
|
s802378478 | p02264 | C++ | #include<iotream>
#include<queue>
#include<string>
using namespace std;
int main(){
int n, q;
cin >> n >> q;
queue< pair<string,int> > que;
string name;
int time;
for(int i = 0; i < n; i++){
cin >> name >> time;
que.push(make_pair<string,int>(name,time));
}
int cnt = 0;
while(!que.empt... | a.cc:1:9: fatal error: iotream: No such file or directory
1 | #include<iotream>
| ^~~~~~~~~
compilation terminated.
|
s917313901 | p02264 | C++ | #include<iostream>
#include<queue>
#include<string>
using namespace std;
int main(){
int n, q;
cin >> n >> q;
queue< pair<string,int> > que;
string name;
int time;
for(int i = 0; i < n; i++){
cin >> name >> time;
que.push(make_pair<string,int>(name,time));
}
int cnt = 0;
while(!que.emp... | a.cc: In function 'int main()':
a.cc:15:36: error: cannot bind rvalue reference of type 'std::__cxx11::basic_string<char>&&' to lvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
15 | que.push(make_pair<string,int>(name,time));
| ^~~~
In file included f... |
s574919126 | p02264 | C++ | #include<iostream>
#include<queue>
#include<string>
using namespace std;
int main(){
int n, q;
cin >> n >> q;
queue< pair<string,int> > que;
string name;
int time;
for(int i = 0; i < n; i++){
cin >> name >> time;
que.push(make_pair<string,int>(name,time));
}
int cnt = 0;
while(!que.emp... | a.cc: In function 'int main()':
a.cc:15:36: error: cannot bind rvalue reference of type 'std::__cxx11::basic_string<char>&&' to lvalue of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
15 | que.push(make_pair<string,int>(name,time));
| ^~~~
In file included f... |
s519716705 | p02264 | C++ | include <iostream>
#include <string>
#include <algorithm>
#define LEN 100000
using namespace std;
class Pro{
public:
string name;
int time;
};
class Que{
Pro p[LEN];
public:
int head=0, tail=0, n;
void enqueue(Pro x){
p[tail] = x;
tail = (tail + 1) % LEN;
}
Pro dequeue(){
Pro x = p[head];
head = (hea... | a.cc:1:1: error: 'include' does not name a type
1 | include <iostream>
| ^~~~~~~
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' does not name a typ... |
s474311857 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define LEN 100005;
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int... | a.cc:8:19: error: expected ']' before ';' token
8 | #define LEN 100005;
| ^
a.cc:15:5: note: in expansion of macro 'LEN'
15 | P Q[LEN];
| ^~~
a.cc:15:8: error: expected unqualified-id before ']' token
15 | P Q[LEN];
| ^
a.cc: In function 'void enqueue(P)':
a.cc:1... |
s951206097 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int ... | a.cc: In function 'void enqueue(P)':
a.cc:18:3: error: 'tail' was not declared in this scope; did you mean 'tanl'?
18 | Q[tail]=x;
| ^~~~
| tanl
a.cc: In function 'P dequeue()':
a.cc:23:7: error: 'head' was not declared in this scope
23 | P x=Q[head];
| ^~~~
a.cc: In function 'int main... |
s196119238 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
int head,tail,n;
P Q[LEN];
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
r... | a.cc: In function 'int main()':
a.cc:38:18: error: 'P' {aka 'struct pp'} has no member named 'q'
38 | scanf("%d",&Q[i].q);
| ^
a.cc:47:33: error: expected ';' before '}' token
47 | printf("%s %d\n",u.name,elaps)
| ^
| ... |
s072020623 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
int head,tail,n;
P Q[LEN];
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
r... | a.cc: In function 'int main()':
a.cc:47:33: error: expected ';' before '}' token
47 | printf("%s %d\n",u.name,elaps)
| ^
| ;
48 |
49 | }
| ~
a.cc:51:2: error: expected '}' at end of input
5... |
s466953879 | p02264 | C++ | #include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
S.push(name);
Q.push(time... | a.cc: In function 'int main()':
a.cc:19:13: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
19 | while(S.top() != void){
| ^~~
| pop
a.cc:19:22: error: expected primary-expression before 'void'
19 | while(S.top... |
s406582842 | p02264 | C++ | //????£???????10?????????????????°
#include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
... | a.cc: In function 'int main()':
a.cc:20:13: error: 'class std::queue<std::__cxx11::basic_string<char> >' has no member named 'top'; did you mean 'pop'?
20 | while(S.top()){
| ^~~
| pop
a.cc:21:14: error: 'class std::queue<int>' has no member named 'top'; did you mean 'pop'?
... |
s664947950 | p02264 | C++ | #include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
S.push(name);
Q.push(time... | a.cc: In function 'int main()':
a.cc:19:18: error: could not convert 'S.std::queue<std::__cxx11::basic_string<char> >::front()' from '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} to 'bool'
19 | ... |
s238731100 | p02264 | C++ |
#include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
S.push(name);
Q.push(tim... | a.cc: In function 'int main()':
a.cc:20:24: error: expected primary-expression before 'void'
20 | while(S.front() != void){
| ^~~~
a.cc:20:23: error: expected ')' before 'void'
20 | while(S.front() != void){
| ~ ^~~~~
| )
a... |
s264899767 | p02264 | C++ |
#include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
S.push(name);
Q.push(tim... | a.cc: In function 'int main()':
a.cc:20:21: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::value_type' {aka 'std::__cxx11::basic_string<char>'} and 'long int')
20 | while(S.front() != NULL){
... |
s666346458 | p02264 | C++ |
#include <string>
#include <queue>
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
int n,q;
cin >> n >> q;
queue<string> S;
queue<int> Q;
for(int i = 0; i < n; i++){
string name;
int time;
cin >> name >> time;
S.push(name);
Q.push(tim... | a.cc:20:24: error: stray '\' in program
20 | while(S.front() != \0){
| ^
a.cc: In function 'int main()':
a.cc:20:21: error: no match for 'operator!=' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::__cxx11::basic_string<char> >, std::__cxx11::basic_string<char> >::v... |
s837516333 | p02264 | C++ | #include <iostream>
#include <queue>
#include <string>
using namespace std;
int main(void){
queue<pair<string,int>> a;
int n,q,t,c=0;
string name;
cin>>n>>q;
for(int i=0;i<n;i++){
cin>>name>>t;
a.enqueue(make_pair(name,t));
}
while(!a.empty()){
pair<string,int> p=a.front();
a.dequeue();
... | a.cc: In function 'int main()':
a.cc:12:7: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'enqueue'; did you mean 'queue'?
12 | a.enqueue(make_pair(name,t));
| ^~~~~~~
| queue
a.cc:16:7: error: 'class std::queue<std::pair<std::__cxx11::bas... |
s990483833 | p02264 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<queue>
#include<utility>
using namespace std;
#define maxn 100005
typedef pair<string,int> P;
int n,t;
string name;
int cost;
queue<P> q;
queue<P> ans;
int time=0;
void Solve()
{
while(!q.empty())
{
P p=q.front();
P pp;
if(p.... | a.cc:14:5: error: 'int time' redeclared as different kind of entity
14 | int time=0;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s880499343 | p02264 | C++ | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<queue>
#include<utility>
using namespace std;
#define maxn 100005
typedef pair<string,int> P;
int n,t;
string name;
int cost;
queue<P> q;
queue<P> ans;
int Time;
void Solve()
{
while(!q.empty())
{
P p=q.front();
P pp;
if(p.se... | a.cc: In function 'void Solve()':
a.cc:32:21: error: no matching function for call to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::push(std::pair<std::__cxx11::basic_string<char>, long int (*)(long int*) noexcept>)'
32 | ans.push(make_pair(p.first,time));
| ~~~~~~~~^~... |
s154072704 | p02264 | C++ | class Process1
@name
@time
@endtime
def initialize(name, time)
@name = name
@time = time
end
end
def main
line1 = STDIN.gets.chomp.split(" ")
n = line1[0]
q = line1[1]
queue = Array.new(n)
n.times do |i|
line = STDIN.gets.chomp.split(" ")
process = Process1.new(line[0], line[1])
... | a.cc:2:3: error: stray '@' in program
2 | @name
| ^
a.cc:3:3: error: stray '@' in program
3 | @time
| ^
a.cc:4:3: error: stray '@' in program
4 | @endtime
| ^
a.cc:7:5: error: stray '@' in program
7 | @name = name
| ^
a.cc:8:5: error: stray '@' in program
... |
s677841386 | p02264 | C++ | #define _CRT_SECURE_NO_WARNINGS
#include <bits\stdc++.h>
using namespace std;
int main()
{
map<string, int> m;
queue<pair<string, int>> Q;
int n, q;
int consumed_time = 0;
scanf("%d %d", &n, &q);
for (int i = 0; i < n; i++)
{
string s;
int t;
cin >> s >> t;
m.insert(make_pair(s,t));
Q.push(make_pair(... | a.cc:2:10: fatal error: bits\stdc++.h: No such file or directory
2 | #include <bits\stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s378331474 | p02264 | C++ | #include <iostream>
#include <math.h>
#include <sstream>
#include <vector>
using namespace std;
struct wait_que {
string name;
int time;
int cmp_flg;
};
void completeProcess(int size, int q);
static vector<struct wait_que> wqs;
int main()
{
string str;
getline(cin, str);
// get number
int cnt = 0;
int num[2]... | a.cc: In function 'int main()':
a.cc:33:13: error: redeclaration of 'int cnt'
33 | int cnt = num[0];
| ^~~
a.cc:21:13: note: 'int cnt' previously declared here
21 | int cnt = 0;
| ^~~
a.cc:57:35: error: 'q' was not declared in this scope
57 | ... |
s851972259 | p02264 | C++ | #include <iostream>
#include <math.h>
#include <sstream>
#include <vector>
using namespace std;
struct wait_que {
string name;
int time;
int cmp_flg;
};
void completeProcess(int size, int q);
static vector<struct wait_que> wqs;
int main()
{
string str;
getline(cin, str);
// get number
int cnt = 0;
int num[2]... | a.cc: In function 'int main()':
a.cc:57:35: error: 'q' was not declared in this scope
57 | if ((*tmp).time - q > 0) {
| ^
|
s627640487 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}
p;
p q[LEN];
int h,t,n;
void enqueue(p x){
q[t]=x;
t=(t+1)%LEN;
}
p dnqueue(){
p x=q[h];
h=(h+1)%LEN;
return x;
}
int min(int a,int b){return a<b ? a:b;}
int main()
{
int elaps=0,c;
int i,q;
p u;
scanf... | a.cc: In function 'int main()':
a.cc:31:21: error: invalid types 'int[int]' for array subscript
31 | scanf("%s",q[i].name);
| ^
a.cc:32:22: error: invalid types 'int[int]' for array subscript
32 | scanf("%d",&q[i].t);
| ^
|
s229835361 | p02264 | C++ | #include<stdio.h>
#include<math.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
char name[10];
int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
P[tail] = x;//?°?x?????\??°????°?
tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´??????... | a.cc: In function 'int main()':
a.cc:39:25: error: 'min' was not declared in this scope; did you mean 'std::min'?
39 | int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
| ^~~
| std::min
In file included from /us... |
s568169073 | p02264 | C++ | #include<stdio.h>
#include<stdlib.h>
const int LEN = 100000;//??????????????§??????
struct pp
{
char name[10];
int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
P[tail] = x;//?°?x?????\??°????°?
tail = tail + 1;//??¨?????????????????????????????????head=(tail + 1) % LEN??¶??´????... | a.cc: In function 'int main()':
a.cc:39:25: error: 'min' was not declared in this scope; did you mean 'main'?
39 | int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
| ^~~
| main
|
s991616879 | p02264 | C++ | #include<stdio.h>
#include<stdlib.h>
using namespace std;
const int LEN = 100000;//??????????????§??????
struct pp
{
char name[10];
int time;
} ;
pp P[LEN];
int head, tail, n;
void enqueue(struct pp x)//??\????????°
{
P[tail] = x;//?°?x?????\??°????°?
tail = tail + 1;//??¨?????????????????????????????????head=(tail... | a.cc: In function 'int main()':
a.cc:40:25: error: 'min' was not declared in this scope; did you mean 'main'?
40 | int c = min(q, u.time);//????????¶??´????????§?°??????\????????????????????¶??´
| ^~~
| main
|
s805567995 | p02264 | C++ | #include <algorithm>
#include <iostream>
using namespace std;
static const int MAX = 100001;
struct task {
char name[10];
int time;
};
struct task que[MAX];
int head = 0;
int tail = 0;
int increment(int p) { return (p + 1) % MAX; }
void enqueue(struct task t) {
que[tail] = t;
tail = increment(tail);
}
stru... | a.cc: In function 'int main()':
a.cc:54:4: error: expected '}' at end of input
54 | }
| ^
a.cc:30:12: note: to match this '{'
30 | int main() {
| ^
|
s211567173 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
int time;
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
void dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
... | a.cc:6:5: error: 'int time' redeclared as different kind of entity
6 | int time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
... |
s662187477 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n,time;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
void dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int ... | a.cc:13:19: error: 'int time' redeclared as different kind of entity
13 | int head, tail, n,time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/... |
s579896142 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n,time;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
void dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int ... | a.cc:13:19: error: 'int time' redeclared as different kind of entity
13 | int head, tail, n,time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/... |
s206387376 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n,total;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
void dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int... | a.cc: In function 'void dequeue()':
a.cc:23:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
23 | return x;
| ^
a.cc: In function 'int main()':
a.cc:42:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
42 | scnaf("%d",... |
s403203077 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n,total;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
P dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int ro... | a.cc: In function 'int main()':
a.cc:42:9: error: 'scnaf' was not declared in this scope; did you mean 'scanf'?
42 | scnaf("%d", &n);
| ^~~~~
| scanf
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
50 | u = decueue();
|... |
s231794495 | p02264 | C++ | #include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, tail, n,total;
void enqueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
P dequeue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int ro... | a.cc: In function 'int main()':
a.cc:50:21: error: 'decueue' was not declared in this scope; did you mean 'dequeue'?
50 | u = decueue();
| ^~~~~~~
| dequeue
|
s285099480 | p02264 | C++ | #include<stdio.h>
#include<algorithm>
#include<iostream>
using namespace std;
#define LEN 100005
struct typedef pp{
char name[100];
int t;
}P;
P Q[LEN];
int head, n, tail, total;
void encueue(P x){
Q[tail] = x;
tail = (tail + 1) % LEN;
}
P decueue(){
P x = Q[head];
head = (head + 1) % LEN;
return x;
}
int r... | a.cc:7:8: error: expected identifier before 'typedef'
7 | struct typedef pp{
| ^~~~~~~
a.cc:7:16: error: typedef 'pp' is initialized (use 'decltype' instead)
7 | struct typedef pp{
| ^~
a.cc:8:9: error: expected primary-expression before 'char'
8 | char name[100];
... |
s335736643 | p02264 | C++ | #include<stdio.h>
#define T 50000
int main(){
int n,q,time[T],i=0,k,alltime=0,flag=0;
char name[100000][10];
scanf("%d %d",&n,&q);
for(i=0;i<n;i++){
scanf("%s%d",name[i],&time[i]);
}
while(){
if(time[i]<=q && time[i]>=0){
printf("%s %d\n",name[i], alltime+time[i]);
allt... | a.cc: In function 'int main()':
a.cc:14:9: error: expected primary-expression before ')' token
14 | while(){
| ^
|
s557805086 | p02264 | C++ | #include "stdafx.h"
#include<iostream>
#include<string>
#include<queue>
#include<algorithm>
using namespace std;
struct Data {
int n;
string name;
};
int main() {
int N;
int timeStep;
int time = 0;
queue<Data> datas;
queue<Data> ends;
cin >> N;
cin >> timeStep;
for (int i = 0; i < N; i++) {
Data buf;
... | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s152931972 | p02264 | C++ | #include<iostream>
using namespace std;
#include<algorithm>
#include<string.h>
int MAX = 100000;
int Q[MAX], head, tail;
struct Proc {string name; int t;};
void enqueue(Proc x) {
Q[tail] = x;
tail = (tail + 1) % MAX;
}
Proc dequeue() {
Proc x = Q[head];
head = (head + 1) % MAX;
}
in... | a.cc:7:7: error: size of array 'Q' is not an integral constant-expression
7 | int Q[MAX], head, tail;
| ^~~
a.cc: In function 'void enqueue(Proc)':
a.cc:12:19: error: cannot convert 'Proc' to 'int' in assignment
12 | Q[tail] = x;
| ^
| |
|... |
s515312231 | p02264 | C++ | #include<iostream>
using namespace std;
#include<algorithm>
#include<string.h>
int Q[100000], head, tail;
struct Proc {string name; int t;};
void enqueue(Proc x) {
Q[tail] = x;
tail = (tail + 1) % MAX;
}
Proc dequeue() {
Proc x = Q[head];
head = (head + 1) % MAX;
}
int main() {
... | a.cc: In function 'void enqueue(Proc)':
a.cc:11:19: error: cannot convert 'Proc' to 'int' in assignment
11 | Q[tail] = x;
| ^
| |
| Proc
a.cc:12:29: error: 'MAX' was not declared in this scope
12 | tail = (tail + 1) % MAX;
... |
s261673399 | p02264 | C++ | #include <iostream>
#include <string>
#include <cassert>
#include <list>
struct Proc{
std::string name;
int time;
};
typedef std::list<Proc> PList;
void output(const PList& vec);
PList calc(PList vec, int q);
///-------------------------------------------------
int main()
{
PList ivec;
int n;
std::cin >> n;
in... | a.cc: In function 'int main()':
a.cc:27:17: error: 'vec' was not declared in this scope; did you mean 'ivec'?
27 | vec.push_back(proc);
| ^~~
| ivec
|
s198944860 | p02264 | C++ | #include <iostream>
#include <string>
#include <cassert>
#include <queue>
struct Proc{
std::string name;
int time;
};
typedef std::queue<Proc> PList;
void output(const PList& vec);
PList calc(PList vec, int q);
///-------------------------------------------------
int main()
{
PList ivec;
int n;
std::cin >> n;
... | a.cc: In function 'int main()':
a.cc:27:22: error: 'PList' {aka 'class std::queue<Proc>'} has no member named 'push_back'
27 | ivec.push_back(proc);
| ^~~~~~~~~
a.cc:30:20: error: 'const_iterator' is not a member of 'PList' {aka 'std::queue<Proc>'}
30 | for(PList... |
s004198994 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
#define N 100
typedef struct pp{
char name[N];
int t;
}P;
void enqueue(P);
P dequeue(void);
P Q[LEN+1];
int head=0,tail=1,n;
int main()
{
int elaps=0,c;
int i,q;
P u;
scanf("%d %d",&n,&q);
c=100;
for (i=0;i<n;i++)
{
scanf("%s",Q[i].na... | a.cc: In function 'int main()':
a.cc:33:9: error: 'min' was not declared in this scope; did you mean 'main'?
33 | c=min(q,u.t);
| ^~~
| main
|
s017181567 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
#define N 100
typedef struct pp{
char name[N];
int t;
}P;
void enqueue(P);
P dequeue(void);
P Q[LEN+1];
int head,tail,n;
int main()
{
int elaps=0,c;
int i,q;
P u;
scanf("%d %d",&n,&q);
c=100;
for (i=0;i<n;i++)
{
scanf("%s",Q[i].name);... | a.cc: In function 'int main()':
a.cc:34:9: error: 'min' was not declared in this scope; did you mean 'main'?
34 | c=min(q,u.t);
| ^~~
| main
|
s245991637 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
#define N 100
typedef struct pp{
char name[N];
int t;
}P;
void enqueue(P);
P dequeue(void);
P Q[LEN+1];
int head,tail,n;
int main()
{
int elaps=0,c;
int i,q;
P u;
scanf("%d %d",&n,&q);
c=100;
for (i=0;i<n;i++)
{
scanf("%s",Q[i].name);... | a.cc:54:16: error: redefinition of 'struct pp'
54 | typedef struct pp{
| ^~
a.cc:6:16: note: previous definition of 'struct pp'
6 | typedef struct pp{
| ^~
a.cc:57:2: error: conflicting declaration 'typedef int P'
57 | }P;
| ^
a.cc:9:2: note: previous declarati... |
s159660459 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
#define N 100
typedef struct pp{
char name[N];
int t;
}P;
void enqueue(P);
P dequeue(void);
P Q[LEN+1];
int head,tail,n;
int main()
{
int elaps=0,c;
int i,q;
P u;
scanf("%d %d",&n,&q);
c=100;
for (i=0;i<n;i++)
{
scanf("%s",Q[i].name);... | /usr/bin/ld: /tmp/ccPHGztJ.o: in function `main':
a.cc:(.text+0x10a): undefined reference to `dequeue()'
collect2: error: ld returned 1 exit status
|
s694973174 | p02264 | C++ | #include <stdio.h>
#include <string.h>
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif
//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long... | a.cc:16:19: error: 'acos' was not declared in this scope
16 | const double PI = acos(-1);
| ^~~~
a.cc: In function 'int main()':
a.cc:51:19: error: 'cin' was not declared in this scope
51 | int n, q; cin >> n >> q;
| ^~~
a.cc:3:1: note: 'std::cin' is defined... |
s896212668 | p02264 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
queue<pair<string, int> > Q;
cin >> n >> q;
for ( int i = 0; i < n; i++ ) {
cin >> name >> t;
Q.push(make_pair(name, t));
}
pair<string, int> u;
int elaps = 0, a;
while ( !Q.empty() )... | a.cc: In function 'int main()':
a.cc:10:10: error: 'n' was not declared in this scope
10 | cin >> n >> q;
| ^
a.cc:10:15: error: 'q' was not declared in this scope
10 | cin >> n >> q;
| ^
a.cc:13:12: error: 'name' was not declared in this scope; did you mean 'tzname'?
13 ... |
s503011179 | p02264 | C++ | #include <iostream>
#include <string>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
queue<pair<string, int> > Q;
cin >> n >> q;
for ( int i = 0; i < n; i++ ) {
cin >> name >> t;
Q.push(make_pair(name, t));
}
pair<string, int> u;
int elaps = 0, a;
while ( !Q.empty() )... | a.cc: In function 'int main()':
a.cc:10:10: error: 'n' was not declared in this scope
10 | cin >> n >> q;
| ^
a.cc:10:15: error: 'q' was not declared in this scope
10 | cin >> n >> q;
| ^
a.cc:13:12: error: 'name' was not declared in this scope; did you mean 'tzname'?
13 ... |
s303625373 | p02264 | C++ | #include<iostream>
#include<string>
//#include<queue>
using namespace std;
class Proc{
public:
string nam;
int tim;
Proc(){nam="";tim=0;}
};
Proc Q[100001];
class queue{
private:
int fp;
int rp;
public:
queue(){fp=0;rp=0;)
int next(int p) const{return (p+1)%100001;}
bool isFull() const {return (next(rp)==fp)... | a.cc:29:6: error: extra qualification 'queue::' on member 'push' [-fpermissive]
29 | void queue::push(Proc d){
| ^~~~~
a.cc:36:6: error: extra qualification 'queue::' on member 'front' [-fpermissive]
36 | Proc queue::front(){
| ^~~~~
a.cc:44:6: error: extra qualification 'queue::' on member ... |
s896671608 | p02264 | C++ | #include<iostream>
#include<string>
using namespace std;
class Proc{
public:
string nam;
int tim;
Proc(){
nam="";
tim=0;
}
};
Proc Q[100001];
class Queue{
private:
int fp;
int rp;
public:
Queue(){
fp=0;
rp=0;
}
int next(int p)const{
return (p+1)%100001;
}
bool isFull()const{
... | a.cc:48:6: error: no declaration matches 'void Queue::front()'
48 | void Queue::front(){
| ^~~~~
a.cc:36:22: note: candidate is: 'Proc Queue::front()'
36 | Proc front();
| ^~~~~
a.cc:17:7: note: 'class Queue' defined here
17 | class Queue{
| ^~~... |
s718906714 | p02264 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
class Proc {
public:
string nam;
int tim;
proc() { nam = ""; tim = 0; }
};
Proc Q[100001];
class Queue {
private:
int fp;
int rp;
public:
Queue() {
fp = 0; rp = 0;
}
int next(int p) const {
return (p + 1) % 100001;
}
bool isFull... | a.cc:10:9: error: ISO C++ forbids declaration of 'proc' with no type [-fpermissive]
10 | proc() { nam = ""; tim = 0; }
| ^~~~
a.cc: In member function 'int Proc::proc()':
a.cc:10:37: warning: no return statement in function returning non-void [-Wreturn-type]
10 | proc() { nam = ""; t... |
s002985359 | p02264 | C++ | #include<iostream>
#include<string>
#include<sstream>
using namespace std;
class Proc {
public:
string nam;
int tim;
proc() { nam = ""; tim = 0; }
};
Proc Q[100001];
class Queue {
private:
int fp;
int rp;
public:
Queue() {
fp = 0; rp = 0;
}
int next(int p) const {
return (p + 1) % 100001;
}
bool isFull... | a.cc:10:9: error: ISO C++ forbids declaration of 'proc' with no type [-fpermissive]
10 | proc() { nam = ""; tim = 0; }
| ^~~~
a.cc: In member function 'int Proc::proc()':
a.cc:10:37: warning: no return statement in function returning non-void [-Wreturn-type]
10 | proc() { nam = ""; t... |
s097246292 | p02264 | C++ | #include<iostream>
#include<queue>
#include<string>
#define P pair<string,int>
using namespace std;
queue<P> d;
int n,q,t,time;
string s;
int main(){
cin>>n>>q;
for(int i=0;i<n;i++){
cin>>s>>t;
d.push(P(s,t));
}
while(d.empty()!=1){
if(d.front().second<=q){
time+=d.front().second;
cout<<d.front().fir... | a.cc:9:11: error: 'int time' redeclared as different kind of entity
9 | int n,q,t,time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:15... |
s919935881 | p02264 | C++ | #include<iostream>
#include<queue>
#include<string>
#define P pair<string,int>
using namespace std;
queue<P> d;
int n,q,t,time;
string s;
int main(){
cin>>n>>q;
for(int i=0;i<n;i++){
cin>>s>>t;
d.push(P(s,t));
}
while(d.empty()!=1){
if(d.front().second<=q){
time+=d.front().second;
cout<<d.front().fir... | a.cc:9:11: error: 'int time' redeclared as different kind of entity
9 | int n,q,t,time;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:15... |
s077660806 | p02264 | C++ | #include <cstdio>
#include <string>
using namespace std;
struct Process {
public:
char name[10];
int time;
};
class Queue {
public:
Process* data;
int first = 0;
int last = 0;
int max;
Queue(int max) : max(max) {
data = new Process[max];
}
void enqueue(Process p) {
... | a.cc: In function 'int main()':
a.cc:64:9: error: 'strcpy' was not declared in this scope
64 | strcpy(p.name, name);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <string>
+++ |+#include <cstring>
... |
s499854035 | p02264 | C++ | #include <cstdio>
#include <string>
using namespace std;
struct Process {
public:
char n[10];
int t;
};
class Queue {
public:
Process data[100005];
int head;
int tail;
int max = 100005;
void enqueue(Process p) {
data[tail] = p;
if (tail + 1 >= max) {
tail = 0... | a.cc: In function 'int main()':
a.cc:60:9: error: 'strcpy' was not declared in this scope
60 | strcpy(p.n, name);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <string>
+++ |+#include <cstring>
... |
s121868853 | p02264 | C++ | #include <cstdio>
#include <string>
using namespace std;
struct Process {
public:
char n[10];
int t;
};
class Queue {
public:
Process data[100005];
int head;
int tail;
int max = 100005;
void enqueue(Process p) {
data[tail] = p;
if (tail + 1 >= max) {
tail = 0... | a.cc: In function 'int main()':
a.cc:60:9: error: 'strcpy' was not declared in this scope
60 | strcpy(p.n, name);
| ^~~~~~
a.cc:3:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
2 | #include <string>
+++ |+#include <cstring>
... |
s331437777 | p02264 | C++ | #include <cstdint>
using namespace std;
#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;
bool queue_dequeue(process_t &process)
{
if (head == tail) return false;
process = processes[head];
head++;
head %= ARRAY_SIZE;
return true;
}
void queue_enqueue(process_t process)
{
p... | a.cc:6:1: error: 'process_t' does not name a type
6 | process_t processes[ARRAY_SIZE];
| ^~~~~~~~~
a.cc:9:20: error: 'process_t' was not declared in this scope
9 | bool queue_dequeue(process_t &process)
| ^~~~~~~~~
a.cc:9:31: error: 'process' was not declared in this scope
9 |... |
s808848627 | p02264 | C++ | #include <cstdint>
struct process_t {
string name;
uint32_t time;
bool operator==(const process_t &p1) const
{
return (p1.name == this->name) && (p1.time == this->time);
}
};
using namespace std;
#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;
bool queue_dequeue(process_... | a.cc:3:3: error: 'string' does not name a type; did you mean 'stdin'?
3 | string name;
| ^~~~~~
| stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:7:16: error: 'const struct process_t' has no member named 'name'
7 | return (p1.name == this->name) &&... |
s297074180 | p02264 | C++ | #include <cstdint>
struct process_t {
string name;
uint32_t time;
bool operator==(const process_t &p1) const
{
return (p1.name == this->name) && (p1.time == this->time);
}
};
using namespace std;
#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;
bool queue_dequeue(process_... | a.cc:3:3: error: 'string' does not name a type; did you mean 'stdin'?
3 | string name;
| ^~~~~~
| stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:7:16: error: 'const struct process_t' has no member named 'name'
7 | return (p1.name == this->name) &&... |
s126769945 | p02264 | C++ | #include <cstdint>
#include <string>
struct process_t {
string name;
uint32_t time;
bool operator==(const process_t &p1) const
{
return (p1.name == this->name) && (p1.time == this->time);
}
};
using namespace std;
#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;
bool que... | a.cc:5:3: error: 'string' does not name a type; did you mean 'stdin'?
5 | string name;
| ^~~~~~
| stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:9:16: error: 'const struct process_t' has no member named 'name'
9 | return (p1.name == this->name) &&... |
s139832452 | p02264 | C++ | #include <cstdint>
#include <string>
struct process_t {
string name;
uint32_t time;
bool operator==(const process_t &p1) const
{
return (p1.name == this->name) && (p1.time == this->time);
}
};
using namespace std;
#define ARRAY_SIZE 100000
process_t processes[ARRAY_SIZE];
uint32_t head, tail;
bool que... | a.cc:5:3: error: 'string' does not name a type; did you mean 'stdin'?
5 | string name;
| ^~~~~~
| stdin
a.cc: In member function 'bool process_t::operator==(const process_t&) const':
a.cc:9:16: error: 'const struct process_t' has no member named 'name'
9 | return (p1.name == this->name) &&... |
s123423713 | p02264 | C++ | #include<iostream>
#include<string.h>
using namespace std;
#define MAX 100005
struct Proc {
char name[200];
int t;
};
int head, tail;
Proc Q[MAX];
bool IsEnpty(void) {
return head == tail;
}
bool IsFull(void) {
return head == (tail + 1) % MAX;
}
void enq(Proc y) {
Q[tail] = y;
tail = (tail + 1) % MAX;
}
P... | a.cc: In function 'int main()':
a.cc:48:27: error: 'FALSE' was not declared in this scope
48 | while (IsEnpty == FALSE) {
| ^~~~~
|
s914346787 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
int time;
char name[11] = "\0";
int fintime;
} PROCESS;
int main(void)
{
int n, q;
cin >> n >> q;
PROCESS *queue = new PROCESS[n];
for (int i = 0; i < n; i++) {
cin >> queue[i].name;
cin >> queue[i].time;
}
... | a.cc: In function 'int main()':
a.cc:26:34: error: expected type-specifier before '*' token
26 | PROCESS **finorder = new *PROCESS[n];
| ^
a.cc:26:42: error: expected primary-expression before '[' token
26 | PROCESS **finorder = new *PROCESS[n];
| ... |
s972535636 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
int time;
char name[11] = "\0";
} PROCESS;
int main(void)
{
int n, q;
cin >> n >> q;
PROCESS *queue = new PROCESS[n];
for (int i = 0; i < n; i++) {
cin >> queue[i].name;
cin >> queue[i].time;
}
int time = ... | a.cc: In function 'int main()':
a.cc:30:33: error: 'finorder' was not declared in this scope
30 | finorder[cnt] = idx;
| ^~~~~~~~
a.cc:44:18: error: 'finorder' was not declared in this scope
44 | delete[] finorder;
| ... |
s947274108 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
char name[11] = "\0";
int time;
} P;
class Queue {
private:
int size;
P *queue;
int head = 0;
int tail = 0;
public:
Queue::Queue(int n);
void Queue::enqueue(P p);
void Queue::dequeue();
bool Queue::isEmpty();
*P... | a.cc:18:9: error: extra qualification 'Queue::' on member 'Queue' [-fpermissive]
18 | Queue::Queue(int n);
| ^~~~~
a.cc:19:14: error: extra qualification 'Queue::' on member 'enqueue' [-fpermissive]
19 | void Queue::enqueue(P p);
| ^~~~~
a.cc:20:14: error: extra qu... |
s870892042 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
char name[11] = "\0";
int time;
} P;
class Queue {
private:
int size;
P *queue;
int head = 0;
int tail = 0;
public:
Queue(int n);
void enqueue(P p);
void dequeue();
bool isEmpty();
*P get();
void clear()
}
Que... | a.cc:22:10: error: ISO C++ forbids declaration of 'P' with no type [-fpermissive]
22 | *P get();
| ^
a.cc:22:10: error: expected ';' at end of member declaration
22 | *P get();
| ^
| ;
a.cc:22:10: error: declaration of 'int* Queue::P' changes meaning o... |
s768183005 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
char name[11] = "\0";
int time;
} P;
class Queue {
private:
int size;
P *queue;
int head = 0;
int tail = 0;
public:
Queue(int n);
void enqueue(P p);
void dequeue();
bool isEmpty();
P *get();
void clear()
}
Que... | a.cc:23:20: error: expected ';' at end of member declaration
23 | void clear()
| ^
| ;
a.cc:11:1: error: new types may not be defined in a return type
11 | class Queue {
| ^~~~~
a.cc:11:1: note: (perhaps a semicolon is missing after the definition o... |
s484184429 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
char name[11] = "\0";
int time;
} P;
class Queue {
private:
int size;
P *queue;
int head = 0;
int tail = 0;
public:
Queue(int n);
void enqueue(P p);
void dequeue();
bool isEmpty();
P *get();
void clear();
}
Qu... | a.cc:11:1: error: new types may not be defined in a return type
11 | class Queue {
| ^~~~~
a.cc:11:1: note: (perhaps a semicolon is missing after the definition of 'Queue')
a.cc:11:1: error: return type specification for constructor invalid
a.cc: In function 'int main()':
a.cc:83:39: error: cannot convert 'P*'... |
s288587819 | p02264 | C++ | #include <stdio.h>
#include <iostream>
#include <cstdlib>
using namespace std;
typedef struct {
char name[11] = "\0";
int time;
} P;
class Queue {
private:
int size;
P *queue;
int head = 0;
int tail = 0;
public:
Queue(int n);
void enqueue(P p);
void dequeue();
bool isEmpty();
P *get();
void clear();
};
Q... | a.cc: In function 'int main()':
a.cc:83:39: error: cannot convert 'P*' to 'P'
83 | queue.enqueue(p);
| ^
| |
| P*
a.cc:32:23: note: initializing argument 1 of ... |
s530582104 | p02264 | C++ | #include<iostream>
#include<queue>
using namespace std;
int n=0;
int q=0;
int total=0;
struct process {
string name;
int time;
};
int main(){
queue<process> que;
queue<process> ans;
cin>>n>>q;
for (int i=0;i<n;i++){
process p;
cin>>p.name>>p.time;
que.push(p);... | a.cc: In function 'int main()':
a.cc:35:19: error: request for member 'time' in 'total', which is of non-class type 'int'
35 | total.time+=q;
| ^~~~
a.cc:37:22: error: request for member 'front' in 'q', which is of non-class type 'int'
37 | p.name=q.front().name;
... |
s590853620 | p02264 | C++ | #include<iostream>
#include<queue>
using namespace std;
int n=0;
int q=0;
int total=0;
struct process {
string name;
int time;
};
int main(){
queue<process> que;
queue<process> ans;
cin>>n>>q;
for (int i=0;i<n;i++){
process p;
cin>>p.name>>p.time;
que.push(p);... | a.cc: In function 'int main()':
a.cc:35:19: error: request for member 'time' in 'total', which is of non-class type 'int'
35 | total.time+=q;
| ^~~~
a.cc:37:22: error: request for member 'front' in 'q', which is of non-class type 'int'
37 | p.name=q.front().name;
... |
s087686499 | p02264 | C++ | #include<iostream>
#include<queue>
using namespace std;
int n=0;
int q=0;
int total=0;
struct process {
string name;
int time;
};
int main(){
queue<process> que;
queue<process> ans;
cin>>n>>q;
for (int i=0;i<n;i++){
process p;
cin>>p.name>>p.time;
que.push(p);... | a.cc: In function 'int main()':
a.cc:37:22: error: request for member 'front' in 'q', which is of non-class type 'int'
37 | p.name=q.front().name;
| ^~~~~
a.cc:38:22: error: request for member 'front' in 'q', which is of non-class type 'int'
38 | p.time=q.front()... |
s368650414 | p02264 | C++ | #include <stdio.h>
#include <string.h>
#define LEN 10005
struct Proc {
char name[100];
int t;
};
Proc Q[LEN];
int head, tail, n;
void enqueue(Proc x) {
Q[tail] = x;
tail = (tail + 1) % LEN;
}
Proc dequeue() {
Proc x = Q[head];
head = (head + 1) % LEN;
return x;
}
int min(int a, int b) { return a < b ? a : b... | a.cc: In function 'int main()':
a.cc:54:18: error: expected '}' at end of input
54 | return 0;
| ^
a.cc:26:12: note: to match this '{'
26 | int main() {
| ^
|
s948726111 | p02264 | C++ | #include<iostream.h>
#include<queue>
using namespace std;
main()
{
queue<int> Q2;
queue<string> Q1;
int i,n,q,t,total=0;
char st[10];
cin >> n;
cin >> q;
for(i=0;i<=n-1;i++)
{
cin >> st;
Q1.push(st);
cin >> t;
Q2.push(t);
}
while(Q2.empty()!=1)
{
if(Q2.front()-100<=0)
{
total+=Q2.front();... | a.cc:1:9: fatal error: iostream.h: No such file or directory
1 | #include<iostream.h>
| ^~~~~~~~~~~~
compilation terminated.
|
s939564922 | p02264 | C++ | #include<iostream>
#include<string>
#include<queue>
#include<algorithm>
int main(){
int n,q,t;
string name;
queue<string,int> >Q;
cin >> n >> q;
for(int i=0;i<n;i++){
cin >> name >> t;
Q.push(make_pair(name,t));
}
pair<string,int> u;
int elaps = 0,a;
while(!Q.empty()){
u = Q.front();Q.pop();
a = min(u.... | a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string name;
| ^~~~~~
a.cc:7:9: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
from /usr/include/c++/14/ios:40,
from /usr/include/c... |
s268186494 | p02264 | C++ | f | a.cc:1:1: error: 'f' does not name a type
1 | f
| ^
|
s404897447 | p02264 | C++ | #include <cstdio>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int main(){
int n,q;
int i,t;
queue<pair<string,int>>Q;
scanf("%d %d",%n,&q);
for(i=0;i<n;i++){
scanf("%s %d",name,t);
Q.push(make_pair(name,t));
}
pair<string,int>u;
int elaps=0,a;
whilie(!Q.empty... | a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before '%' token
10 | scanf("%d %d",%n,&q);
| ^
a.cc:12:19: error: 'name' was not declared in this scope; did you mean 'tzname'?
12 | scanf("%s %d",name,t);
| ^~~~
| ... |
s965986656 | p02264 | C++ | #include <cstdio>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int main(){
int n,q;
int i,t;
string name;
queue<pair<string,int> >Q;
scanf("%d %d",&n,&q);
for(i=0;i<n;i++){
scanf("%s %d",name,t);
Q.push(make_pair(name,t));
}
pair<string,int>u;
int elaps=0,a;
... | a.cc: In function 'int main()':
a.cc:20:13: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 't'
20 | a=min(u.t,q);
| ^
a.cc:21:7: error: 'struct std::pair<std::__cxx11::basic_string<char>, int>' has no member named 't'
21 | u.t-=a;elaps+=a;
| ... |
s986486682 | p02264 | C++ | #include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
int main() {
int n, q, t;
string s;
queue<pair<string,int> > Q;
cin >> n >> q;
for (int i=0; i<q; i++) {
cin >> s >> t;
Q.push(make_pair(s,t));
}
pair<string,int> u;
int ans=0;
while (!Q.e... | a.cc: In function 'int main()':
a.cc:18:13: error: no match for 'operator=' (operand types are 'std::pair<std::__cxx11::basic_string<char>, int>' and '<unresolved overloaded function type>')
18 | u=Q.front;
| ^~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
... |
s954794967 | p02264 | C++ | 5 100
p1 150
p2 80
p3 200
p4 350
p5 20 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5 100
| ^
|
s589807353 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
P;
}
P Q[LEN];
int head,tail,n;
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int min(int a,int b){return a<b?a:b;}
int main(){
int elap... | a.cc:8:3: error: 'P' does not name a type
8 | P;
| ^
a.cc:11:3: error: expected initializer before 'Q'
11 | P Q[LEN];
| ^
a.cc:14:6: error: variable or field 'enqueue' declared void
14 | void enqueue(P x){
| ^~~~~~~
a.cc:14:14: error: 'P' was not declared in this scope
14 | voi... |
s903294091 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
P;
}
P Q[LEN];
int head,tail,n;
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int min(int a,int b){return a<b?a:b;}
int main(){
int elap... | a.cc:8:3: error: 'P' does not name a type
8 | P;
| ^
a.cc:11:3: error: expected initializer before 'Q'
11 | P Q[LEN];
| ^
a.cc:14:6: error: variable or field 'enqueue' declared void
14 | void enqueue(P x){
| ^~~~~~~
a.cc:14:14: error: 'P' was not declared in this scope
14 | voi... |
s841847784 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}
P;
P Q[LEN];
int head,tail,n;
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int min(int a,int b){return a<b?a:b;}
int main(){
int elaps... | a.cc: In function 'int main()':
a.cc:30:9: error: expected unqualified-id before numeric constant
30 | int i,1;
| ^
a.cc:32:20: error: 'q' was not declared in this scope
32 | scanf("%d%d",&n,&q);
| ^
a.cc:42:9: error: expected primary-expression before '-=' token
42 |... |
s470539431 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
}
P;
P Q[LEN];
int head,tail,n;
void enqueue(P x){
Q[tail]=x;
tail=(tail+1)%LEN;
}
P dequeue(){
P x=Q[head];
head=(head+1)%LEN;
return x;
}
int min(int a,int b){return a<b?a:b;}
int main(){
int elaps... | a.cc: In function 'int main()':
a.cc:42:9: error: expected primary-expression before '-=' token
42 | u.t=-=c;
| ^~
|
s343773545 | p02264 | C++ | #include<iostream>
#include<string>
#include<queue>
#include<algorithm>
using namespace std;
int main() {
int n, q, t;
string name;
queue<pair<string, int>> Q;
cin >> n >> q;
for (int i = 0; i < n; i++) {
cin >> name >> t;
Q.push(make_pair(name.t));
}
pair<string, int> u;
int elaps = 0, a;
while (!Q.e... | a.cc: In function 'int main()':
a.cc:16:39: error: 'std::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 't'; did you mean 'at'?
16 | Q.push(make_pair(name.t));
| ^
| at
|
s674783710 | p02264 | C++ | #include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <fstream>
#include <cassert>
using namespace std;
//#define DEBUG (1)
#ifdef DEBUG
#define DPRINTF(...) printf("D(L%d) %s: ", __LINE__, __func__); printf(__VA_ARGS__)
#else
#define DPRINTF(...)
#endif
class Process {
public:
Process() {};
Proce... | a.cc:260:1: error: 'Mac' does not name a type
260 | Mac-mini:study_algorithm_and_data_structure Masa$ vi alds1_3_b.cpp
| ^~~
a.cc:280:7: error: redefinition of 'class Process'
280 | class Process {
| ^~~~~~~
a.cc:16:7: note: previous definition of 'class Process'
16 | class Process {
| ... |
s310387154 | p02264 | C++ | #include<stdio.h>
#include<string.h>
#define LEN 100005
typedef struct pp{
char name[100];
int t;
} P;
P Q[LEN+1];
int head, tail, n;
void enqueue(P x){
Q[tail] = x;
if ( tail + 1 == LEN ) {
tail = 0;
} else {
tail++;
}
}
P dequeue(){
P x = Q[head];
if ( head + 1 == LEN ) {
head = 0;
}... | a.cc: In function 'P dequeue()':
a.cc:29:11: error: expected ';' before '}' token
29 | return x
| ^
| ;
30 | }
| ~
|
s372204801 | p02264 | C++ | #include<iostream>
#include<string>
#include<queue>
#include<algorithm>
using namespace std;
int main() {
int n, q, t;
string name;
queue<pair<string, int> > Q;
cin >> n >> q;
for ( int i = 0; i < n; i++ ) {
cin >> name >> t;
Q.push(make_pair(name, t));
}
pair<string, int> u;
int elaps = ... | a.cc: In function 'int main()':
a.cc:23:14: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'empyt'; did you mean 'empty'?
23 | while ( !Q.empyt() ) {
| ^~~~~
| empty
|
s332837203 | p02264 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
using namespace stdext;
class Queue{
public:
int* Q;
int head;
int tail;
int size;
Queue(int n);
~Queue();
Queue(const Queue &other);
void enqueue(int x);
int dequeue();
... | a.cc:8:17: error: 'stdext' is not a namespace-name
8 | using namespace stdext;
| ^~~~~~
a.cc: In copy constructor 'Queue::Queue(const Queue&)':
a.cc:40:39: error: 'checked_array_iterator' was not declared in this scope
40 | copy(other.Q, other.Q + size, checked_array_iterator<int*>(... |
s263194095 | p02264 | C++ | #include <iostream>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <vector>
using namespace std;
using namespace stdext;
class Queue{
public:
int* Q;
int head;
int tail;
int size;
Queue(int n);
~Queue();
Queue(const Queue &other);
void enqueue(int x);
int dequeue();
... | a.cc:8:17: error: 'stdext' is not a namespace-name
8 | using namespace stdext;
| ^~~~~~
|
s381416939 | p02264 | C++ | import sys
from collections import deque
s=sys.stdin.readlines()
n,q=map(int,s[0].split())
d=deque(e.split()for e in s[1:])
t=0
while d:
k,v=d.popleft()
v=int(v)
if v>q:
v-=q
t+=q
d.append([k,v])
else:
t+=v
print(k,t)
| a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s621431063 | p02264 | C++ | #include <iostream>
#include <queue>
int main(int argc, char const *argv[]){
int n,q,t;
std::cin >> n >> q;
std::queue<std::string> task(n);
std::queue<int> time(n);
for (int i = 0; i < n; ++i){
std::cin >> task[i] >> time[i];
}
while(!task.empty()){
if(time.front() - q > 0){
t += q;
time.push(ti... | a.cc: In function 'int main(int, const char**)':
a.cc:8:39: error: no matching function for call to 'std::queue<std::__cxx11::basic_string<char> >::queue(int&)'
8 | std::queue<std::string> task(n);
| ^
In file included from /usr/include/c++/14/queue:66,
... |
s454918250 | p02264 | C++ | #include <iostream>
#include <queue>
int main(int argc, char const *argv[]){
int n,q,t;
std::cin >> n >> q;
std::queue<std::pair<std::string,int>> que;
for (int i = 0; i < n; ++i){
std::string tsk;
int tm;
std::cin >> nm >> tm;
que.push(make_pair(nm,tm));
}
while(!task.empty()){
pair<string,int> fr... | a.cc: In function 'int main(int, const char**)':
a.cc:12:29: error: 'nm' was not declared in this scope; did you mean 'tm'?
12 | std::cin >> nm >> tm;
| ^~
| tm
a.cc:13:26: error: 'make_pair' was not declared in this scope; did you m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.