criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include <algorithm>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long ll;
const int MAXN = 100100;

int head, tail;
int T[MAXN];
char P[MAXN][10];

void enque(int t, char *q) {
	T[tail] = t;
	strcpy_s(P[tail],q);
	if (tail != MAXN)tail++;
	else tail = 0;
}

int deque() {
	int ans = T[head];
	if (head != MAXN)head++;
	else head = 0;
	return ans;
}


int main() {
	int n, q;
	int num;
	int cnt = 0;

	cin >> n >> q;
	for (int i = 1; i <= n; i++) {
		scanf_s("%d", &T[i]);
		scanf_s("%s", P[i]);
	}
	head = 1;
	tail = n + 1;
	while (head == tail) {
		num = deque();
		if (num > q) {
			num -= q;
			cnt += q;
			if (head == 0)enque(num, P[MAXN]);
			else enque(num, P[head - 1]);
		}
		else {
			cnt += num;
			if (head == 0)printf("%s %d\n", P[MAXN], cnt);
			else printf("%s %d\n", P[head - 1], cnt);
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'void enque(int, char*)':
a.cc:20:9: error: 'strcpy_s' was not declared in this scope
   20 |         strcpy_s(P[tail],q);
      |         ^~~~~~~~
a.cc: In function 'int main()':
a.cc:40:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   40 |                 scanf_s("%d", &T[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C++

#include <iostream>
using namespace std;
#define LEN 100005

struct Process {
  char name[100];
  int t;
};

Process Q[LEN];
int head,tail,n;

// tailの位置にxを追加する
void enqueue(Process x){
  // tailの位置に追加して，tailを増やす
  Q[tail] = x;
  tail = (tail+1)%LEN;
}

// headの位置の要素を取り出す
Process dequeue(){
  // headが指していた要素を返す
  Process x = Q[head];
  head = (head+1)%LEN;
  return x;
}

int isEmpty(){
  return head == tail;
}

int main(){
  int n;
  int q;
  cin >> n >> q;
  Process p;
  head = 1;
  tail = 1;

  for(int i=1;i<=n;i++){
    cin >> p.name >> p.t;
    enqueue(p);
  }

  int total = 0;
  while(!isEmpty()){
    Process p = dequeue();
    int diff = min(q,p.t);
    p.t -= diff;
    elaps += diff;
    if (p.t > 0){
      enqueue(p);
    }
    else{
      cout << p.name << " " << elaps << endl;
    }
  }

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:50:5: error: 'elaps' was not declared in this scope
   50 |     elaps += diff;
      |     ^~~~~
Language: 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 = 0, c;
    int i, q;
    P u;
    scanf("%d %d", &n, &q);

    for(i = 1, i <= n, i++) {
        scanf("%s", Q[i].name);
        scanf("%s", Q[i].t);
    }

    head = 1; tail = n + 1;

    while(head != tail) {
        u = dequeue();
        c = min(q, u.t);
        u.t -= c;
        elaps += c;
        if(u.t > 0) enqueue(u);
        else {
            printf("%s %d\n", u.name, elaps);
        }
    }

    return 0;
}


Compiler output:
a.cc: In function 'P dequeue()':
a.cc:21:13: error: expected ';' before '}' token
   21 |     return x
      |             ^
      |             ;
   22 | }
      | ~            
a.cc: In function 'int main()':
a.cc:32:27: error: expected ';' before ')' token
   32 |     for(i = 1, i <= n, i++) {
      |                           ^
      |                           ;
a.cc:37:27: error: expected ')' before ';' token
   37 |     head = 1; tail = n + 1;
      |                           ^
      |                           )
a.cc:32:8: note: to match this '('
   32 |     for(i = 1, i <= n, i++) {
      |        ^
Language: C++

#include<stdio.h>
#include<string.h>
#define LEN 100005

typedef struct pp{
} P;

P Q[LEN];
int head, tail, n;

void enqueue(P x) {
  Q[tail] = x;
  if ( tail + 1 == LEN ) {
    tail = 0;
  } else {
    tail++;
  }
}

P dequeue() {
  x = Q[head];
  if ( head + 1 == LEN ) {
    head = 0;
  } else {
    head++;
  }
  return x;
}

int min(int a, int b) {
}

int main() {
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++ ){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i], t);
  }
  head = 1; tail = n + 1;

  while ( head != tail ) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    elaps += c;
    if ( u.t > 0 ) enqueue(u);
    else {
      printf("%s %d\n", u.name, elaps);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'P dequeue()':
a.cc:21:3: error: 'x' was not declared in this scope
   21 |   x = Q[head];
      |   ^
a.cc: In function 'int min(int, int)':
a.cc:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^
a.cc: In function 'int main()':
a.cc:40:22: error: 'P' {aka 'struct pp'} has no member named 'name'
   40 |     scanf("%s", Q[i].name);
      |                      ^~~~
a.cc:41:24: error: 't' was not declared in this scope
   41 |     scanf("%d", &Q[i], t);
      |                        ^
a.cc:47:18: error: 'P' {aka 'struct pp'} has no member named 't'
   47 |     c = min(q, u.t);
      |                  ^
a.cc:48:7: error: 'P' {aka 'struct pp'} has no member named 't'
   48 |     u.t -= c;
      |       ^
a.cc:50:12: error: 'P' {aka 'struct pp'} has no member named 't'
   50 |     if ( u.t > 0 ) enqueue(u);
      |            ^
a.cc:52:27: error: 'P' {aka 'struct pp'} has no member named 'name'
   52 |       printf("%s %d\n", u.name, elaps);
      |                           ^~~~
Language: 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;
  if ( tail + 1 == LEN ) {
    tail = 0;
  } else {
    tail++;
  }
}

P dequeue() {
  x = Q[head];
  if ( head + 1 == LEN ) {
    head = 0;
  } else {
    head++;
  }
  return x;
}

int min(int a, int b) {
}

int main() {
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++ ){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i], t);
  }
  head = 1; tail = n + 1;

  while ( head != tail ) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    elaps += c;
    if ( u.t > 0 ) enqueue(u);
    else {
      printf("%s %d\n", u.name, elaps);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'P dequeue()':
a.cc:23:3: error: 'x' was not declared in this scope
   23 |   x = Q[head];
      |   ^
a.cc: In function 'int min(int, int)':
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
a.cc: In function 'int main()':
a.cc:43:24: error: 't' was not declared in this scope
   43 |     scanf("%d", &Q[i], t);
      |                        ^
Language: 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;
  if ( tail + 1 == LEN ) {
    tail = 0;
  } else {
    tail++;
  }
}

P dequeue() {
  P x = Q[head];
  if ( head + 1 == LEN ) {
    head = 0;
  } else {
    head++;
  }
  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("%d %d", &n, &q);

  for ( i = 1; i <= n; i++ ){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i], t);
  }
  head = 1; tail = n + 1;

  while ( head != tail ) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    elaps += c;
    if ( u.t > 0 ) enqueue(u);
    else {
      printf("%s %d\n", u.name, elaps);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int min(int, int)':
a.cc:32:41: error: expected ':' before ';' token
   32 | int min(int a, int b) { return a < b ? a; b; }
      |                                         ^
      |                                         :
a.cc:32:41: error: expected primary-expression before ';' token
a.cc: In function 'int main()':
a.cc:42:24: error: 't' was not declared in this scope
   42 |     scanf("%d", &Q[i], t);
      |                        ^
Language: 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;
  if ( tail + 1 == LEN ) {
    tail = 0;
  } else {
    tail++;
  }
}

P dequeue() {
  P x = Q[head];
  if ( head + 1 == LEN ) {
    head = 0;
  } else {
    head++;
  }
  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("%d %d", &n, &q);

  for ( i = 1; i <= n; i++ ){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  head = 1; tail = n + 1;

  while ( head != tail ) {
    u = dequeue();
    c = min(q, u.t);
    u.t -= c;
    elaps += c;
    if ( u.t > 0 ) enqueue(u);
    else {
      printf("%s %d\n", u.name, elaps);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int min(int, int)':
a.cc:32:41: error: expected ':' before ';' token
   32 | int min(int a, int b) { return a < b ? a; b; }
      |                                         ^
      |                                         :
a.cc:32:41: error: expected primary-expression before ';' token
Language: C++

#include<queue>
#include<iostream>
#include<string>
using namespace std;
int main() {
	int n, q;
	pair<string, int> proces[n];
	int time = 0;
	queue<pair<string, int> > Q;
	for (int i = 0; i < n; i++) {
		cin >> proces.first >> proces.second;
		Q.push(proces);
	}
	while (!Q.empty()) {
		pair<string, int> tmp = Q.front();
		Q.pop();
		if (tmp.second <= q) {
			time += tmp.second;
			cout << tmp.first << " " << tmp.second << endl;
		}
		else {
			tmp.second -= q;
			Q.push(tmp);
			time += q;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:31: error: request for member 'first' in 'proces', which is of non-class type 'std::pair<std::__cxx11::basic_string<char>, int> [n]'
   11 |                 cin >> proces.first >> proces.second;
      |                               ^~~~~
a.cc:11:47: error: request for member 'second' in 'proces', which is of non-class type 'std::pair<std::__cxx11::basic_string<char>, int> [n]'
   11 |                 cin >> proces.first >> proces.second;
      |                                               ^~~~~~
a.cc:12:23: 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>, int> [n])'
   12 |                 Q.push(proces);
      |                 ~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/queue:66,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_queue.h:283:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  283 |       push(const value_type& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:283:30: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, int> [n]' to 'const std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&' {aka 'const std::pair<std::__cxx11::basic_string<char>, int>&'}
  283 |       push(const value_type& __x)
      |            ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_queue.h:288:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(value_type&&) [with _Tp = std::pair<std::__cxx11::basic_string<char>, int>; _Sequence = std::deque<std::pair<std::__cxx11::basic_string<char>, int>, std::allocator<std::pair<std::__cxx11::basic_string<char>, int> > >; value_type = std::pair<std::__cxx11::basic_string<char>, int>]'
  288 |       push(value_type&& __x)
      |       ^~~~
/usr/include/c++/14/bits/stl_queue.h:288:25: note:   no known conversion for argument 1 from 'std::pair<std::__cxx11::basic_string<char>, int> [n]' to 'std::queue<std::pair<std::__cxx11::basic_string<char>, int> >::value_type&&' {aka 'std::pair<std::__cxx11::basic_string<char>, int>&&'}
  288 |       push(value_type&& __x)
      |            ~~~~~~~~~~~~~^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
using namespace std;
map <int ,int> mpa,mpb;
#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){
  retrun a<b?a:b;
}

int main(){
  int elaps=0;
  int i,q,c;
  P u;
  scanf("%d %d", &n,&q);

  for(int i=1;i<=n;i++){
    scanf("%s",Q[i].name);
    scanf("%d",Q[i].t);
  }
  head =1, tail=1+n;

  while(head!=tail){
    u=dequeue();
    c=min(q,u.t);
    u.t-=c;
    elasp+=c;
    if(u.t>0)enqueue(u);
    else{
      printf("%s %d\n", &u.name,elasp);
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int min(int, int)':
a.cc:35:3: error: 'retrun' was not declared in this scope
   35 |   retrun a<b?a:b;
      |   ^~~~~~
a.cc:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
   36 | }
      | ^
a.cc: In function 'int main()':
a.cc:54:5: error: 'elasp' was not declared in this scope; did you mean 'elaps'?
   54 |     elasp+=c;
      |     ^~~~~
      |     elaps
Language: C++

#include<iostream>
#include<string>

#define SIZE 200000

using namespace std;

struct Task {
  string name;
  int time;
};

struct Queue {
  Task table[SIZE];
  int tail;
  int head;

  void init() {
    head = tail = 0;
  }

  bool isEmpty() {
    return head == tail;
  }

  void enqueue(Task t) {
    table[tail] = t;
    tail++;
    tail %= SIZE;
  }

  Task dequeue() {
    Task t = table[head];
    head++;
    head %= SIZE;
    return t;
  }
};

int main(){
  int N, Q;
  Queue queue;

  cin >> N >> Q;

  queue.init();
  for(int i = 0; i < n; i++){
    Task t;
    cin >> t.name >> t.time;
    queue.enqueue(t);
  }

  int elaps = 0;

  while(!queue.isEmpty()) {
    Task t = queue.dequeue();
    if(t.time <= Q){
      now += t.time;
      cout<< t.name << ' ' << elaps << endl;
    }else{
      elaps += Q;
      t.time -= Q;
      queue.enqueue(t);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:22: error: 'n' was not declared in this scope
   47 |   for(int i = 0; i < n; i++){
      |                      ^
a.cc:58:7: error: 'now' was not declared in this scope
   58 |       now += t.time;
      |       ^~~
Language: C++

#include<iostream>
#include<string>

#define SIZE 200000

using namespace std;

struct Task {
  string name;
  int time;
};

struct Queue {
  Task table[SIZE];
  int tail;
  int head;

  void init() {
    head = tail = 0;
  }

  bool isEmpty() {
    return head == tail;
  }

  void enqueue(Task t) {
    table[tail] = t;
    tail++;
    tail %= SIZE;
  }

  Task dequeue() {
    Task t = table[head];
    head++;
    head %= SIZE;
    return t;
  }
};

int main(){
  int N, Q;
  Queue queue;

  cin >> N >> Q;

  queue.init();
  for(int i = 0; i < N; i++){
    Task t;
    cin >> t.name >> t.time;
    queue.enqueue(t);
  }

  int elaps = 0;

  while(!queue.isEmpty()) {
    Task t = queue.dequeue();
    if(t.time <= Q){
      now += t.time;
      cout<< t.name << ' ' << elaps << endl;
    }else{
      elaps += Q;
      t.time -= Q;
      queue.enqueue(t);
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:7: error: 'now' was not declared in this scope
   58 |       now += t.time;
      |       ^~~
Language: 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 f;
  int r;
public:
  Queue(){
    f = 0;
    r = 0;
  }
  int next(int p) const{
    return (p+1)%100001;
  }
  bool isFull() const{
    return (next(r) == f);
  }
  bool isEmpty() const{
    return (r == f);
  }
  void push(Proc d){
    if(isFull()){
      return;
    }
    Q[r] = d;
    r = next(r);
  }
  Proc front(){
    if(isEmpty()){
      Proc er;
      er.tim = -1;
      return er;
    }
    return Q[f];
  }
  void pop(){
    if(isEmpty()){
      return;
    }
    f = next(f);
  }
};

int main(){
  Queue qu;
  int n,q;
  cin >> n >> q;
  for(int i=0;i<n;i++){
    Proc p;
    cin >> p.nam >> p.tim;
    que.push(p);
  }
  int total_tim = 0;
  while(!qu.isEmpty()){
    Proc p = qu.front();
    qu.pop();
    if(p.tim <= q){
      total_tim += p.tim;
      cout << p.nam << ' ' << total_tim << endl;
    }else{
      total_tim += q;
      p.tim -=q;
      qu.push(p);
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:64:5: error: 'que' was not declared in this scope; did you mean 'qu'?
   64 |     que.push(p);
      |     ^~~
      |     qu
Language: 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 = 0, c;
    int i, q;
    P u;
    
    scanf("%d %d", &n, &q);
    for (i=1; i<=n; i++) {
        scanf("%s", Q[i].name);
        scanf("%d", &Q[i].t);
    }
    head = 1; tail = n + 1;
    
    while (head != tail) {
        u = dequeue();
        c = min(q, u.t);
        u.t -= c;
        elaps =+= c;
        if (u.t > 0) enqueue(u);
        else {
            printf("%s %d\n", u.name, elaps);
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:16: error: expected primary-expression before '+=' token
   44 |         elaps =+= c;
      |                ^~
Language: C++

#include <stdio.h>
#include <queue>
#include <string>
#include <algorithm>
using namespace std;

int main() {
    int n, q, t;
    string name;
    queue<pair<string, int> > Q;
    
    scanf("%d %d", &n, &q);
    
    for (int i=0; i<n; i++) {
        cin >> name >> q;
        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.second, q);
        u.second -= a;
        elaps += a;
        if (u.second > 0) {
            Q.push(u);
        } else {
            printf("%d %d\n", u.first, elaps);
        }
    }
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin >> name >> q;
      |         ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <algorithm>
  +++ |+#include <iostream>
    5 | using namespace std;
Language: C++

#include <stdio.h>
typedef struct{
    int time;
    char name[10];
}pr;
int main(){
  int i,n,q,time,sum=0;
  pr p[100000],array;
  scanf("%d %d",&n,&time);
  for(i=0;i<n;i++)scanf("%s %d",p[i].names,&p[i].time);
  while(1){
    if(n==0)break;
    if(p[0].time<=time){
      sum+=p[0].time;
      printf("%s %d\n",p[0].names,sum);
      for(i=1;i<n;i++)p[i-1]=p[i];
      n--;
    }
    else {
      sum+=time;
      p[0].time-=time;
      array=p[0];
      for(i=0;i<n;i++)p[i-1]=p[i];
      p[i-1]=array;
    }
  }
  return 0;



Compiler output:
a.cc: In function 'int main()':
a.cc:10:38: error: 'struct pr' has no member named 'names'; did you mean 'name'?
   10 |   for(i=0;i<n;i++)scanf("%s %d",p[i].names,&p[i].time);
      |                                      ^~~~~
      |                                      name
a.cc:15:29: error: 'struct pr' has no member named 'names'; did you mean 'name'?
   15 |       printf("%s %d\n",p[0].names,sum);
      |                             ^~~~~
      |                             name
a.cc:27:12: error: expected '}' at end of input
   27 |   return 0;
      |            ^
a.cc:6:11: note: to match this '{'
    6 | int main(){
      |           ^
Language: C++

typedef struct{
  int time;
  char names[10];
}pr;
int main(){
  int i,n,q,time,sum=0;
  pr p[100000],array;
  scanf("%d %d",&n,&time);
  for(i=0;i<n;i++)scanf("%s %d",p[i].names,&p[i].time);
  while(1){
    if(n==0)break;
    if(p[0].time<=time){
      sum+=p[0].time;
      printf("%s %d\n",p[0].names,sum);
      for(i=1;i<n;i++)p[i-1]=p[i];
      n--;
    }
    else {
      sum+=time;
      p[0].time-=time;
      array=p[0];
            for(i=0;i<n;i++)p[i-1]=p[i];
      p[i-1]=array;
    }
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'scanf' was not declared in this scope
    8 |   scanf("%d %d",&n,&time);
      |   ^~~~~
a.cc:14:7: error: 'printf' was not declared in this scope
   14 |       printf("%s %d\n",p[0].names,sum);
      |       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | typedef struct{
Language: C++

#include<stdio.h>
#include <string.h>
typedef struct{
  int time;
  char names[10];
}pr;
int main(){
  int i,n,q,time,sum=0,head=0;
  pr p[100000],array;
  scanf("%d %d",&n,&time);
  for(i=0;i<n;i++)scanf("%s %d",p[i].names,&p[i].time);
  while(1){
    if(n+1==head)break;
    if(p[head].time<=time){
      sum+=p[head].time;
      printf("%s %d\n",p[head].names,sum);
      head++;
    }
    else {
      sum+=time;
      p[head].time-=time;
      n++;
      strcpy(p[head].names,p[n].names);
      p[n].time=p[head].time;
      head++;
      
    }

  }
  return 0;
}
call


Compiler output:
a.cc:32:1: error: 'call' does not name a type
   32 | call
      | ^~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>

struct task {
    std::string name;
    int time;
    bool done;
};

int main() {
    std::vector<task> queue;
    int n, q;
    int done = 0;
    int time = 0;
    
    // input
    std::ios::sync_with_stdio(false) 
    std::cin >> n >> q;
    for (int i=0; i<n; i++) {
        task temp;
        std::cin >> temp.name >> temp.time;
        temp.done = 0;
        queue.push_back(temp);
    }
    
    auto i = queue.begin();
    while(done < n) {
        if (!i->done) {
            if (i->time > q) {
                i->time -= q;
                time += q;
            } else {
                i->done = 1;
                done++;
                time += i->time;
                std::cout << i->name << " " << time << std::endl;
            }
        }
        
        ++i;
        if (i == queue.end()) i = queue.begin();
    }
}









Compiler output:
a.cc: In function 'int main()':
a.cc:18:37: error: expected ';' before 'std'
   18 |     std::ios::sync_with_stdio(false)
      |                                     ^
      |                                     ;
   19 |     std::cin >> n >> q;
      |     ~~~
Language: 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) == MAX){
    tail = 0;
  } else tail++;
}

P dequeue(){
  x = Q[head];
  if((head+1) == MAX){
    had = 0;
  }
  else head++;
  return x;
}


int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  
  c = 0;
  
  while(1){
    u = dequeue();
    if((u.t-q) > 0){
      u.t -= q;
      enque(u);
      elaps+=q;
    }
    else {
      elaps+=u.t;
      printf("%s %d\n",u.name,elaps);
      c++;
    }
    if(c == n)
      break;
  }
  
  return 0;
}



Compiler output:
a.cc: In function 'void enqueue(P)':
a.cc:15:18: error: 'MAX' was not declared in this scope
   15 |   if((tail+1) == MAX){
      |                  ^~~
a.cc: In function 'P dequeue()':
a.cc:21:3: error: 'x' was not declared in this scope
   21 |   x = Q[head];
      |   ^
a.cc:22:18: error: 'MAX' was not declared in this scope
   22 |   if((head+1) == MAX){
      |                  ^~~
a.cc:23:5: error: 'had' was not declared in this scope; did you mean 'head'?
   23 |     had = 0;
      |     ^~~
      |     head
a.cc: In function 'int main()':
a.cc:47:7: error: 'enque' was not declared in this scope; did you mean 'enqueue'?
   47 |       enque(u);
      |       ^~~~~
      |       enqueue
Language: C++

#include<iostream>
#include<queue>
#include<string>
#include<algorithm>
using namespace std;

int main(){
	int n,q,t;
	string name;
	queue<pair<string,int> > p;
	cin>>n>>q;
	while(n--){
        cin>>name>>t;
        p.push(make_pair(name,t));
    }

    pair<string,int> u;
    int elaps=0;
    int a=0;
    while(!p.emty()){
    	u=p.front();p.pop();
        a=min(q,u.second);
        u.second-=a;
        elaps+=a;
        if(u.second>0)
        	p.push(u);
        else{
        	cout<<u.first<<' '<<elaps<<endl;
        }
    }
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'class std::queue<std::pair<std::__cxx11::basic_string<char>, int> >' has no member named 'emty'; did you mean 'empty'?
   20 |     while(!p.emty()){
      |              ^~~~
      |              empty
Language: C++

#include<iostream>
#include<string>
#include<cstdlib>

#define N 100000
using namespace std;


typedef struct{
  int num[N];
  int head;
  int tail;
}Queque;


//grobal
Queque que;

//add to head position
void Enqueue(int);
//delete head position
void Dequeue(void);
//return now of stck
int front(void);


int main(){
  //format
  que.head=0;
  que.tail=0;

  int pasttime=0;
  int i,n,q,tim=0;
  string name[N];
  int finishcount=0;
  int flag[N];
  int st;

  //load n and q
  cin >>n>>q;

  //load name and time
  for(i=0;i<n;i++){
    cin >>name[i]>>tim;
    Enqueue(tim);
  }

  //format flag
  for(i=0;i<n;i++){
    flag[i]=0;
  }
  
  i=0;

  while(1){
    if(finishcount==n) break;
    //i->n i=0 continue
    else if(i==n){
      i=0;
      continue;
      }
    //flag=1 go next
      else if(flag[i]==1){
      i++;
      continue;
    }
    //load
    st=front();

    if(st>q){
      Enqueue(st-q);
      Dequeue();
      pasttime+=q;
    }

    else{
      Dequeue();
      pasttime+=st;
      flag[i]=1;
      finishcount++;
      //print
      cout <<name[i]<<" "<<pasttime<<endl;
    } 
    
    i++;
  }
    
  
  return 0;
  
}

//add to head position
void Enqueue(int x){
  que.num[que.tail]=x;
  que.tail++;
  if(que.tail==N)tail=0; 
}
//delete head position
void Dequeue(void){
  que.head++;
}
//return now of stck
int front(void){
  return que.num[que.head];
}

Compiler output:
a.cc: In function 'void Enqueue(int)':
a.cc:97:18: error: 'tail' was not declared in this scope
   97 |   if(que.tail==N)tail=0;
      |                  ^~~~
Language: Java

import java.util.*;

//Javaプログラマのためのアルゴリズム とデータ構造p.150~参照
//双方向リストのためのセルを定義したクラス
class CellDouble{
	CellDouble prev;
	CellDouble next;
	Integer data;
	CellDouble(Integer data){
		prev = next = null;
		this.data = data;
	}
}

public class Main {
	Scanner sc = new Scanner(System.in);
	StringBuilder output = new StringBuilder();
	
	//リストの頭へのリンク
	final CellDouble head;
	
	//入力
	int n;		//命令数
	String order;//命令
	int data;	//データ
	
	public ProblemC() {
		//ヘッドノードにはnullを設定した
		head = new CellDouble(null);
		//リストの頭のprevとnextが自分自身をさすように設定した
		head.prev = head.next = head;
	}
	
	//双方向リストの先頭にデータdataを挿入する
	public void insertFirst(Integer data) {
		insertAfter(head, data);
	}
	
	//双方向リストのセルpの直後にデータdataを挿入する
	private void insertAfter(CellDouble p, Integer data) {
		CellDouble x = new CellDouble(data);
		x.prev = p;
		x.next = p.next;
		p.next.prev = x;
		p.next = x;
	}

	//双方向リストの先頭のデータを削除する
	public Integer removeFirst() {
		//要素がなければ例外をスローする
		if( isEmpty() ) {throw new NoSuchElementException("List is empty.");}
		//最初のセルを削除してそこに入っていた値を返す
		CellDouble cell = head.next;
		removeCell(cell);
		return cell.data;
	}
	
	//双方向リストの末尾のデータを削除する
	public Integer removeLast() {
		//要素がなければ例外をスローする
		if( isEmpty() ) {throw new NoSuchElementException("List is empty.");}
		//最後のセルを削除してそこに入っていた値を返す
		CellDouble cell = head.prev;
		removeCell(cell);
		return cell.data;
	}
	
	public void delete(Integer data) {
		CellDouble p = new CellDouble(data);
		//リストの線形探索
		for(CellDouble i = head.next; i != head; i = i.next) {
			if(i.data == p.data) {
				removeCell(i);
				break;
			}
		}
	}
	
	//削除するためのフォローメソッド
	public void removeCell(CellDouble p) {
		p.prev.next = p.next;
		p.next.prev = p.prev;
	}
	
	//双方向リストが空かどうかチェックするメソッド
	//空ならばtrue,そうでないならfalseを返す
	public boolean isEmpty() { return head.next == head; }

	public void input() {
		n = sc.nextInt();
		for(int i=0; i<n; i++) {
			order = sc.next();
			if( order.equals("insert") ) {
				data = sc.nextInt();
				insertFirst(data);
			}else if( order.equals("delete") ) {
				data = sc.nextInt();
				delete(data);
			}
			else if( order.equals("deleteFirst") ) {removeFirst();}
			else{removeLast();}
		}
	}
	
	public void output() {
		for(CellDouble p = head.next; p != head; p = p.next) {
			if(p.next == head) { output.append(p.data); }
			else{ output.append(p.data).append(" "); }
		}
		output.append("\n");
		System.out.print( output.toString() );
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.output();
	}
}


Compiler output:
Main.java:27: error: invalid method declaration; return type required
	public ProblemC() {
	       ^
1 error
Language: Java

import java.util.*;
import java.io.*;
public class Main {
	StringBuilder output = new StringBuilder();
	BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
	
	Deque<Integer> List = new ArrayDeque<Integer>();
	
	int n;
	String order;
	int data;
	
	public void input() throws NumberFormatException, IOException {
		n = Integer.parseInt(input.readLine());
		for(int i=0; i<n; i++) {
			order = input.readLine();
			if( order.charAt(0) == 'i' ) {
				data = Integer.parseInt(order.substring(7));
				List.addFirst(data);
			}else if( order.charAt(0) == 'd' ) {
				data = Integer.parseInt(order.substring(7));
				List.remove(data);
			}
			else if( order.charAt(6) == 'F' ) {List.removeFirst();}
			else{List.removeLast();}
		}
	}
	
	public void output() {
		output.append( List.poll() );
		for(int ans : List) {
			output.append(" ").append(ans);
		}
		System.out.println(output);
	}
	
	public static void main(String[] args) {
		Main obj = new Main();
		obj.input();
		obj.output();
	}
}



Compiler output:
Main.java:39: error: unreported exception IOException; must be caught or declared to be thrown
		obj.input();
		         ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            Node head = new Node();
            Node tail = new Node();
            head.next = tail;
            tail.previous = head;
            while (sc.hasNext()) {
                String[] c_x = sc.nextLine().split(" ");
                if (c_x[0].equals("insert")) {
                    Node n1 = new Node(Integer.parseInt(c_x[1]));
                    Node n2 = head.next;
                    head.next = n1;
                    n2.previous = n1;
                    n1.previous = head;
                    n1.next = n2;
                }
                if (c_x[0].equals("delete")) {
                    Node n1 = head.next;
                    int t = Integer.parseInt(c_x[1]);
                    while (n1.key != -1) {
                        if (n1.key == t) {
                            break;
                        }
                        n1 = n1.next;
                    }
                    n1.previous.next = n1.next;
                    n1.next.previous = n1.previous;
                }
                if (c_x[0].equals("deleteFirst") && head.next != tail) {
                    Node n1 = head.next;
                    n1.previous.next = n1.next;
                    n1.next.previous = n1.previous;
                }
                if (c_x[0].equals("deleteLast") && head.next != tail) {
                    Node n1 = tail.previous;
                    n1.previous.next = n1.next;
                    n1.next.previous = n1.previous;
                }
            }
            Node n1 = head.next;
            StringJoiner sj = new StringJoiner(" ");
            while(n1.key != -1) {
                sj.add(Integer.toString(n1.key));
                n1 = n1.next;
            }
            System.out.println(sj.toString());
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }

    private static class Node {
        Node() {}
        Node(int key) {
            this.key = key;
        }
        int key = -1;
        Node next;
        Node previous;
    }
}



Compiler output:
Main.java:49: error: cannot find symbol
            StringJoiner sj = new StringJoiner(" ");
            ^
  symbol:   class StringJoiner
  location: class Main
Main.java:49: error: cannot find symbol
            StringJoiner sj = new StringJoiner(" ");
                                  ^
  symbol:   class StringJoiner
  location: class Main
2 errors
Language: Java

import java.util.*;

public class DoublyLinkedList {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            int n = Integer.parseInt(sc.nextLine());
            Node head = new Node();
            Node tail = new Node();
            head.next = tail;
            tail.previous = head;
            while (sc.hasNext()) {
                String[] c_x = sc.nextLine().split(" ");
                if (c_x[0].equals("insert")) {
                    Node n1 = new Node(Integer.parseInt(c_x[1]));
                    Node n2 = head.next;
                    head.next = n1;
                    n2.previous = n1;
                    n1.previous = head;
                    n1.next = n2;
                }
                if (c_x[0].equals("delete")) {
                    Node n1 = head.next;
                    int t = Integer.parseInt(c_x[1]);
                    while (n1.key != -1) {
                        if (n1.key == t) {
                            break;
                        }
                        n1 = n1.next;
                    }
                    if (n1.key != -1) {
                        n1.previous.next = n1.next;
                        n1.next.previous = n1.previous;
                    }
                }
                if (c_x[0].equals("deleteFirst") && head.next != tail) {
                    Node n1 = head.next;
                    n1.previous.next = n1.next;
                    n1.next.previous = n1.previous;
                }
                if (c_x[0].equals("deleteLast") && head.next != tail) {
                    Node n1 = tail.previous;
                    n1.previous.next = n1.next;
                    n1.next.previous = n1.previous;
                }
            }
            Node n1 = head.next;
            StringJoiner sj = new StringJoiner(" ");
            while(n1.key != -1) {
                sj.add(Integer.toString(n1.key));
                n1 = n1.next;
            }
            System.out.println(sj.toString());
        } catch (NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }

    private static class Node {
        Node() {}
        Node(int key) {
            this.key = key;
        }
        int key = -1;
        Node next;
        Node previous;
    }
}



Compiler output:
Main.java:3: error: class DoublyLinkedList is public, should be declared in a file named DoublyLinkedList.java
public class DoublyLinkedList {
       ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;

 class Main {

     static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        NodeList node = new NodeList();
        int n = Integer.parseInt(scan.next());
        int x;
        for(int i=0; i<n; i++) {
            switch (scan.next()) {
                case "insert":
                    node.Insert(Integer.parseInt(scan.next()));
                    break;
                case "delete":
                    node.SearchDelete(Integer.parseInt(scan.next()));
                    break;
                case "deleteFirst":
                    node.DeleteFirst();
                    break;
                case "deleteLast":
                    node.DeleteLast();
                    break;
            }
        }
        node.Print();
    }
}

class NodeList{
    NodeList.Node head;

    class Node{
        int key ;
        NodeList.Node right;
        NodeList.Node left;

        Node(int key){
            this.key = key;
        }

        Node(){
            this.key = -1;
        }

         String toString(){
            return Integer.toString(key);
        }

         void printDetail(){
            System.out.println(this.left.key + ' ' + this.key +' ' + this.right.key);
        }
    }

    NodeList(){
        this.head = new NodeList.Node();
        this.head.right = this.head;
        this.head.left = this.head;
    }

     void Insert(int x){
        NodeList.Node newNode = new NodeList.Node(x);
        newNode.right = this.head.right;
        newNode.right.left = newNode;
        this.head.right = newNode;
        newNode.left = this.head;
    }

     void Print(){
        PrintWriter out = new PrintWriter(System.out);
        for(NodeList.Node point = this.head.right; point != this.head.left; point = point.right) {
            out.print(point.key + " ");
        }
        out.println(this.head.left);
        out.flush();
    }

     void PrintAll() {
        System.out.println(this.head);
        NodeList.Node point = this.head.right;
        while(point != this.head) {
            point.printDetail();
            point = point.right;
        }
        System.out.println('\n');
    }

     void Delete(NodeList.Node point){
        point.right.left = point.left;
        point.left.right = point.right;
    }

     void SearchDelete(int x){
        NodeList.Node point = this.head.right;
        while(point != this.head) {
            if(point.key == x) break;
            point = point.right;
        }
        this.Delete(point);
    }

     void DeleteFirst(){
        this.Delete(this.head.right);
    }

    void DeleteLast(){
        this.Delete(this.head.left);
    }

}



Compiler output:
Main.java:49: error: toString() in NodeList.Node cannot override toString() in Object
         String toString(){
                ^
  attempting to assign weaker access privileges; was public
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new scanner(System.in);
        n = sc.nextInt();
        
        
    }
}


Compiler output:
Main.java:5: error: cannot find symbol
        Scanner sc = new scanner(System.in);
                         ^
  symbol:   class scanner
  location: class Main
Main.java:6: error: cannot find symbol
        n = sc.nextInt();
        ^
  symbol:   variable n
  location: class Main
2 errors
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        
        
    }
}


Compiler output:
Main.java:6: error: cannot find symbol
        n = sc.nextInt();
        ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] str = new String[2];
        for(int loop = 0; loop < n; loop++){
            str = sc.nextLint().split(" ");
        }
        
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
            str = sc.nextLint().split(" ");
                    ^
  symbol:   method nextLint()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int loop = 0; loop < n; loop++){
        String str = sc.nextLint().split(" ");
        }
        
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        String str = sc.nextLint().split(" ");
                       ^
  symbol:   method nextLint()
  location: variable sc of type Scanner
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int loop = 0; loop < n; loop++){
        String str = sc.nextLine().split(" ");
        }
        
    }
}


Compiler output:
Main.java:8: error: incompatible types: String[] cannot be converted to String
        String str = sc.nextLine().split(" ");
                                        ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int loop = 0; loop < n; loop++){
        String[] str = sc.nextLine().split(" ");
        if(str[0].equal(" "))
        }
        
    }
}


Compiler output:
Main.java:10: error: illegal start of statement
        }
        ^
1 error
Language: Java

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int loop = 0; loop < n; loop++){
        String[] str = sc.nextLine().split(" ");
        if(str[0].equal("insert")){
            int i = 0;
        }
        }
        
    }
}


Compiler output:
Main.java:9: error: cannot find symbol
        if(str[0].equal("insert")){
                 ^
  symbol:   method equal(String)
  location: class String
1 error
Language: Java

import java.util.*;
import java.io.BufferedReader;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Deque<Integer> dq = new ArrayDeque<Integer>();
        StringBuilder sb = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            int n = sc.nextInt();
            for(int i = 0 ; i < n ; i++){
                String command = br.nextLine();
                if(command.contains("insert"))
                    dq.addFirst(Character.getNumericValue(command.charAt(7)));
                else if(command.contains("deleteFirst"))
                    dq.removeFirst();
                else if(command.contains("deleteLast"))
                    dq.removeLast();
                else
                    dq.remove(Character.getNumericValue(command.charAt(7)));
            }
            System.out.print(dq.removeFirst());
            Iterator i = dq.iterator();
            while(i.hasNext()){
                sb.append(" " + i.next());
            }
            System.out.println(sb);
        }catch(IOException e){}
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                   ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:12: error: cannot find symbol
                String command = br.nextLine();
                                   ^
  symbol:   method nextLine()
  location: variable br of type BufferedReader
Main.java:28: error: cannot find symbol
        }catch(IOException e){}
               ^
  symbol:   class IOException
  location: class Main
3 errors
Language: Java

import java.util.*;
import java.io.BufferedReader;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Deque<Integer> dq = new ArrayDeque<Integer>();
        StringBuilder sb = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            int n = sc.nextInt();
            for(int i = 0 ; i < n ; i++){
                String command = br.readLine();
                if(command.contains("insert"))
                    dq.addFirst(Character.getNumericValue(command.charAt(7)));
                else if(command.contains("deleteFirst"))
                    dq.removeFirst();
                else if(command.contains("deleteLast"))
                    dq.removeLast();
                else
                    dq.remove(Character.getNumericValue(command.charAt(7)));
            }
            System.out.print(dq.removeFirst());
            Iterator i = dq.iterator();
            while(i.hasNext()){
                sb.append(" " + i.next());
            }
            System.out.println(sb);
        }catch(IOException e){}
    }
}


Compiler output:
Main.java:8: error: cannot find symbol
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                                   ^
  symbol:   class InputStreamReader
  location: class Main
Main.java:28: error: cannot find symbol
        }catch(IOException e){}
               ^
  symbol:   class IOException
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.io.*;
public class Main{
    public static void main(String[] args){
        try{
            Scanner sc = new Scanner(System.in);
            Deque<Integer> dq = new ArrayDeque<Integer>();
            StringBuilder sb = new StringBuilder();
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            int n = sc.nextInt();
            for(int i = 0 ; i < n ; i++){
                String command = br.readLine();
                if(command.contains("insert"))
                    ;//dq.addFirst(Character.getNumericValue(command.charAt(7)));
                ;//else if(command.contains("deleteFirst"))
                    ;//dq.removeFirst();
                else if(command.contains("deleteLast"))
                    dq.removeLast();
                else
                    dq.remove(Character.getNumericValue(command.charAt(7)));
            }
        }catch(IOException e){}
    }
}


Compiler output:
Main.java:17: error: 'else' without 'if'
                else if(command.contains("deleteLast"))
                ^
1 error
Language: Java

import java.util.*;
import java.io.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        Deque<Integer> dq = new ArrayDeque<Integer>();
        StringBuilder sb = new StringBuilder();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            int n = sc.nextInt();
            for(int i = 0 ; i < n ; i++){
                String command = br.readLine();
                if(command.equals("deleteFirst"))
                    dq.removeFirst();
                else if(command.equals("deleteLast"))
                    dq.removeLast();
                else{
                    String[] str = command.split(" ",1);
                    if(str[0].equals("delete"))
                        dq.remove(Integer.parseint(str[1]));
                    else
                        dq.addFirst(Integer.parseint(str[1]));
                }
            }
            System.out.print(dq.removeFirst());
            Iterator i = dq.iterator();
            while(i.hasNext()){
                sb.append(" " + i.next());
            }
            System.out.println(sb);
        }catch(IOException e){}
    }
}


Compiler output:
Main.java:20: error: cannot find symbol
                        dq.remove(Integer.parseint(str[1]));
                                         ^
  symbol:   method parseint(String)
  location: class Integer
Main.java:22: error: cannot find symbol
                        dq.addFirst(Integer.parseint(str[1]));
                                           ^
  symbol:   method parseint(String)
  location: class Integer
2 errors