criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.Scanner;



public class Main {
    class Node {
        Node prev, next;
        int value;
    }
    
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        nil.next = nil;
        nil.prev = nil;

        for (int i = 0; i < n; i++) {
            String s = scan.next();
            int x = scan.nextInt();

            if (s.equals("delete")) {
                delete(x);
            } else if (s.equals("insert")) {
                insert(x);
            } else if (s.equals("deleteFirst")) {
                deleteFirst();
            } else if (s.equals("deleteLast")) {
                deleteLast();
            }

            }

        Node nn = nil.next;
        while (nn != nil) {
            System.out.print(nn.value + " ");
            nn = nn.next;
        }

    }

    static void insert(int x) {
        Node n = new Node();
        Node next = nil.next;

        nil.next = n;
        n.next = next;
        n.prev = nil;
        next.prev = n;
        n.value = x;
    }

    static void delete(int x) {
        Node n = nil.next;
        while (n != nil && n.value != x) {
            n = n.next;
        }
        n.prev.next = n.next;
        n.next.prev = n.prev;
    }

    static void deleteFirst() {
        Node next = nil.next.next;
        nil.next = next;
        next.prev = nil;
    }

    static void deleteLast() {
        Node n = nil;
        while (n.next != nil && n != nil) {
            n = n.next;
        }
        Node prev = n.prev;
        prev.next = nil;
        nil.prev = prev;
    }

    static Node nil = new Node();

}



Compiler output:
Main.java:43: error: non-static variable this cannot be referenced from a static context
        Node n = new Node();
                 ^
Main.java:78: error: non-static variable this cannot be referenced from a static context
    static Node nil = new Node();
                      ^
2 errors
Language: Java

public class Main {
    static class Node {
        Node prev, next;
        int value;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        nil.next = nil;
        nil.prev = nil;

        for (int i = 0; i < n; i++) {
            String s = scan.next();
            int x = scan.nextInt();

            if (s.equals("delete")) {
                delete(x);
            } else if (s.equals("insert")) {
                insert(x);
            } else if (s.equals("deleteFirst")) {
                deleteFirst();
            } else if (s.equals("deleteLast")) {
                deleteLast();
            }

            }

        Node nn = nil.next;
        while (nn != nil) {
            System.out.print(nn.value + " ");
            nn = nn.next;
        }

    }

    static void insert(int x) {
        Node n = new Node();
        Node next = nil.next;

        nil.next = n;
        n.next = next;
        n.prev = nil;
        next.prev = n;
        n.value = x;
    }

    static void delete(int x) {
        Node n = nil.next;
        while (n != nil && n.value != x) {
            n = n.next;
        }
        n.prev.next = n.next;
        n.next.prev = n.prev;
    }

    static void deleteFirst() {
        Node next = nil.next.next;
        nil.next = next;
        next.prev = nil;
    }

    static void deleteLast() {
        Node n = nil;
        while (n.next != nil && n != nil) {
            n = n.next;
        }
        Node prev = n.prev;
        prev.next = nil;
        nil.prev = prev;
    }

    static Node nil = new Node();

}



Compiler output:
Main.java:8: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:8: error: cannot find symbol
        Scanner scan = new Scanner(System.in);
                           ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java


import java.util.Scanner;


public class Main {
    static class Node {
        Node prev, next;
        int value;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        nil.next = nil;
        nil.prev = nil;

        for (int i = 0; i < n; i++) {
            String s = scan.next();

                       if (s.equals("delete")) {
                int x = scan.nextInt();
//                delete(x);
                l.remove(x);
            } else if (s.equals("insert")) {
                int x = scan.nextInt();
//                insert(x);
                l.add(0,x);
            } else if (s.equals("deleteFirst")) {
//                deleteFirst();
                l.remove(0);
            } else if (s.equals("deleteLast")) {
//                deleteLast();
                l.remove(l.size());
            }
        }

        Node nn = nil.next;
        while (nn != nil) {
            System.out.print(nn.value);
            if (nn. next != nil) {
                System.out.print(" ");
            }
            nn = nn.next;
        }
        System.out.println();
    }

    static void insert(int x) {
        Node n = new Node();
        Node next = nil.next;

        nil.next = n;
        n.next = next;
        n.prev = nil;
        next.prev = n;
        n.value = x;
    }

    static void delete(int x) {
        Node n = nil.next;
        while (n != nil && n.value != x) {
            n = n.next;
        }
        if (n == nil) {
            return;
        }
        n.prev.next = n.next;
        n.next.prev = n.prev;
    }

    static void deleteFirst() {
        Node next = nil.next.next;
        nil.next = next;
        next.prev = nil;
    }

    static void deleteLast() {
        Node n = nil.next;
        while (n.next != nil && n != nil) {
            n = n.next;
        }
        Node prev = n.prev;
        prev.next = nil;
        nil.prev = prev;
    }

    static Node nil = new Node();

}




Compiler output:
Main.java:24: error: cannot find symbol
                l.remove(x);
                ^
  symbol:   variable l
  location: class Main
Main.java:28: error: cannot find symbol
                l.add(0,x);
                ^
  symbol:   variable l
  location: class Main
Main.java:31: error: cannot find symbol
                l.remove(0);
                ^
  symbol:   variable l
  location: class Main
Main.java:34: error: cannot find symbol
                l.remove(l.size());
                ^
  symbol:   variable l
  location: class Main
Main.java:34: error: cannot find symbol
                l.remove(l.size());
                         ^
  symbol:   variable l
  location: class Main
5 errors
Language: Java


import java.util.Scanner;


public class Main {
    static class Node {
        Node prev, next;
        int value;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        nil.next = nil;
        nil.prev = nil;
        List<Integer> l;

        for (int i = 0; i < n; i++) {
            String s = scan.next();

                       if (s.equals("delete")) {
                int x = scan.nextInt();
//                delete(x);
                l.remove(x);
            } else if (s.equals("insert")) {
                int x = scan.nextInt();
//                insert(x);
                l.add(0,x);
            } else if (s.equals("deleteFirst")) {
//                deleteFirst();
                l.remove(0);
            } else if (s.equals("deleteLast")) {
//                deleteLast();
                l.remove(l.size());
            }
        }

        Node nn = nil.next;
        while (nn != nil) {
            System.out.print(nn.value);
            if (nn. next != nil) {
                System.out.print(" ");
            }
            nn = nn.next;
        }
        System.out.println();
    }

    static void insert(int x) {
        Node n = new Node();
        Node next = nil.next;

        nil.next = n;
        n.next = next;
        n.prev = nil;
        next.prev = n;
        n.value = x;
    }

    static void delete(int x) {
        Node n = nil.next;
        while (n != nil && n.value != x) {
            n = n.next;
        }
        if (n == nil) {
            return;
        }
        n.prev.next = n.next;
        n.next.prev = n.prev;
    }

    static void deleteFirst() {
        Node next = nil.next.next;
        nil.next = next;
        next.prev = nil;
    }

    static void deleteLast() {
        Node n = nil.next;
        while (n.next != nil && n != nil) {
            n = n.next;
        }
        Node prev = n.prev;
        prev.next = nil;
        nil.prev = prev;
    }

    static Node nil = new Node();

}




Compiler output:
Main.java:17: error: cannot find symbol
        List<Integer> l;
        ^
  symbol:   class List
  location: class Main
1 error
Language: Java


import java.util.Scanner;


public class Main {
    static class Node {
        Node prev, next;
        int value;
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();

        nil.next = nil;
        nil.prev = nil;
        List<Integer> l = new ArrayList<Integer>();
        for (int i = 0; i < n; i++) {
            String s = scan.next();

                       if (s.equals("delete")) {
                int x = scan.nextInt();
//                delete(x);
                l.remove(x);
            } else if (s.equals("insert")) {
                int x = scan.nextInt();
//                insert(x);
                l.add(0,x);
            } else if (s.equals("deleteFirst")) {
//                deleteFirst();
                l.remove(0);
            } else if (s.equals("deleteLast")) {
//                deleteLast();
                l.remove(l.size());
            }
        }

        Node nn = nil.next;
        while (nn != nil) {
            System.out.print(nn.value);
            if (nn. next != nil) {
                System.out.print(" ");
            }
            nn = nn.next;
        }
        System.out.println();
    }

    static void insert(int x) {
        Node n = new Node();
        Node next = nil.next;

        nil.next = n;
        n.next = next;
        n.prev = nil;
        next.prev = n;
        n.value = x;
    }

    static void delete(int x) {
        Node n = nil.next;
        while (n != nil && n.value != x) {
            n = n.next;
        }
        if (n == nil) {
            return;
        }
        n.prev.next = n.next;
        n.next.prev = n.prev;
    }

    static void deleteFirst() {
        Node next = nil.next.next;
        nil.next = next;
        next.prev = nil;
    }

    static void deleteLast() {
        Node n = nil.next;
        while (n.next != nil && n != nil) {
            n = n.next;
        }
        Node prev = n.prev;
        prev.next = nil;
        nil.prev = prev;
    }

    static Node nil = new Node();

}




Compiler output:
Main.java:17: error: cannot find symbol
        List<Integer> l = new ArrayList<Integer>();
        ^
  symbol:   class List
  location: class Main
Main.java:17: error: cannot find symbol
        List<Integer> l = new ArrayList<Integer>();
                              ^
  symbol:   class ArrayList
  location: class Main
2 errors
Language: Java

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

class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Node head = new Node(0, null, null);
        int size = 0;

        for (int i = 0; i < n; i++) {
            String command = sc.next();
            int key;

            switch(command) {
              case "insert" :
                  key = sc.nextInt();
                  insert(key, head, size);
                  size++;
                  break;
              case "delete" :
                  key = sc.nextInt();
                  if(delete(key, head, size) != null) {
                      size--;
                  }
                  break;
              case "deleteFirst" :
                  deleteFirst(head);
                  size--;
                  break;
              case "deleteLast" :
                  deleteLast(head);
                  size--;
                  break;
            }
        }

        Node node = head.next;
        while (true) {
            System.out.print(node.key);
            node = node.next;

            if (node == head) {
                System.out.println();
                break;
            }

            System.out.print(" ");
        }
    }

    public static Node insert(int key, Node head, int size) {
        Node node = new Node(key, head.next, head);
        head.next = node;

        if (size == 0) {
            head.pre = node;
            node.next = head;
        } else {
            node.next.pre = node;
        }

        return node;
    }

    public static Node delete(int key, Node head, int size) {
      Node node = head.next;
      while (true) {
          if (key == node.key) {
              node.pre.next = node.next;
              node.next.pre = node.pre;
              return node;
          }

          node = node.next;
          if (node == head) {
              return null;
          }
      }
    }

    public static Node deleteFirst(Node head) {
        head.next = head.next.next;
        head.next.pre = head;
        return deletedNode;
    }

    public static Node deleteLast(Node head) {
        head.pre = head.pre.pre;
        head.pre.next = head;
        return deletedNode;
    }
}

class Node {
    int key;
    Node next;
    Node pre;

    public Node(int key, Node next, Node pre) {
        this.key = key;
        this.next = next;
        this.pre = pre;
    }
}



Compiler output:
Main.java:86: error: cannot find symbol
        return deletedNode;
               ^
  symbol:   variable deletedNode
  location: class Main
Main.java:92: error: cannot find symbol
        return deletedNode;
               ^
  symbol:   variable deletedNode
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.lang.Integer;

class Main{
  public static void main(String args[])throws Exception{
    Scanner sc = new Scanner(System.in);
    short n = sc.nextInt();
    ControlList doubly_list = new ControlList();
    for(int i = 0 ; i<n; i++){
      String [] s = sc.nextLine().split("\\s+");
      if(s[0].equals("insert")){
        doubly_list.insert(Integer.valueOf(s[1]));
      }else if(s[0].equals("delete")){
        doubly_list.delete(Integer.valueOf(s[1]));
      }else if(s[0].equals("deleteFirst")){
        doubly_list.deleteFirst();
      }else{
        doubly_list.deleteLast();
      }
    }
    doubly_list.Print_list();
  }
}
//list操作
class ControlList{
  private List dummy;
  public ControlList(){
    dummy = new List();
    dummy.setnext(dummy);
    dummy.setprevious(dummy);
  }
  //insert
  public void insert(int n){
    List list = new List(n);
    list.setnext(dummy.getnext());
    dummy.getnext().setprevious(list);
    dummy.setnext(list);
    list.setprevious(dummy);
  }
  //ノードの削除メソッド
  public void deleteNode(List delete){
    if( delete == dummy)return;
    delete.getprevious().setnext(delete.getnext());
    delete.getnext().setprevious(delete.getprevious());
  }
  //指定したノードの削除
  public void delete(int n){
    deleteNode(listSearch(n));
  }
  //firstnode削除
  public void deleteFirst(){
    deleteNode(dummy.getnext());
  }
  //lastnode削除
  public void deleteLast(){
    deleteNode(dummy.getprevious());
  }
  //keyを使ってノードを探索
  public List listSearch(int n){
    List cur = dummy.getnext();
    while(cur.getdata()!=n && cur!=dummy){
      cur = cur.getnext();
    }
    return cur;
  }
  //printメソッド
  public void Print_list(){
    List list = dummy.getnext();
    if(list != dummy){
      System.out.printf("%d",list.getdata());
      list = list.getnext();
    }
    while(list!=dummy){
      System.out.printf(" %d",list.getdata());
      list = list.getnext();
    }
    System.out.println();
  }
}


//listの構造体的役割
class List{
  private short data;
  private List next;
  private List previous;

  public List(){
  }

  public List(int n){
    this.data = n;
  }

  public List getnext(){
    return this.next;
  }

  public void setnext(List n){
    this.next = n;
  }

  public List getprevious(){
    return previous;
  }

  public void setprevious(List p){
    this.previous = p;
  }

  public int getdata(){
    return data;
  }
}



Compiler output:
Main.java:7: error: incompatible types: possible lossy conversion from int to short
    short n = sc.nextInt();
                        ^
Main.java:92: error: incompatible types: possible lossy conversion from int to short
    this.data = n;
                ^
2 errors
Language: Java

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Node head = new Node(0, null, null);
        head.next = head;
        head.pre = head;
        int size = 0;

        for (int i = 0; i < n; i++) {
            String command = sc.next();
            int key;

            switch(command.charAt(0)) {
              case "i" :
                  key = sc.nextInt();
                  insert(key, head, size);
                  size++;
                  break;
              case "d" :
                  switch(command.length) {
                      case 6:
                        key = sc.nextInt();
                        if(delete(key, head, size) != null) {
                            size--;
                        }
                        break;

                        case 11 :
                            deleteFirst(head);
                            size--;
                            break;
                        case 10 :
                            deleteLast(head);
                            size--;
                            break;
                  }
            }
        }

        Node node = head.next;
        while (true) {
            System.out.print(node.key);
            node = node.next;

            if (node == head) {
                System.out.println();
                break;
            }

            System.out.print(" ");
        }
    }

    public static Node insert(int key, Node head, int size) {
        Node node = new Node(key, head.next, head);
        head.next.pre = node;
        head.next = node;

        return node;
    }

    public static Node delete(int key, Node head, int size) {
      Node node = head.next;
      while (true) {
          if (key == node.key) {
              node.pre.next = node.next;
              node.next.pre = node.pre;
              return node;
          }

          node = node.next;
          if (node == head) {
              return null;
          }
      }
    }

    public static void deleteFirst(Node head) {
        head.next = head.next.next;
        head.next.pre = head;
    }

    public static void deleteLast(Node head) {
        head.pre = head.pre.pre;
        head.pre.next = head;
    }
}

class Node {
    int key;
    Node next;
    Node pre;

    public Node(int key, Node next, Node pre) {
        this.key = key;
        this.next = next;
        this.pre = pre;
    }
}



Compiler output:
Main.java:17: error: incompatible types: String cannot be converted to char
              case "i" :
                   ^
Main.java:22: error: incompatible types: String cannot be converted to char
              case "d" :
                   ^
Main.java:23: error: cannot find symbol
                  switch(command.length) {
                                ^
  symbol:   variable length
  location: variable command of type String
3 errors
Language: Java

import java.util.*;
import java.io.*;
import java.lang.Integer;

class Main{
  static List dummy;

  public static void main(String args[])throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    ControlList doubly_list = new ControlList();
    for(int i = 0 ; i<n; i++){
      String [] s = br.readLine().split("\\s+");
      if(s[0].charAt(0)=='i'){
        insert(Integer.valueOf(s[1]));
      }else if(s[0].length()>6){
        if(s[0].charAt(6)=='F'){
          deleteFirst();
        }else if(s[0].charAt(6)=='L'){
          deleteLast();
        }
      }else{
        delete(Integer.valueOf(s[1]));
      }
    }
    Print_list();
  }
  static void init(){
    dummy = new List();
    dummy.setnext(dummy);
    dummy.setprevious(dummy);
  }
  //insert
  static void insert(int n){
    List list = new List(n);
    list.setnext(dummy.getnext());
    dummy.getnext().setprevious(list);
    dummy.setnext(list);
    list.setprevious(dummy);
  }
  //ノードの削除メソッド
  static void deleteNode(List delete){
    if( delete == dummy)return;
    delete.getprevious().setnext(delete.getnext());
    delete.getnext().setprevious(delete.getprevious());
  }
  //指定したノードの削除
  static void delete(int n){
    deleteNode(listSearch(n));
  }
  //firstnode削除
  static void deleteFirst(){
    deleteNode(dummy.getnext());
  }
  //lastnode削除
  static void deleteLast(){
    deleteNode(dummy.getprevious());
  }
  //keyを使ってノードを探索
  static List listSearch(int n){
    List cur = dummy.getnext();
    while(cur.getdata()!=n && cur!=dummy){
      cur = cur.getnext();
    }
    return cur;
  }
  //printメソッド
  static void Print_list(){
    List list = dummy.getnext();
    if(list != dummy){
      System.out.printf("%d",list.getdata());
      list = list.getnext();
    }
    while(list!=dummy){
      System.out.printf(" %d",list.getdata());
      list = list.getnext();
    }
    System.out.println();
  }
}
//list操作


//listの構造体的役割
class List{
  private int data;
  private List next;
  private List previous;

  public List(){
  }

  public List(int n){
    this.data = n;
  }

  public List getnext(){
    return this.next;
  }

  public void setnext(List n){
    this.next = n;
  }

  public List getprevious(){
    return previous;
  }

  public void setprevious(List p){
    this.previous = p;
  }

  public int getdata(){
    return data;
  }
}


Compiler output:
Main.java:11: error: cannot find symbol
    ControlList doubly_list = new ControlList();
    ^
  symbol:   class ControlList
  location: class Main
Main.java:11: error: cannot find symbol
    ControlList doubly_list = new ControlList();
                                  ^
  symbol:   class ControlList
  location: class Main
2 errors
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.next = nil;
        nil.prev = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next.prev = n;
        this.nil.next = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        Node<T> newHead = this.nil.prev.prev;
        newHead.next = this.nil;
        this.nil.prev = newHead;
    }

    public List<T> keys() {
        List<T> keys = new ArrayList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();;
            switch(char[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                try {
                    switch(command[6]) {
                    case 'F':
                        L.deleteFirst();
                        break;
                    case 'F':
                        L.deleteFirst();
                        break;
                    }
                } catch(Exception e) {
                    L.delete(sc.nextInt())
                }
            }
        }

        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));
    }
}



Compiler output:
Main.java:69: error: ']' expected
            switch(char[0]) {
                        ^
Main.java:69: error: case, default, or '}' expected
            switch(char[0]) {
                         ^
Main.java:69: error: case, default, or '}' expected
            switch(char[0]) {
                          ^
Main.java:69: error: case, default, or '}' expected
            switch(char[0]) {
                            ^
Main.java:84: error: ';' expected
                    L.delete(sc.nextInt())
                                          ^
5 errors
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.next = nil;
        nil.prev = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next.prev = n;
        this.nil.next = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        Node<T> newHead = this.nil.prev.prev;
        newHead.next = this.nil;
        this.nil.prev = newHead;
    }

    public List<T> keys() {
        List<T> keys = new ArrayList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();;
            switch(command[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                try {
                    switch(command[6]) {
                    case 'F':
                        L.deleteFirst();
                        break;
                    case 'F':
                        L.deleteFirst();
                        break;
                    }
                } catch(Exception e) {
                    L.delete(sc.nextInt())
                }
            }
        }

        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));
    }
}



Compiler output:
Main.java:84: error: ';' expected
                    L.delete(sc.nextInt())
                                          ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.next = nil;
        nil.prev = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next.prev = n;
        this.nil.next = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        Node<T> newHead = this.nil.prev.prev;
        newHead.next = this.nil;
        this.nil.prev = newHead;
    }

    public List<T> keys() {
        List<T> keys = new ArrayList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();
            switch(command[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                try {
                    switch(command[6]) {
                    case 'F':
                        L.deleteFirst();
                        break;
                    case 'F':
                        L.deleteFirst();
                        break;
                    }
                } catch(Exception e) {
                    L.delete(sc.nextInt());
                }
            }
        }

        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));
    }
}



Compiler output:
Main.java:79: error: duplicate case label
                    case 'F':
                    ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.next = nil;
        nil.prev = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next.prev = n;
        this.nil.next = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        Node<T> newHead = this.nil.prev.prev;
        newHead.next = this.nil;
        this.nil.prev = newHead;
    }

    public List<T> keys() {
        List<T> keys = new ArrayList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();
            switch(command[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                try {
                    switch(command[6]) {
                    case 'F':
                        L.deleteFirst();
                        break;
                    case 'L':
                        L.deleteLirst();
                        break;
                    }
                } catch(Exception e) {
                    L.delete(sc.nextInt());
                }
            }
        }

        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));
    }
}



Compiler output:
Main.java:80: error: cannot find symbol
                        L.deleteLirst();
                         ^
  symbol:   method deleteLirst()
  location: variable L of type DoublyLinkedList<Integer>
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.next = nil;
        nil.prev = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next.prev = n;
        this.nil.next = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        Node<T> newHead = this.nil.prev.prev;
        newHead.next = this.nil;
        this.nil.prev = newHead;
    }

    public List<T> keys() {
        List<T> keys = new ArrayList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();
            switch(command[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                    switch(command.length) {
                    case 6:
                        L.delete(sc.nextInt());
                        break;
                    case 11:
                        L.deleteFirst();
                        break;
                    case 10:
                        L.deleteLast();
                        break;
                    }
                }
            }
        }

        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));
    }
}



Compiler output:
Main.java:89: error: <identifier> expected
        System.out.println(L.keys().stream()
                          ^
Main.java:89: error: <identifier> expected
        System.out.println(L.keys().stream()
                                 ^
Main.java:93: error: class, interface, enum, or record expected
}
^
3 errors
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class Main {
    static Node nil = new Node();

    static class Node {
        Integer key;
        Node next;
        Node prev;
    }

    static void insert(Integer key) {
        Node n = new Node();
        n.key = key;
        n.next = nil.next;
        nil.next = nil.next.prev = n;
        n.prev = nil;
    }

    static void delete(Integer key) {
        for (Node n = nil.next; n != nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    static void deleteFirst() {
        nil.next = nil.next.next;
        nil.next.prev = nil;
    }

    static void deleteLast() {
        nil.prev.prev.next = nil;
        nil.prev = nil.prev.prev;
    }

    static List<Integer> keys() {
        List<Integer> keys = new ArrayList<Integer>();
        for (Node n = nil.next; n != nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        nil.prev = nil.next = nil;
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();
            switch(command[0]) {
            case 'i':
                  insert(sc.nextInt());
                  break;
            default :
                switch(command.length) {
                case 6:
                    delete(sc.nextInt());
                    break;
                case 11:
                    deleteFirst();
                    break;
                case 10:
                    deleteLast();
                    break;
                }
            }
        }

        String s = "";
        for (Node node = nil.next;; node = node.next) {
            if (node.next != nil) {
                s += node.key + " ");
            } else {
                System.out.println(s + node.key);
                break;
            }
        }

    }
}



Compiler output:
Main.java:81: error: ';' expected
                s += node.key + " ");
                                   ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Stream;
import static java.util.stream.Collectors.joining;

class DoublyLinkedList<T> {
    public Node<T> nil;

    class Node<T> {
        public T key;
        public Node<T> next;
        public Node<T> prev;
    }

    DoublyLinkedList() {
        nil = new Node<T>();
        nil.prev = nil.next = nil;
    }

    public void insert(T key) {
        Node<T> n = new Node<>();
        n.key = key;
        n.next = this.nil.next;
        this.nil.next = this.nil.next.prev = n;
        n.prev = this.nil;
    }

    public void delete(T key) {
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            if (n.key.equals(key)) {
                n.prev.next = n.next;
                n.next.prev = n.prev;
                return;
            }
        }
    }

    public void deleteFirst() {
        this.nil.next = this.nil.next.next;
        this.nil.next.prev = this.nil;
    }

    public void deleteLast() {
        this.nil.prev.prev.next = this.nil;
        this.nil.prev = this.nil.prev.prev;
    }

    public LinkedList<T> keys() {
        LisLinkedListt<T> keys = new LinkedList<T>();
        for (Node<T> n = this.nil.next; n != this.nil; n = n.next) {
            keys.add(n.key);
        }
        return keys;
    }
}

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        DoublyLinkedList<Integer> L = new DoublyLinkedList<>();
        int n = sc.nextInt();

        for (int i = 0; i < n; i++) {
            char[] command = sc.next().toCharArray();
            switch(command[0]) {
            case 'i':
                  L.insert(sc.nextInt());
                  break;
            case 'd':
                switch(command.length) {
                case 6:
                    L.delete(sc.nextInt());
                    break;
                case 11:
                    L.deleteFirst();
                    break;
                case 10:
                    L.deleteLast();
                    break;
                }
            }
        }
        System.out.println(L.keys().stream()
                .map(Object::toString)
                .collect(joining(" ")));

    }
}



Compiler output:
Main.java:49: error: cannot find symbol
    public LinkedList<T> keys() {
           ^
  symbol:   class LinkedList
  location: class DoublyLinkedList<T>
  where T is a type-variable:
    T extends Object declared in class DoublyLinkedList
Main.java:50: error: cannot find symbol
        LisLinkedListt<T> keys = new LinkedList<T>();
        ^
  symbol:   class LisLinkedListt
  location: class DoublyLinkedList<T>
  where T is a type-variable:
    T extends Object declared in class DoublyLinkedList
Main.java:50: error: cannot find symbol
        LisLinkedListt<T> keys = new LinkedList<T>();
                                     ^
  symbol:   class LinkedList
  location: class DoublyLinkedList<T>
  where T is a type-variable:
    T extends Object declared in class DoublyLinkedList
3 errors
Language: Java

import java.util.*;
import java.io.*;
//fastest
class Main{
  static List dummy;

  public static void main(String args[])throws Exception{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    init();
    int i;
    for(i = n ; i>0; i--){
      String s = br.readLine();
      if(s.charAt(0)=='i'){
        insert(s.substring(s.indexOf(" ") + 1));
      }else if(s.charAt(6)=='F'){
        deleteFirst();
      }else if(s.charAt(6)=='L'){
        deleteLast();
      }else{
        delete(s.substring(s.indexOf(" ") + 1));
      }
    }
    Print_list();
  }
  static void init(){
    dummy = new List();
    dummy.next=dummy;
    dummy.previous=dummy;
  }
  //insert
  static void insert(int n){
    List list = new List(n);
    list.next=dummy.next;
    dummy.next.previous=list;
    dummy.next=list;
    list.previous=dummy;
  }
  //ノードの削除メソッド
  static void deleteNode(List delete){
    if( delete == dummy)return;
    delete.previous.next=delete.next;
    delete.next.previous=delete.previous;
  }
  //指定したノードの削除
  static void delete(int n){
    deleteNode(listSearch(n));
  }
  //firstnode削除
  static void deleteFirst(){
    deleteNode(dummy.next);
  }
  //lastnode削除
  static void deleteLast(){
    deleteNode(dummy.previous);
  }
  //keyを使ってノードを探索
  static List listSearch(int n){
    List cur = dummy.next;
    while(cur.data!=n && cur!=dummy){
      cur = cur.next;
    }
    return cur;
  }
  //printメソッド
  static void Print_list(){
    List list = dummy.next;
    if(list != dummy){
      System.out.printf("%d",list.data);
      list = list.next;
    }
    while(list!=dummy){
      System.out.printf(" %d",list.data);
      list = list.next;
    }
    System.out.println();
  }
}
//listの構造体的役割
class List{
  public int data;
  public List next;
  public List previous;

  public List(){}
    public List(int n){
      this.data = n;
    }
  }



Compiler output:
Main.java:15: error: incompatible types: String cannot be converted to int
        insert(s.substring(s.indexOf(" ") + 1));
                          ^
Main.java:21: error: incompatible types: String cannot be converted to int
        delete(s.substring(s.indexOf(" ") + 1));
                          ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

mport java.util.*;
public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static Deque<Integer> list = new ArrayDeque<>();
	public static int len = 0;
	public static void main(String[] args) {
		int i;
		int n = sc.nextInt();
		for(i = 0; i <= n; i++){
			String[] order = (sc.nextLine()).split(" ");
			if(order[0].equals("insert")){
				list.push(Integer.parseInt(order[1]));
			}
			else if(order[0].equals("delete")){
				list.remove(Integer.parseInt(order[1]));
			}
			else if(order[0].equals("deleteFirst")){
				list.removeFirst();
			}
			else if(order[0].equals("deleteLast")){
				list.removeLast();
			}
		}
		StringBuilder builder = new StringBuilder();
        builder.append(list.poll());
        for(int x : list)
        {
            builder.append(" ").append(x);
        }
        System.out.println(builder);
	}
}


Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: Java

mport java.util.*;
public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static Deque<Integer> list = new ArrayDeque<>();
	public static int len = 0;
	public static void main(String[] args) {
		int i;
		int n = sc.nextInt();
		for(i = 0; i <= n; i++){
			String[] order = (sc.nextLine()).split(" ");
			if(order[0].equals("insert")){
				list.push(Integer.parseInt(order[1]));
			}
			else if(order[0].equals("delete")){
				list.remove(Integer.parseInt(order[1]));
			}
			else if(order[0].equals("deleteFirst")){
				list.removeFirst();
			}
			else if(order[0].equals("deleteLast")){
				list.removeLast();
			}
		}
		StringBuilder builder = new StringBuilder();
        builder.append(list.poll());
        for(int x : list)
        {
            builder.append(" ").append(x);
        }
        System.out.println(builder);
	}
}



Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: Java

import java.util.*;

class Node {
    public int key;
    public Node next, pre;
    Node(int key) {
        this.key = key;
        next = pre = null;
    }
}

public class C {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        Node head = new Node(0);
        Node last = new Node(0);
        head.next = last;
        last.pre = head;
        while(N-- > 0) {
            String ope = scan.next();
            if(ope.equals("insert")) {
                int num = scan.nextInt();
                Node node = new Node(num);
                node.pre = head;
                node.next = head.next;
                node.pre.next = node;
                node.next.pre = node;
            } else if(ope.equals("delete")) {
                int num = scan.nextInt();
                for(Node p = head.next; p != last; p = p.next) {
                    if(p.key == num) {
                        p.pre.next = p.next;
                        p.next.pre = p.pre;
                        break;
                    }
                }
            } else if(ope.equals("deleteFirst")) {
                head.next.next.pre = head;
                head.next = head.next.next;
            } else if(ope.equals("deleteLast")) {
                last.pre.pre.next = last;
                last.pre = last.pre.pre;
            }
        }
        for(Node p = head.next; p != last; p = p.next) {
            if(p != head.next) System.out.print(" ");
            System.out.print(p.key);
        }
        System.out.println();
    }
}
a

Compiler output:
Main.java:53: error: reached end of file while parsing
a
^
1 error