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

#include <iostream>
#include <string>

enum face {
  TOP,
  BOTTOM,
  FRONT,
  BACK,
  LEFT,
  RIGHT
};

class dice {
  public:
    dice();
    void setDice(int spot, face eye);
    int getSpot(int top);
    void rollNorth();
    void rollSouth();
    void rollEast();
    void rollWest();

  private:
    void roll(face a, face b, face c, face d);
    const int six = 6;
    int id[six];
};

void dice::setDice(int d, face eye) {
  id[eye] = spot;
}

int dice::getSpot(int top) {
  return id[top];
}

void dice::rollNorth() {
  roll(TOP, FRONT, BOTTOM, BACK);
}

void dice::rollSouth() {
  roll(TOP, BACK, BOTTOM, FRONT);
}

void dice::rollEast() {
  roll(TOP, LEFT, BOTTOM, RIGHT);
}

void dice::rollWest() {
  roll(TOP, RIGHT, BOTTOM, Left);
}

void dice::roll(face a, face b, face c, face d) {
  int tmp = a;
  a = b;
  b = c;
  c = d;
  d = tmp;
}

int main() {
  int d;
  dice di;
  for(int i = 0; i < six; ++i) {
    std::cin >> d;
    di.setDice(d, i);
  }

  std::string commands;
  std::getline(std::cin, commands);

  int index = 0;
  for(int i = 0; commands[i] != '\0'; ++i) {
    if(commands[i] == 'N') di.rollNorth();
    if(commands[i] == 'S') di.rollSouth();
    if(commands[i] == 'E') di.rollEast();
    if(commands[i] == 'W') di.rollWest();
  }
  d = di.getSpot(TOP);
  std::cout << d << std::endl;

  return 0;
}

Compiler output:
a.cc:26:12: error: invalid use of non-static data member 'dice::six'
   26 |     int id[six];
      |            ^~~
a.cc:25:15: note: declared here
   25 |     const int six = 6;
      |               ^~~
a.cc: In member function 'void dice::setDice(int, face)':
a.cc:30:3: error: 'id' was not declared in this scope; did you mean 'd'?
   30 |   id[eye] = spot;
      |   ^~
      |   d
a.cc:30:13: error: 'spot' was not declared in this scope
   30 |   id[eye] = spot;
      |             ^~~~
a.cc: In member function 'int dice::getSpot(int)':
a.cc:34:10: error: 'id' was not declared in this scope; did you mean 'void'?
   34 |   return id[top];
      |          ^~
      |          void
a.cc: In member function 'void dice::rollWest()':
a.cc:50:28: error: 'Left' was not declared in this scope
   50 |   roll(TOP, RIGHT, BOTTOM, Left);
      |                            ^~~~
a.cc: In member function 'void dice::roll(face, face, face, face)':
a.cc:58:7: error: invalid conversion from 'int' to 'face' [-fpermissive]
   58 |   d = tmp;
      |       ^~~
      |       |
      |       int
a.cc: In function 'int main()':
a.cc:64:22: error: 'six' was not declared in this scope
   64 |   for(int i = 0; i < six; ++i) {
      |                      ^~~
a.cc:66:19: error: invalid conversion from 'int' to 'face' [-fpermissive]
   66 |     di.setDice(d, i);
      |                   ^
      |                   |
      |                   int
a.cc:29:32: note:   initializing argument 2 of 'void dice::setDice(int, face)'
   29 | void dice::setDice(int d, face eye) {
      |                           ~~~~~^~~
Language: C++

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

enum face {
  TOP,
  BOTTOM,
  FRONT,
  BACK,
  LEFT,
  RIGHT
};

class dice {
  public:
    dice();
    void setDice(int spot, face eye);
    int getSpot(int top);
    void rollNorth();
    void rollSouth();
    void rollEast();
    void rollWest();

  private:
    void roll(face a, face b, face c, face d);
    std::vector<int> id(6); // cubic
};

void dice::setDice(int d, face eye) {
  id[eye] = spot;
}

int dice::getSpot(int top) {
  return id[top];
}

void dice::rollNorth() {
  roll(TOP, FRONT, BOTTOM, BACK);
}

void dice::rollSouth() {
  roll(TOP, BACK, BOTTOM, FRONT);
}

void dice::rollEast() {
  roll(TOP, LEFT, BOTTOM, RIGHT);
}

void dice::rollWest() {
  roll(TOP, RIGHT, BOTTOM, Left);
}

void dice::roll(face a, face b, face c, face d) {
  int tmp = a;
  a = b;
  b = c;
  c = d;
  d = tmp;
}

int main() {
  int d;
  dice di;
  for(int i = 0; i < six; ++i) {
    std::cin >> d;
    di.setDice(d, i);
  }

  std::string commands;
  std::getline(std::cin, commands);

  int index = 0;
  for(int i = 0; commands[i] != '\0'; ++i) {
    if(commands[i] == 'N') di.rollNorth();
    if(commands[i] == 'S') di.rollSouth();
    if(commands[i] == 'E') di.rollEast();
    if(commands[i] == 'W') di.rollWest();
  }
  d = di.getSpot(TOP);
  std::cout << d << std::endl;

  return 0;
}

Compiler output:
a.cc:26:25: error: expected identifier before numeric constant
   26 |     std::vector<int> id(6); // cubic
      |                         ^
a.cc:26:25: error: expected ',' or '...' before numeric constant
a.cc: In member function 'void dice::setDice(int, face)':
a.cc:30:5: error: invalid types '<unresolved overloaded function type>[face]' for array subscript
   30 |   id[eye] = spot;
      |     ^
a.cc:30:13: error: 'spot' was not declared in this scope
   30 |   id[eye] = spot;
      |             ^~~~
a.cc: In member function 'int dice::getSpot(int)':
a.cc:34:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   34 |   return id[top];
      |            ^
a.cc: In member function 'void dice::rollWest()':
a.cc:50:28: error: 'Left' was not declared in this scope
   50 |   roll(TOP, RIGHT, BOTTOM, Left);
      |                            ^~~~
a.cc: In member function 'void dice::roll(face, face, face, face)':
a.cc:58:7: error: invalid conversion from 'int' to 'face' [-fpermissive]
   58 |   d = tmp;
      |       ^~~
      |       |
      |       int
a.cc: In function 'int main()':
a.cc:64:22: error: 'six' was not declared in this scope
   64 |   for(int i = 0; i < six; ++i) {
      |                      ^~~
a.cc:66:19: error: invalid conversion from 'int' to 'face' [-fpermissive]
   66 |     di.setDice(d, i);
      |                   ^
      |                   |
      |                   int
a.cc:29:32: note:   initializing argument 2 of 'void dice::setDice(int, face)'
   29 | void dice::setDice(int d, face eye) {
      |                           ~~~~~^~~
Language: C++

int p_r(dice d,int up,int front){
    auto rgen = std::bind(
        std::uniform_int_distribution<>(0,3),std::mt19937(time(nullptr))
    );
    char dir[]={'N','E','W','S'};
    while(up!=d[0]||front!=d[1]){
        d.mov(dir[rgen()]);
    }
    return d[2];
}
bool issame(dice d1,dice d2){
    auto rgen = std::bind(
        std::uniform_int_distribution<>(0,3),std::mt19937(time(nullptr))
    );
    int i=0;
    while(i<100){
        d1.mov(dir[rgen()]);
        if(d1==d2)return true;
        i++;
    }
    return false;
}
bool dice::operator==(dice d){
    for(int i=0;i<6;i++){
        if(v[i]!=d[i])return false;
    }
    return true;
}

Compiler output:
a.cc:1:9: error: 'dice' was not declared in this scope
    1 | int p_r(dice d,int up,int front){
      |         ^~~~
a.cc:1:16: error: expected primary-expression before 'int'
    1 | int p_r(dice d,int up,int front){
      |                ^~~
a.cc:1:23: error: expected primary-expression before 'int'
    1 | int p_r(dice d,int up,int front){
      |                       ^~~
a.cc:1:32: error: expression list treated as compound expression in initializer [-fpermissive]
    1 | int p_r(dice d,int up,int front){
      |                                ^
a.cc:11:13: error: 'dice' was not declared in this scope
   11 | bool issame(dice d1,dice d2){
      |             ^~~~
a.cc:11:21: error: 'dice' was not declared in this scope
   11 | bool issame(dice d1,dice d2){
      |                     ^~~~
a.cc:11:28: error: expression list treated as compound expression in initializer [-fpermissive]
   11 | bool issame(dice d1,dice d2){
      |                            ^
a.cc:23:6: error: 'dice' has not been declared
   23 | bool dice::operator==(dice d){
      |      ^~~~
a.cc:23:6: error: declaration of 'operator==' as non-function
a.cc:23:23: error: 'dice' was not declared in this scope
   23 | bool dice::operator==(dice d){
      |                       ^~~~
Language: C++

class dice{
public:
    explicit dice(int in[6]){
        for(int i=0;i<6;i++){
            v[i]=in[i];
        }
    }
    void mov(const char c){
        int buf;
        switch(c){
            case 'N':{
                buf = v[0];
                v[0] = v[1];
                v[1] = v[5];
                v[5] = v[4];
                v[4] = buf;
                break;
            }
            case 'E':{
                buf = v[0];
                v[0] = v[3];
                v[3] = v[5];
                v[5] = v[2];
                v[2] = buf;
                break;
            }
            case 'W':{
                buf = v[0];
                v[0] = v[2];
                v[2] = v[5];
                v[5] = v[3];
                v[3] = buf;
                break;
            }
            case 'S':{
                buf = v[0];
                v[0] = v[4];
                v[4] = v[5];
                v[5] = v[1];
                v[1] = buf;
                break;
            }
        }
    }
    int operator[](size_t i){return v[i];}
private:
    int v[6];
};

Compiler output:
a.cc:45:20: error: 'size_t' has not been declared
   45 |     int operator[](size_t i){return v[i];}
      |                    ^~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>

class Dice
{
public:
	int top;	// ?????¢
	int south;	// ?????¢
	int east;	// ??±??¢
	int west;	// ?\???¢
	int north;	// ?????¢
	int bottom;	// ?????¢
	int tmp;	// ?????¢????????????????????¨
	void rotation(char ope);
};

void Dice::rotation(char ope)
{
	switch(ope)
	{
		case 'E':
			tmp = top;
			top = west;
			west = bottom;
			bottom = east;
			east = top;			
			break;
		case 'W':
		{
			tmp = top;
			top = east;
			east = bottom;
			bottom = west;
			west = top;
			break;
		case 'S':
			tmp = top;
			top = north;
			north = bottom;
			bottom = south;
			south = top;
			break;
		case 'N':
			tmp = top;
			top = south;
			south = bottom;
			bottom = north;
			north = top;
			break;
	}
}

int main()
{
	Dice dice1;
	string ope;
	cin >> dice1.top >> dice1.south >> dice1.east >> dice1.west >> dice1.north >> dice1.bottom;
	
	//???????????¢??????????????\???
	cin >> ope;
	
	for(int i = 0; i < ope.length(); i++)
	{
		dice1.rotation(ope[i]);
	}
	
	cout << dice1.top << endl;
}

Compiler output:
a.cc: In member function 'void Dice::rotation(char)':
a.cc:55:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   55 | int main()
      |         ^~
a.cc:55:9: note: remove parentheses to default-initialize a variable
   55 | int main()
      |         ^~
      |         --
a.cc:55:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:56:1: error: a function-definition is not allowed here before '{' token
   56 | {
      | ^
a.cc:70:2: error: expected '}' at end of input
   70 | }
      |  ^
a.cc:20:1: note: to match this '{'
   20 | {
      | ^
Language: C++

#include <iostream>

using namespace std;

class Dice {

    int E[6]{3, 1, 0, 5, 4, 2};
    int N[6]{1, 5, 2, 3, 0, 4};
    int S[6]{4, 0, 2, 3, 5, 1};
    int W[6]{2, 1, 5, 0, 4, 3};
    int v[6];

public:
    inline Dice(int *values) { memcpy(v, values, sizeof(int) * 6); };

    void roll(char);

    inline int top() { return v[0]; };
};

void Dice::roll(char dir) {
    int *dir_;
    switch (dir) {
        case 'E':
            dir_ = E;
            break;
        case 'N':
            dir_ = N;
            break;
        case 'S':
            dir_ = S;
            break;
        case 'W':
            dir_ = W;
            break;
    }
    int v_[6];
    for (int i = 0; i < 6; i++) {
        v_[i] = v[dir_[i]];
    }
    memcpy(v, v_, sizeof(int) * 6);
}

int main() {
    int values[6];
    for (int i = 0; i < 6; i++) {
        cin >> values[i];
    }
    Dice dice(values);
    string command;
    cin >> command;
    for (char c:command) {
        dice.roll(c);
    }
    cout << dice.top() << endl;
}


Compiler output:
a.cc: In constructor 'Dice::Dice(int*)':
a.cc:14:32: error: 'memcpy' was not declared in this scope
   14 |     inline Dice(int *values) { memcpy(v, values, sizeof(int) * 6); };
      |                                ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | 
a.cc: In member function 'void Dice::roll(char)':
a.cc:41:5: error: 'memcpy' was not declared in this scope
   41 |     memcpy(v, v_, sizeof(int) * 6);
      |     ^~~~~~
a.cc:41:5: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <iostream>

class Dice{
public:
  Dice(){
    int number[6];
    int pip[6];
  }

  void setLabel(int index, int num){
    number[index] = num;
  }

  void roll_dice(char dst){
    for(int i=0; i<6; i++) pip[i] = number[i];
    switch(dst){
      case 'E':
        setNumber(pip[3], pip[1], pip[0], pip[5], pip[4], pip[2]);
        break;
      case 'N':
        setNumber(pip[1], pip[5], pip[2], pip[3], pip[0], pip[4]);
        break;
      case 'S':
        setNumber(pip[4], pip[0], pip[2], pip[3], pip[5], pip[1]);
        break;
      case 'W':
        setNumber(pip[2], pip[1], pip[5], pip[0], pip[4], pip[3]);
        break;
    }
  }

  int returnTop(){
    return number[0];
  }
  
  void setNumber(int n0, int n1, int n2, int n3, int n4, int n5){
    number[0] = n0;
    number[1] = n1;
    number[2] = n2;
    number[3] = n3;
    number[4] = n4;
    number[5] = n5;
  }
};

int main(){
  Dice dice;
  int label;
  std::string str;
  for(int i=0; i<6; i++){
    std::cin >> label;
    dice.setLabel(i, label);
  }
  std::cin >> str;
  for(int i=0; i<str.size(); i++){
    dice.roll_dice(str[i]);
  }
  std::cout << dice.returnTop() << std::endl;;
}



Compiler output:
a.cc: In member function 'void Dice::setLabel(int, int)':
a.cc:11:5: error: 'number' was not declared in this scope
   11 |     number[index] = num;
      |     ^~~~~~
a.cc: In member function 'void Dice::roll_dice(char)':
a.cc:15:28: error: 'pip' was not declared in this scope
   15 |     for(int i=0; i<6; i++) pip[i] = number[i];
      |                            ^~~
a.cc:15:37: error: 'number' was not declared in this scope; did you mean 'setNumber'?
   15 |     for(int i=0; i<6; i++) pip[i] = number[i];
      |                                     ^~~~~~
      |                                     setNumber
a.cc:18:19: error: 'pip' was not declared in this scope
   18 |         setNumber(pip[3], pip[1], pip[0], pip[5], pip[4], pip[2]);
      |                   ^~~
a.cc: In member function 'int Dice::returnTop()':
a.cc:33:12: error: 'number' was not declared in this scope; did you mean 'setNumber'?
   33 |     return number[0];
      |            ^~~~~~
      |            setNumber
a.cc: In member function 'void Dice::setNumber(int, int, int, int, int, int)':
a.cc:37:5: error: 'number' was not declared in this scope; did you mean 'setNumber'?
   37 |     number[0] = n0;
      |     ^~~~~~
      |     setNumber
Language: C++

#include <iostream>
#include "dice.h"
#include <string>
using namespace std;

class dice{
public:
  dice(int* m);
  void putm(int* m);
  int* getm();
  int* getj();
  void rollDice(char s);
private:
  int m[6];
  int j[6];
};

dice::dice(int* m){
  for(int i=0; i<6; i++){
    this->m[i] = m[i];
    j[i] = m[i];
  }
}

void dice::putm(int* m){
  for(int i=0; i<6; i++) this->m[i] = m[i];
}

int* dice::getm(){
  return m;
}

int* dice::getj(){
  return j;
}

void dice::rollDice(char s){
  //cout << s << endl;
  if(s!='N' && s!='S' && s!='W' && s!='E'){
    cout << "your input: " << s << " roll miss!! " << endl;
  }

  else if(s=='N'){
    int buf=j[0];
    j[0]=j[1];
    j[1]=j[5];
    j[5]=j[4];
    j[4]=buf;
  }
  else if(s=='S'){
    int buf=j[0];
    j[0]=j[4];
    j[4]=j[5];
    j[5]=j[1];
    j[1]=buf;
  }
  else if(s=='W'){
    int buf=j[0];
    j[0]=j[2];
    j[2]=j[5];
    j[5]=j[3];
    j[3]=buf;
  }
  else if(s=='E'){
    int buf=j[0];
    j[0]=j[3];
    j[3]=j[5];
    j[5]=j[2];
    j[2]=buf;
  }
}

int main(){
  int m[6];
  string roll;
  for(int i=0; i<6; i++) cin >> m[i];

  cin >> roll;

  dice d(m);
  for(int i=0; i<roll.length(); i++){
    d.rollDice(roll[i]);
  }

  cout << d.getj()[0] << endl;

  return 0;
}



Compiler output:
a.cc:2:10: fatal error: dice.h: No such file or directory
    2 | #include "dice.h"
      |          ^~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;


int main() {
    int i, j, d[7], d_next[7];
    string dire;

    cin >> d[1] >> d[2] >> d[3] >> d[4] >> d[5] >> d[6];
    cin >> dire;
    for(i=0;i<dire.size();i++){
        if(dire[i] == 'E'){
            d_next[1]=d[4];
            d_next[2]=d[2];
            d_next[3]=d[1];
            d_next[4]=d[6];
            d_next[5]=d[5];
            d_next[6]=d[3];
        }else if(dire[i] == 'N'){
            d_next[1]=d[2];
            d_next[2]=d[6];
            d_next[3]=d[3];
            d_next[4]=d[4];
            d_next[5]=d[1];
            d_next[6]=d[5];
        }else if(dire[i] == 'S'){
            d_next[1]=d[5];
            d_next[2]=d[1];
            d_next[3]=d[3];
            d_next[4]=d[4];
            d_next[5]=d[6];
            d_next[6]=d[2];
        }else{
            d_next[1]=d[3];
            d_next[2]=d[2];
            d_next[3]=d[6];
            d_next[4]=d[1];
            d_next[5]=d[5];
            d_next[6]=d[4];
        }
        for(j=1;j<7;j++){
            d[i] = d_next[i]
        }
    }

    cout << d[1] << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:45:29: error: expected ';' before '}' token
   45 |             d[i] = d_next[i]
      |                             ^
      |                             ;
   46 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;

string t;
int a[7];
int i;

move(i){
int b[7];
for(int n=1;n<7;n++){b[n]=a[n];}

if(t[i]=="W"){
a[6]=b[4];
a[4]=b[1];
a[1]=b[3];
a[3]=b[6];
}

if(t[i]=="N"){
a[6]=b[5];
a[5]=b[1];
a[1]=b[2];
a[2]=b[6];
}

if(t[i]=="E"){
a[6]=b[3];
a[3]=b[1];
a[1]=b[4];
a[4]=b[6];
}

if(t[i]=="S"){
a[6]=b[2];
a[2]=b[1];
a[1]=b[5];
a[5]=b[6];
}}



int main(){
for(int n=1;n<7;n++){cin>>a[n];}
cin>>t;
for(i=0;i<(int)t.size();i++){move;}

cout<<a[1]<<endl;

return 0;
}


Compiler output:
a.cc:8:5: error: expected constructor, destructor, or type conversion before '(' token
    8 | move(i){
      |     ^
a.cc: In function 'int main()':
a.cc:45:34: error: statement cannot resolve address of overloaded function
   45 | for(i=0;i<(int)t.size();i++){move;}
      |                                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;

int a[7];
int e=0;

void move(char i){
int b[7];
for(int n=1;n<7;n++){b[n]=a[n];}

if(i=='W'){
a[6]=b[4];
a[4]=b[1];
a[1]=b[3];
a[3]=b[6];
}

if(i=='N'){
a[6]=b[5];
a[5]=b[1];
a[1]=b[2];
a[2]=b[6];
}

if(i=='E'){
a[6]=b[3];
a[3]=b[1];
a[1]=b[4];
a[4]=b[6];
}

if(i=='S'){
a[6]=b[2];
a[2]=b[1];
a[1]=b[5];
a[5]=b[6];
}

if(i=='R'){
a[3]=b[2];
a[2]=b[4];
a[4]=b[5];
a[5]=b[3];
}}





int main(){
int c[7];
string t="NWSWSWRRRRNNNEEESESWNRRRSREWNNNSERSRWNNWWWNNNNSRSREW"//52
for(int h=1;h<7;h++){cin>>a[h];}
for(int h=1;h<7;h++){cin>>c[h];}
for(int g=0;g<52;g++){
for(int n=1;n<7;n++){
if(n==6 && a[n]==c[n]){e=1;}
if(a[n]==c[n]){continue;}
break;
}
move(t[g]);
}

if(e==1){cout<<"Yes"<<endl;}
if(e==0){cout<<"No"<<endl;}

return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:1: error: expected ',' or ';' before 'for'
   53 | for(int h=1;h<7;h++){cin>>a[h];}
      | ^~~
a.cc:53:13: error: 'h' was not declared in this scope
   53 | for(int h=1;h<7;h++){cin>>a[h];}
      |             ^
Language: C++

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

struct Dice{
  int s[6];
  void roll(char c){
    int b;
    if(c=='E'){
      b=s[0];
      s[0]=s[3];
      s[3]=s[5];
      s[5]=s[2];
      s[2]=b;
    }
    if(c=='W'){
      b=s[0];
      s[0]=s[2];
      s[2]=s[5];
      s[5]=s[3];
      s[3]=b;
    }
    if(c=='N'){
      b=s[0];
      s[0]=s[1];
      s[1]=s[5];
      s[5]=s[4];
      s[4]=b;
    }
    if(c=='S'){
      b=s[0];
      s[0]=s[4];
      s[4]=s[5];
      s[5]=s[1];
      s[1]=b;
    }
  }
  int top() {
    return s[0];
  }
}

int main(){
  Dice d;
  char c;
  for(int i=0;i<6;i++) cin>>d.s[i];
  getchar();
  while((c = getchar()) != '\n')d.roll(c);
  cout<<d.top()<<endl;
  return 0;
}



Compiler output:
a.cc:42:2: error: expected ';' after struct definition
   42 | }
      |  ^
      |  ;
Language: C++

from functools import lru_cache
 
 
class MatrixRKSearch:
    shift = 40
    size = 33554393
 
    def __init__(self, m1, m2):
        self.haystack = self._encode(m1)
        self.needle = self._encode(m2)
 
    def find(self):
        i1, j1 = len(self.haystack), len(self.haystack[0])
        i2, j2 = len(self.needle), len(self.needle[0])
        if i1 < i2 or j1 < j2:
            return
 
        hs1 = [self._hash(s, j2) for s in self.haystack]
        hs2 = [self._hash(s, j2) for s in self.needle]
        dm = self.shift**(j2-1) % self.size
 
        for j in range(j1-j2+1):
            for i in range(i1-i2+1):
                if hs1[i:i+i2] == hs2:
                    yield (i, j)
            if j+j2 < j1:
                for i in range(i1):
                    hs1[i] = self._shift(hs1[i], self.haystack[i][j+j2],
                                         self.haystack[i][j], dm)
 
    def _shift(self, h, add, remove, dm):
        return ((h - remove*dm) * self.shift + add) % self.size
 
    def _hash(self, s, length):
        h = 0
        for i in range(length):
            h = (h * self.shift + s[i]) % self.size
 
        return h
 
    def _encode(cls, m):
        basea = ord('a')
        based = ord('0')
        es = []
        for s in m:
            bs = []
            for c in s:
                if c.isdigit():
                    bs.append(ord(c) - based + 27)
                else:
                    bs.append(ord(c) - basea)
            es.append(bs)
 
        return es
 
 
def search(matrix, pattern):
    """Search matrix for pattern
    """
    def _check(y, x):
        for m in range(py):
            for n in range(px):
                if matrix[y+m][x+n] != pattern[m][n]:
                    return False
        return True
 
    mx = len(matrix[0])
    my = len(matrix)
    px = len(pattern[0])
    py = len(pattern)
    for i in range(my-py+1):
        for j in range(mx-px+1):
            if _check(i, j):
                yield (i, j)
 
 
def run():
    h, w = [int(x) for x in input().split()]
    m = []
 
    for _ in range(h):
        m.append(input())
 
    r, c = [int(x) for x in input().split()]
    pt = []
 
    for _ in range(r):
        pt.append(input())
 
    sch = MatrixRKSearch(m, pt)
    result = []
    for i, j in sch.find():
        result.append((i, j))
 
    result.sort()
    for i, j in result:
        print(i, j)
 
 
if __name__ == '__main__':
    run()


Compiler output:
a.cc:58:7: warning: missing terminating " character
   58 |     """Search matrix for pattern
      |       ^
a.cc:58:7: error: missing terminating " character
   58 |     """Search matrix for pattern
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:59:7: warning: missing terminating " character
   59 |     """
      |       ^
a.cc:59:7: error: missing terminating " character
a.cc:100:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  100 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'from' does not name a type
    1 | from functools import lru_cache
      | ^~~~
Language: C++

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		class qube{
			Scanner sc = new Scanner(System.in);
			int [] face = new int[6];
			Integer i,dump=0;
			String e;
			String es[];
			
			qube(){
				for(i=0;i<6;i++){
					face[i]=sc.nextInt();
				}
			}
			
			void swap(int a,int b){
				dump = this.face[a];
				this.face[a] = this.face[b];
				this.face[b] = dump;
				
			}
			void scn(){
				e =sc.next();
				es = e.split("");
			}
			void pt(){
				System.out.printf("%d", this.face[0]);
				System.exit(0);
			}
			
			void move(){
				scn();
				for(i=0;;i++){
					
					if(i.equals(this.es.length)){
						this.pt();
					}
					if(this.es[i].equals("E")){
						swap(0,2);
						swap(0,5);
						swap(0,3);
					}
					else if(this.es[i].equals("N")){
						swap(4,5);
						swap(4,1);
						swap(4,0);
					}
					else if(this.es[i].equals("S")){
						swap(1,5);
						swap(1,4);
						swap(1,0);
					}
					else{
						swap(3,5);
						swap(3,2);
						swap(3,1);
					}
				}
			}
			
		}
		
		qube q = new qube();
		q.move();
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
class dice{
public:
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
	kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
	huru(string x);

};
dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
  d1 = s1;
  d2 = s2;
  d3 = s3;
  d4 = s4;
  d5 = s5;
  d6 = s6;
}
dice::huru(string x){
	int a,b,c,d,e,f;
	for(int i = 0;i<x.size();i++){
		if(x.at(i) == 'E'){
			a = d3;
			d3 = d1;
			d1 = d4;
			d4 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'S'){
			a = d2;
			d2 = d1;
			d1 = d5;
			d5 = d6; 
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'W'){
			a = d4;
			d4 = d1;
			d1 = d3;
			d3 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'N'){
			a = d5;
			d5 = d1;
			d1 = d2;
			d2 = d6;
			d2 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
	}
}
int main(){
	int s1,s2,s3,s4,s5,s6;
	cin>>s1>>s2>>s3>>s4>>s5>>s6;
	string x;
	cin>>x;
	dice iti;
	iti.kaisi(s1,s2,s3,s4,s5,s6);
	iti.huru(x);
	cout<<iti.d1<<endl;
	return 0;
}


Compiler output:
a.cc:11:9: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   11 |         kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
      |         ^~~~~
a.cc:12:9: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   12 |         huru(string x);
      |         ^~~~
a.cc:15:1: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   15 | dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
      | ^~~~
a.cc: In member function 'int dice::kaisi(int, int, int, int, int, int)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
a.cc: At global scope:
a.cc:23:1: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   23 | dice::huru(string x){
      | ^~~~
a.cc: In member function 'int dice::huru(std::string)':
a.cc:59:1: warning: no return statement in function returning non-void [-Wreturn-type]
   59 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
class dice{
public:
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
	kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
	huru(string x);

};
dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
  d1 = s1;
  d2 = s2;
  d3 = s3;
  d4 = s4;
  d5 = s5;
  d6 = s6;
}
dice::huru(string x){
	int a,b,c,d,e,f;
	for(int i = 0;i<x.size();i++){
		if(x.at(i) == 'E'){
			a = d3;
			d3 = d1;
			d1 = d4;
			d4 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'S'){
			a = d2;
			d2 = d1;
			d1 = d5;
			d5 = d6; 
			d6 = a;
		}
		if(x.at(i) == 'W'){
			a = d4;
			d4 = d1;
			d1 = d3;
			d3 = d6;
			d6 = a;
		}
		if(x.at(i) == 'N'){
			a = d5;
			d5 = d1;
			d1 = d2;
			d2 = d6;
			d2 = a;
		}
	}
}
int main(){
	int s1,s2,s3,s4,s5,s6;
	cin>>s1>>s2>>s3>>s4>>s5>>s6;
	string x;
	cin>>x;
	dice iti;
	iti.kaisi(s1,s2,s3,s4,s5,s6);
	iti.huru(x);
	cout<<iti.d1<<endl;
	return 0;
}


Compiler output:
a.cc:11:9: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   11 |         kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
      |         ^~~~~
a.cc:12:9: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   12 |         huru(string x);
      |         ^~~~
a.cc:15:1: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   15 | dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
      | ^~~~
a.cc: In member function 'int dice::kaisi(int, int, int, int, int, int)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
   22 | }
      | ^
a.cc: At global scope:
a.cc:23:1: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   23 | dice::huru(string x){
      | ^~~~
a.cc: In member function 'int dice::huru(std::string)':
a.cc:56:1: warning: no return statement in function returning non-void [-Wreturn-type]
   56 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
class dice{
public:
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
	kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
	huru(string x);
};
dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
  d1 = s1;
  d2 = s2;
  d3 = s3;
  d4 = s4;
  d5 = s5;
  d6 = s6;
}
dice::huru(string x){
	int a,b,c,d,e,f;
	for(int i = 0;i<x.size();i++){
		if(x.at(i) == 'E'){
			a = d3;
			d3 = d1;
			d1 = d4;
			d4 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'S'){
			a = d2;
			d2 = d1;
			d1 = d5;
			d5 = d6; 
			d6 = a;
		}
		if(x.at(i) == 'W'){
			a = d4;
			d4 = d1;
			d1 = d3;
			d3 = d6;
			d6 = a;
		}
		if(x.at(i) == 'N'){
			a = d5;
			d5 = d1;
			d1 = d2;
			d2 = d6;
			d2 = a;
		}
	}
}
int main(){
	int s1,s2,s3,s4,s5,s6;
	cin>>s1>>s2>>s3>>s4>>s5>>s6;
	string x;
	cin>>x;
	dice iti;
	iti.kaisi(s1,s2,s3,s4,s5,s6);
	iti.huru(x);
	cout<<iti.d1<<endl;
	return 0;
}


Compiler output:
a.cc:11:9: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   11 |         kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
      |         ^~~~~
a.cc:12:9: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   12 |         huru(string x);
      |         ^~~~
a.cc:14:1: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   14 | dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
      | ^~~~
a.cc: In member function 'int dice::kaisi(int, int, int, int, int, int)':
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
a.cc: At global scope:
a.cc:22:1: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   22 | dice::huru(string x){
      | ^~~~
a.cc: In member function 'int dice::huru(std::string)':
a.cc:55:1: warning: no return statement in function returning non-void [-Wreturn-type]
   55 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
class dice{
public:
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
	int kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
	string huru(string x);
};
dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
  d1 = s1;
  d2 = s2;
  d3 = s3;
  d4 = s4;
  d5 = s5;
  d6 = s6;
}
dice::huru(string x){
	int a,b,c,d,e,f;
	for(int i = 0;i<x.size();i++){
		if(x.at(i) == 'E'){
			a = d3;
			d3 = d1;
			d1 = d4;
			d4 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'S'){
			a = d2;
			d2 = d1;
			d1 = d5;
			d5 = d6; 
			d6 = a;
		}
		if(x.at(i) == 'W'){
			a = d4;
			d4 = d1;
			d1 = d3;
			d3 = d6;
			d6 = a;
		}
		if(x.at(i) == 'N'){
			a = d5;
			d5 = d1;
			d1 = d2;
			d2 = d6;
			d2 = a;
		}
	}
}
int main(){
	int s1,s2,s3,s4,s5,s6;
	cin>>s1>>s2>>s3>>s4>>s5>>s6;
	string x;
	cin>>x;
	dice iti;
	iti.kaisi(s1,s2,s3,s4,s5,s6);
	iti.huru(x);
	cout<<iti.d1<<endl;
	return 0;
}


Compiler output:
a.cc:14:1: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   14 | dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
      | ^~~~
a.cc: In member function 'int dice::kaisi(int, int, int, int, int, int)':
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
a.cc: At global scope:
a.cc:22:1: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   22 | dice::huru(string x){
      | ^~~~
a.cc:22:1: error: no declaration matches 'int dice::huru(std::string)'
a.cc:12:16: note: candidate is: 'std::string dice::huru(std::string)'
   12 |         string huru(string x);
      |                ^~~~
a.cc:3:7: note: 'class dice' defined here
    3 | class dice{
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
class dice{
public:
	int d1;
	int d2;
	int d3;
	int d4;
	int d5;
	int d6;
	 kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
	huru(string x);
};
int dice::kaisi(int s1,int s2,int s3,int s4,int s5,int s6){
  d1 = s1;
  d2 = s2;
  d3 = s3;
  d4 = s4;
  d5 = s5;
  d6 = s6;
}
string dice::huru(string x){
	int a,b,c,d,e,f;
	for(int i = 0;i<x.size();i++){
		if(x.at(i) == 'E'){
			a = d3;
			d3 = d1;
			d1 = d4;
			d4 = d6;
			d6 = a;
		//	cout<<d1<<d2<<d3<<d4<<d5<<d6<<endl;
		}
		if(x.at(i) == 'S'){
			a = d2;
			d2 = d1;
			d1 = d5;
			d5 = d6; 
			d6 = a;
		}
		if(x.at(i) == 'W'){
			a = d4;
			d4 = d1;
			d1 = d3;
			d3 = d6;
			d6 = a;
		}
		if(x.at(i) == 'N'){
			a = d5;
			d5 = d1;
			d1 = d2;
			d2 = d6;
			d2 = a;
		}
	}
}
int main(){
	int s1,s2,s3,s4,s5,s6;
	cin>>s1>>s2>>s3>>s4>>s5>>s6;
	string x;
	cin>>x;
	dice iti;
	iti.kaisi(s1,s2,s3,s4,s5,s6);
	iti.huru(x);
	cout<<iti.d1<<endl;
	return 0;
}


Compiler output:
a.cc:11:10: error: ISO C++ forbids declaration of 'kaisi' with no type [-fpermissive]
   11 |          kaisi(int s1, int s2, int s3, int s4 ,int s5,int s6);
      |          ^~~~~
a.cc:12:9: error: ISO C++ forbids declaration of 'huru' with no type [-fpermissive]
   12 |         huru(string x);
      |         ^~~~
a.cc: In member function 'int dice::kaisi(int, int, int, int, int, int)':
a.cc:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
a.cc: At global scope:
a.cc:22:8: error: no declaration matches 'std::string dice::huru(std::string)'
   22 | string dice::huru(string x){
      |        ^~~~
a.cc:12:9: note: candidate is: 'int dice::huru(std::string)'
   12 |         huru(string x);
      |         ^~~~
a.cc:3:7: note: 'class dice' defined here
    3 | class dice{
      |       ^~~~
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String[] data = in.readLine().split(" ");
		int[] num = new int[6];
		for (int i = 0; i < 6; i++) {
			num[i] = Integer.parseInt(data[i]);
		}
		Dices dice = new Dices(num[0], num[1], num[2], num[3], num[4], num[5]);
		int quesTime = Integer.parseInt(in.readLine());
		for (int j = 0; j < quesTime; j++) {
			String[] ques = in.readLine().split(" ");
			int top = Integer.parseInt(ques[0]);
			int front = Integer.parseInt(ques[1]);
			if ((top == dice.fo && front == dice.tw)
					|| (top == dice.tw && front == dice.th)
					|| (top == dice.th && front == dice.fi)
					|| (top == dice.fi && front == dice.fo)) {
				System.out.println(dice.on);
			} else if ((top == dice.on && front == dice.fo)
					|| (top == dice.fo && front == dice.si)
					|| (top == dice.si && front == dice.th)
					|| (top == dice.th && front == dice.on)) {
				System.out.println(dice.tw);
			} else if ((top == dice.on && front == dice.tw)
					|| (top == dice.tw && front == dice.si)
					|| (top == dice.si && front == dice.fi)
					|| (top == dice.fi && front == dice.on)) {
				System.out.println(dice.th);
			} else if ((top == dice.si && front == dice.tw)
					|| (top == dice.tw && front == dice.on)
					|| (top == dice.on && front == dice.fi)
					|| (top == dice.fi && front == dice.si)) {
				System.out.println(dice.fo);
			} else if ((top == dice.fo && front == dice.on)
					|| (top == dice.on && front == dice.th)
					|| (top == dice.th && front == dice.si)
					|| (top == dice.si && front == dice.fo)) {
				System.out.println(dice.fi);
			} else if ((top == dice.tw && front == dice.fo)
					|| (top == dice.fo && front == dice.fi)
					|| (top == dice.fi && front == dice.th)
					|| (top == dice.th && front == dice.tw)) {
				System.out.println(dice.si);
			}
		}
	}
}

class Dices2 {
	public int on, tw, th, fo, fi, si;

	public Dices2(int on, int tw, int th, int fo, int fi, int si) {
		this.on = on;
		this.tw = tw;
		this.th = th;
		this.fo = fo;
		this.fi = fi;
		this.si = si;
	}
}

Compiler output:
Main.java:13: error: cannot find symbol
		Dices dice = new Dices(num[0], num[1], num[2], num[3], num[4], num[5]);
		^
  symbol:   class Dices
  location: class Main
Main.java:13: error: cannot find symbol
		Dices dice = new Dices(num[0], num[1], num[2], num[3], num[4], num[5]);
		                 ^
  symbol:   class Dices
  location: class Main
2 errors
Language: Java

mport java.util.ArrayList;
import java.util.Scanner;

public class Main {

	private static int[] face = new int[6];

	public static void action(char action){
		int intTemp;
		switch(action){
		case 'W':
			intTemp = face[0];
			face[0] = face[2];
			face[2] = face[5];
			face[5] = face[3];
			face[3] = intTemp;
			break;
		case 'E':
			intTemp = face[0];
			face[0] = face[3];
			face[3] = face[5];
			face[5] = face[2];
			face[2] = intTemp;
			break;
		case 'N':
			intTemp = face[0];
			face[0] = face[1];
			face[1] = face[5];
			face[5] = face[4];
			face[4] = intTemp;
			break;
		case 'S':
			intTemp = face[0];
			face[0] = face[4];
			face[4] = face[5];
			face[5] = face[1];
			face[1] = intTemp;
			break;
		default :
			break;
		}
	}
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		for(int i = 0; i < 6; i++){
			face[i] = scan.nextInt();
		}
		int intLoop = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		for(int i = 0; i < intLoop; i++){
			int intNum1 = scan.nextInt();
			int intNum2 = scan.nextInt();
			//????????¶???(?????¢???????????´???)??§?????????
			int intAns = face[2];
			int intTemp;
			if(intNum1 == face[1]){
				intTemp = face[0];
				face[0] = face[1];
				face[1] = face[5];
				face[5] = face[4];
				face[4] = intTemp;
			}else if(intNum1 == face[2]){
				intTemp = face[0];
				face[0] = face[2];
				face[2] = face[5];
				face[5] = face[3];
				face[3] = intTemp;
			}else if(intNum1 == face[3]){
				intTemp = face[0];
				face[0] = face[3];
				face[3] = face[5];
				face[5] = face[2];
				face[2] = intTemp;
			}else if(intNum1 == face[4]){
				intTemp = face[0];
				face[0] = face[4];
				face[4] = face[5];
				face[5] = face[1];
				face[1] = intTemp;
			}else if(intNum1 == face[5]){
				intTemp = face[0];
				face[0] = face[5];
				face[5] = intTemp;
				intTemp = face[1];
				face[1] = face[4];
				face[4] = intTemp;
			}
			if(intNum2 == face[1]){
				list.add(face[2]);
			}else{
				list.add(face[3]);
			}
		}
		for(int i = 0; i < list.size(); i++){
			System.out.println(list.get(i));
		}
		scan.close();
	}
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.ArrayList;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java

import java.util.Scanner;

public class Main {
	public static Scanner sc;
	public static void main(String[] args){
		sc=new Scanner(System.in);
		Dice2 dice=new Dice2();
		for(int i=0;i<6;i++){
			dice.set(sc.nextInt(),i);
		}
		int q=sc.nextInt();
		for(int i=0;i<q;i++){
			int u=sc.nextInt();
			int f=sc.nextInt();
			System.out.println(dice.find(u,f));
		}
	}

}
class Dice2 {
	private int d[]=new int[6];
	void set(int a,int i){
			d[i]=a;
	}
	int get(int i){
		return d[i-1];
	}
	int find(int u,int f){
		for(int i=0;i<6;i++){
			if(d[i]==u)u=i+1;
			if(d[i]==f)f=i+1;
		}
		if(u==1){
			if(f==2)return get(3);
			if(f==3)return get(5);
			if(f==5)return get(4);
			if(f==4)return get(2);
		}
		if(u==2){
			if(f==1)return get(4);
			if(f==4)return get(6);
			if(f==6)return get(3);
			if(f==3)return get(1);
		}
		if(u==3){
			if(f==1)return get(2);
			if(f==2)return get(6);
			if(f==6)return get(5);
			if(f==5)return get(1);
		}
		if(u==4){
			if(f==1)return get(5);
			if(f==2)return get(1);
			if(f==6)return get(2);
			if(f==5)return get(6);
		}
		if(u==5){
			if(f==1)return get(3);
			if(f==3)return get(6);
			if(f==6)return get(4);
			if(f==4)return get(1);
		}
		else{
			if(f==2)return get(4);
			if(f==3)return get(2);
			if(f==5)return get(3);
			if(f==4)return get(5);
		}
	}

Compiler output:
Main.java:69: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;



public class test{
	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		String str;
		String[] dice;
		int[] compare_dice=new int[6];
		int[] int_dice=new int[6];
		int count=0;

		try{

			str=reader.readLine();
			dice=str.split(" ");//{1,2,3,4,5,6}={dice[0], dice[1], ... ,dice[5]}={???, S, E, W, N, ???}
			for(int i=0;i<6;i++){
				int_dice[i]=Integer.parseInt(dice[i]);
			}

			str=reader.readLine();
			dice=str.split(" ");//{1,2,3,4,5,6}={dice[0], dice[1], ... ,dice[5]}={???, S, E, W, N, ???}
			for(int i=0;i<6;i++){
				compare_dice[i]=Integer.parseInt(dice[i]);
			}



			if(int_dice[0]!=compare_dice[0]){
				for(int j=0;j<3;j++){
				 roll('S', int_dice);
				 if(int_dice[0]==compare_dice[0])break;
				}
				if(int_dice[0]!=compare_dice[0]){
					for(int j=0;j<3;j++){
						roll('E', int_dice);
						if(int_dice[0]==compare_dice[0])break;
					}
				}
			}//?????¢????????????????????????


			if(int_dice[1]!=compare_dice[1]){

				for(int k=0;k<3;k++){
					rotate(int_dice);
					if(int_dice[1]==compare_dice[1])break;
				}
			}//?????¢????????????????????????



			for(int i=0;i<6;i++){
				if(int_dice[i]==compare_dice[i]){
					count++;
				}

			}

			if(count==6){System.out.println("Yes");}else{
				System.out.println("No");
			}






		}catch(IOException e){
			System.out.print(e);
		}
	}

	private static void rotate(int[] int_dice){
		//?¨????????????¢???????????????????????????
		int x=int_dice[3];
		int_dice[3]=int_dice[4];
		int_dice[4]=int_dice[2];
		int_dice[2]=int_dice[1];
		int_dice[1]=x;
	}

	private static void roll(char ch, int[] int_dice){
		int[] dice_for_change=new int[6];

		switch(ch){

		case 'S':
	    {
	    	dice_for_change[0]=int_dice[4];
	    	dice_for_change[1]=int_dice[0];
	    	dice_for_change[2]=int_dice[2];
	    	dice_for_change[3]=int_dice[3];
	    	dice_for_change[4]=int_dice[5];
	    	dice_for_change[5]=int_dice[1];

	    	}
		break;

		case 'E':
	    {
	    	dice_for_change[0]=int_dice[3];
	    	dice_for_change[1]=int_dice[1];
	    	dice_for_change[2]=int_dice[0];
	    	dice_for_change[3]=int_dice[5];
	    	dice_for_change[4]=int_dice[4];
	    	dice_for_change[5]=int_dice[2];

	    	}
		break;

		case 'N':
	    {//??????
	    	dice_for_change[0]=int_dice[1];
	    	dice_for_change[1]=int_dice[5];
	    	dice_for_change[2]=int_dice[2];
	    	dice_for_change[3]=int_dice[3];
	    	dice_for_change[4]=int_dice[0];
	    	dice_for_change[5]=int_dice[4];
        	}
		break;

		case 'W':
	    {
	    	dice_for_change[0]=int_dice[2];
	    	dice_for_change[1]=int_dice[1];
	    	dice_for_change[2]=int_dice[5];
	    	dice_for_change[3]=int_dice[0];
	    	dice_for_change[4]=int_dice[4];
	    	dice_for_change[5]=int_dice[3];
        	}
		break;
		}//switch
		for(int k=0;k<6;k++){
	    	int_dice[k]=dice_for_change[k];

		}//??¢?????????????????£??\


	}

}

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




class Main {
  public static void main(String[] args){
	  Scanner s=new Scanner(System.in);
	  int a[]={s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt()};
	  int q=s.nextInt();	
	  int qp[]=new int[2*q];
	  for(int i=0;i<2*q;i++){
		  qp[i]=s.nextInt();
	  }
	  s.close();
	  Dicelabel d=new Dicelabel(a[0],a[3],a[2],a[4],a[1],a[5]);
	  
	  for(int i=0;i<2*q;i++){
	  System.out.println(d.eNumberPrint(qp[i++],qp[i],d));
	  d.number=a[0];
  	  d.eroll=a[3];
  	  d.wroll=a[2];
  	  d.sroll=a[4];
  	  d.nroll=a[1];
  	  d.under=a[5];
	  }
  }
}
  class Dicelabel{
		int number;
	    int eroll;
	    int wroll;
	    int nroll;
	    int sroll;
	    int under;
	    Dicelabel(int number,int e,int w,int s,int n,int under){
	    	this.number=number;
	    	this.eroll=e;
	    	this.wroll=w;
	    	this.sroll=s;
	    	this.nroll=n;
	    	this.under=under;
	    }
		
		Dicelabel diceRoll(char direction){
			if(direction=='E'){
				return new Dicelabel(eroll,under,number,sroll,nroll,wroll);
			}
			if(direction=='W'){
				return new Dicelabel(wroll,number,under,sroll,nroll,eroll);
			}
			if(direction=='S'){
				return new Dicelabel(sroll,eroll,wroll,under,number,nroll);
			}
			if(direction=='N'){
				return new Dicelabel(nroll,eroll,wroll,number,under,sroll);
			}
			return null;
		}
		int eNumberPrint(int t,int b,Dicelabel d){
			//*??????eroll??§??????nroll?????????number?????????
		   for(int i=0;i<4;i++){
			   if(d.eroll==t)
				   break;
			   d=d.diceRoll('W');
		   }
		   for(int i=0;i<4;i++){
			   if(d.nroll==b)
				   break;
			   d=d.diceRoll('S');
		   }
		   return d.number;
		   
		   
		}
  }

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

class Main {
  public static void main(String[] args){
	  Scanner s=new Scanner(System.in);
	  int a[]={s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt(),s.nextInt()};
	  int q=s.nextInt();	
	  int qp[]=new int[2*q];
	  for(int i=0;i<2*q;i++){
		  qp[i]=s.nextInt();
	  }
	  s.close();
	  Dicelabel d=new Dicelabel(a[0],a[3],a[2],a[4],a[1],a[5]);
	  
	  for(int i=0;i<2*q;i++){
	  System.out.println(d.eNumberPrint(qp[i++],qp[i],d));
	  d.number=a[0];
  	  d.eroll=a[3];
  	  d.wroll=a[2];
  	  d.sroll=a[4];
  	  d.nroll=a[1];
  	  d.under=a[5];
	  }
  }
}
  class Dicelabel{
		int number;
	    int eroll;
	    int wroll;
	    int nroll;
	    int sroll;
	    int under;
	    Dicelabel(int number,int e,int w,int s,int n,int under){
	    	this.number=number;
	    	this.eroll=e;
	    	this.wroll=w;
	    	this.sroll=s;
	    	this.nroll=n;
	    	this.under=under;
	    }
		
		Dicelabel diceRoll(char direction){
			if(direction=='E'){
				return new Dicelabel(eroll,under,number,sroll,nroll,wroll);
			}
			if(direction=='W'){
				return new Dicelabel(wroll,number,under,sroll,nroll,eroll);
			}
			if(direction=='S'){
				return new Dicelabel(sroll,eroll,wroll,under,number,nroll);
			}
			if(direction=='N'){
				return new Dicelabel(nroll,eroll,wroll,number,under,sroll);
			}
			return null;
		}
		int eNumberPrint(int t,int b,Dicelabel d){
			//*??????eroll??§??????nroll?????????number?????????
		   for(int i=0;i<4;i++){
			   if(d.eroll==t)
				   break;
			   d=d.diceRoll('W');
		   }
		   for(int i=0;i<4;i++){
			   if(d.nroll==b)
				   break;
			   d=d.diceRoll('S');
		   }
		   return d.number;
		   
		   
		}
  }

Compiler output:
Main.java:3: error: cannot find symbol
	  Scanner s=new Scanner(System.in);
	  ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	  Scanner s=new Scanner(System.in);
	                ^
  symbol:   class Scanner
  location: class Main
2 errors