submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s382690999 | p00425 | C++ | #include<bits/stdc++.h>
using namespace std;
int main() {
int n;
while( cin >> n, n ) {
string way;
int left=4, right=3, front=2, back=5, top=1, under=6;
int sum = 0, temp;
for(int i=0; i<n; i++) {
cin >> way;
if( way == "North" ) {
temp = top;
top = front;
front = under;
under = b... | a.cc: In function 'int main()':
a.cc:64:18: error: no match for 'operator<' (operand types are 'std::basic_ostream<char>' and '<unresolved overloaded function type>')
64 | cout << sum+1< endl;
| ~~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/regex:68,
from /usr/include/x... |
s777477475 | p00425 | C++ | #include <stdio.h>
#include <string.h>
main(){
int n,i,sum;
string say;
int on,under,right,left,forward,back;
int preon,preunder,preright,preleft,preforward,preback;
on = 1, back = 2, right = 3, left = 4, forward = 5, under = 6;
while(1){
sum = 0;
scanf("%d",\n);
... | a.cc:17:20: error: stray '\' in program
17 | scanf("%d",\n);
| ^
a.cc:23:24: error: stray '\' in program
23 | scanf("%s",\say);
| ^
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main(){
... |
s630400547 | p00425 | C++ | #include<iostream>
#include<string>
using namespace std;
int sai[100000][6];
int x[100000],n,sum;
int main(){
while(true){
for(int i=0;i<6;i++){sai[0][i]=i+1;}
string S[1000000];
sum=1;
cin>>n;
for(int i=0;i<n;i++){cin>>S[i];}
for(int i=0;i<n;i++){
if(S[i]=='North'){
x[i+1]... | a.cc:15:18: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
15 | if(S[i]=='North'){
| ^~~~~~~
a.cc:18:18: warning: multi-character character constant [-Wmultichar]
18 | if(S[i]=='East'){
| ^~~~~~
a.cc:21:18: warning: mu... |
s671431516 | p00425 | C++ | import java.io.InputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.math.BigInteger;
public class Main{
static PrintWriter out... | a.cc:1:1: error: 'import' does not name a type
1 | import java.io.InputStream;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
2 | import java.io.IOException;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodu... |
s526606765 | p00425 | C++ | #include <cstdio>
#include <iostream>
using namespace std;
int main(){
int n;
string operation;
int sum;
int current_num;
while(cin >> n){
if(n==0)return 0;
sum = 1;
current_num = 1;
int deme[] = {2,5,4,3};
for(int i = 0; i < n; i++){
cin >> operat... | a.cc: In function 'int main()':
a.cc:17:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
17 | if (operation[0] == "North"){
a.cc:24:34: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
24 | else if (operation[0] == "South"){
a.cc:32... |
s223055592 | p00425 | C++ | #include <iostream>
#include <string>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
void north();
void south();
void west();
void east();
void right();
void left();
int top, bot, n, s, w, e, time, total, stock;
string inst;
int main() {
while (cin >> time, time) {
top = 1;
bot = 6;
n = 5;
... | a.cc:13:27: error: 'int time' redeclared as different kind of entity
13 | int top, bot, n, s, w, e, time, total, stock;
| ^~~~
In file included from /usr/include/pthread.h:23,
from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
from /usr... |
s254112369 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int i,m;
char Dice[6];
int sum;
int num[6],s[6];
while(1){
sum=1;
for(i=0;i<6;i++){
s[i]=i+1;
}
cin>>n;
for(m=0;m<n;m++){
cin>>Dice;
if(Dice[0]=='N'){
num[0]=s[1];
num[1]=s[5];
num[4]=s[0];
num[5]=s[4];
s[0]=num[0];
s[1]... | a.cc: In function 'int main()':
a.cc:13:22: error: 'n' was not declared in this scope
13 | cin>>n;
| ^
|
s453374848 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int i,m;
char Dice[6];
int sum;
int num[6],s[6];
while(1){
sum=1;
for(i=0;i<6;i++){
s[i]=i+1;
}
cin>>n;
for(m=0;m<n;m++){
cin>>Dice;
if(Dice[0]=='N'){
num[0]=s[1];
num[1]=s[5];
num[4]=s[0];
num[5]=s[4];
s[0]=num[0];
s[1]... | a.cc: In function 'int main()':
a.cc:13:22: error: 'n' was not declared in this scope
13 | cin>>n;
| ^
|
s368689250 | p00425 | C++ | #include<stdio.h>
int main()
{
int i, j, w, h, n, l, m, cnt = 1;
char str1[100] = { 0 };
int a[100];
int b[6 + 100];
int box[6 + 100];
int temp;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
scanf("%s", str1[i]);
}
for (i = 1; i <= 6; i++) {
box[i] = cnt;
a[... | a.cc:67:1: error: expected unqualified-id before 'return'
67 | return 0;
| ^~~~~~
a.cc:68:1: error: expected declaration before '}' token
68 | }
| ^
|
s416540338 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int i,m;
char Dice[6];
int sum;
int num[6],s[6];
while(1){
sum=1;
for(i=0;i<6;i++){
s[i]=i+1;
}
cin>>n;
for(m=0;m<n;m++){
cin>>Dice;
if(Dice[0]=='N'){
num[0]=s[1];
num[1]=s[5];
num[4]=s[0];
num[5]=s[4];
s[0]=num[0];
s[1]... | a.cc: In function 'int main()':
a.cc:13:22: error: 'n' was not declared in this scope
13 | cin>>n;
| ^
|
s082669974 | p00425 | C++ | def North(dice):
dice[0],dice[1] = dice[1],7-dice[0]
def East(dice):
dice[2],dice[0] = dice[0],7-dice[2]
def West(dice):
dice[0],dice[2] = dice[2],7-dice[0]
def South(dice):
dice[1],dice[0] = dice[0],7-dice[1]
def Right(dice):
dice[1],dice[2] = dice[2],7-dice[1]
def Left(dice):
dice[2],dice... | a.cc:1:1: error: 'def' does not name a type
1 | def North(dice):
| ^~~
|
s383306325 | p00425 | C++ | #include<iostream>
#include<string>
#include<vector>
using namespace std;
int main() {
int a, b, c, d, e, f, g, n, sum;
string s;
vector<int>l;
a = 1;
b = 2;
c = 3;
d = 4;
e = 5;
f = 6;
while (cin >> n){
sum = 1;
for (int i = 0; i < n; i++) {
cin >> s;
if (s == "North") {
g = a;
a = b;
b... | a.cc: In function 'int main()':
a.cc:66:22: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::vector<int>')
66 | cout << l << endl;
| ~~~~ ^~ ~
| | |
| | std::vect... |
s436798140 | p00425 | C++ | #include <iostream>
#include <string>
using namespace std;
void North();
void East();
void West();
void South();
void Right();
void Left();
int up = 1, down = 6, north = 5, south = 2, east = 3, west = 4;
int ans = 1;
int main(){
string s;
int n;
cin >> n;
for (int i = 0; i < n; i++){
... | a.cc: In function 'void North()':
a.cc:48:14: error: expected ';' before '}' token
48 | ans += up
| ^
| ;
49 | }
| ~
a.cc: In function 'void East()':
a.cc:58:18: error: expected ';' before '}' token
58 | ans += up
| ^
... |
s320147484 | p00425 | C++ | #include <iostream>
#include <string>
using namespace std;
int main() {
int n, r;
string s;
vector<string> str;
int top = 1;
int left = 2;
int front = 3;
int _top, _left, _front;
while (cin >> n, n != 0) {
for (int i = 0; i < n; i++) {
cin >> s;
_top = top... | a.cc: In function 'int main()':
a.cc:7:5: error: 'vector' was not declared in this scope
7 | vector<string> str;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | ... |
s575974212 | p00425 | C++ | /*
* joi.cpp
*
* Created on: 2017/10/26
* Author: J00905
*/
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
int n=5,s=2,e=3,w=4,t=1,b=6;
int n,z;
int p=0;
char sn[10];
while(1){
cin>>n;
if(n==0){
break;
}
cin>>sn;
... | a.cc: In function 'int main()':
a.cc:15:13: error: redeclaration of 'int n'
15 | int n,z;
| ^
a.cc:14:13: note: 'int n' previously declared here
14 | int n=5,s=2,e=3,w=4,t=1,b=6;
| ^
a.cc:25:25: error: ISO C++ forbids comparison between pointer and integer [-fpe... |
s240467893 | p00425 | C++ |
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
int n=5,s=2,e=3,w=4,t=1,b=6;
int n,z;
int p=0;
char sn[10];
while(1){
cin>>n;
if(n==0){
break;
}
cin>>sn;
for(int i=0;i<n;i++){
if(sn[0]=='N'){
t=s;
s=b;
b=n;
n=... | a.cc: In function 'int main()':
a.cc:10:13: error: redeclaration of 'int n'
10 | int n,z;
| ^
a.cc:9:13: note: 'int n' previously declared here
9 | int n=5,s=2,e=3,w=4,t=1,b=6;
| ^
|
s638407907 | p00425 | C++ | <?php
//?????????????????¶???????????????????????????
class Dice{
//?????¢????????¢????????´??¢?????°???????¨???????????????°
private $top;
private $front;
private $right;
//??????????????\???
public function __construct() {
$this->top=1;
$this->front=2;
$this->right=3;... | a.cc:1:1: error: expected unqualified-id before '<' token
1 | <?php
| ^
a.cc:61:1: error: '$ans' does not name a type
61 | $ans=1;
| ^~~~
a.cc:62:1: error: '$count' does not name a type
62 | $count=0;
| ^~~~~~
a.cc:64:1: error: expected unqualified-id before 'while'
64 | while($count<5){
... |
s084990306 | p00425 | C++ |
#include<iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<string.h>
using namespace std;
int main(){
int n=5,s=2,e=3,w=4,t=1,b=6;
int y,z;
int p=0;
char sn[10];
while(1){
cin>>y;
if(y==0){
break;
}
for(int i=0;i<y;i++){
cin>>sn;
if(sn[0]=='N'){
z=t;
t=s;
s=b;... | a.cc: In function 'int main()':
a.cc:35:29: error: expected primary-expression before ';' token
35 | p=p+;
| ^
|
s703126154 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int me[6];
int cmp;
int sum[5];
int hasi;
char str[6];
sum[0]=1;
sum[1]=1;
sum[2]=1;
sum[3]=1;
sum[4]=1;
sum[5]=1;
for(int i=0;i<5;i++){
cin >> n;
if(n==0){
hasi=i;
break;
}
me[0]=1;
me[1]=2;
me[2]=3;
me[3]=4;
me[4]=5;
me[5]... | a.cc: In function 'int main()':
a.cc:30:36: error: 'strcmp' was not declared in this scope
30 | if(strcmp(str,"North")==0){
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstrin... |
s388328334 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int me[6];
int cmp;
int sum[5];
int hasi;
char str[6];
sum[0]=1;
sum[1]=1;
sum[2]=1;
sum[3]=1;
sum[4]=1;
sum[5]=1;
for(int i=0;i<5;i++){
cin >> n;
if(n==0){
hasi=i;
break;
}
me[0]=1;
me[1]=2;
me[2]=3;
me[3]=4;
me[4]=5;
me[5]... | a.cc: In function 'int main()':
a.cc:30:36: error: 'strcmp' was not declared in this scope
30 | if(strcmp(str,"North")==0){
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstrin... |
s744881640 | p00425 | C++ | #include<iostream>
using namespace std;
int main(){
int n;
int me[6];
int cmp;
int sum[5];
int hasi;
char str[6];
sum[0]=1;
sum[1]=1;
sum[2]=1;
sum[3]=1;
sum[4]=1;
sum[5]=1;
for(int i=0;i<5;i++){
cin >> n;
if(n==0){
hasi=i;
break;
}
me[0]=1;
me[1]=2;
me[2]=3;
me[3]=4;
me[4]=5;
me[5]... | a.cc: In function 'int main()':
a.cc:30:36: error: 'strcmp_s' was not declared in this scope
30 | if(strcmp_s(str,"North")==0){
| ^~~~~~~~
|
s341410130 | p00425 | C++ | #include<bits/stdc++.h>
using namespace std;
using Int = long long;
//BEGIN CUT HERE
struct Dice{
int s[6];
void roll(char c){
//the view from above
// N
//W E
// S
//s[0]:top
//s[1]:south
//s[2]:east
//s[3]:west
//s[4]:north
//s[5]:bottom
int b;
if(c=='E'){
b=s... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s057846234 | p00425 | C++ | #include<iostream>
#include<string>
#include<windows.h>
using namespace std;
int dice[6] ={1, 3, 2, 6, 4, 5};
int sub[6];
int total = 0;
char East[] = "East";
char West[] = "West";
char North[]= "North";
char South[]= "South";
char Right[]= "Right";
char Left[] = "Left";
void copy_arr(void){
for(int i = 0; i < 6; ... | a.cc:3:9: fatal error: windows.h: No such file or directory
3 | #include<windows.h>
| ^~~~~~~~~~~
compilation terminated.
|
s798241203 | p00425 | C++ | #include<iostream>
#include<string>
using namespace std;
int dice[6] ={1, 3, 2, 6, 4, 5};
int sub[6];
int total = 0;
char East[] = "East";
char West[] = "West";
char North[]= "North";
char South[]= "South";
char Right[]= "Right";
char Left[] = "Left";
void copy_arr(void){
for(int i = 0; i < 6; i++){
sub[i] = dic... | a.cc: In function 'void change_dice(char*)':
a.cc:24:12: error: 'strcmp' was not declared in this scope
24 | if(strcmp(East,s) == 0){
| ^~~~~~
a.cc:2:1: note: 'strcmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include<iostream>
+++ |... |
s097361165 | p00425 | C++ | #include<set>
int m[3][4] = {{5,1,2,4},{1,3,1,0},{0,2,3,2}};
int main(){
for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
for(char s[10];n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
scanf("%s",s);
d=-1;
if(s[0]=='L')c+=3;
if(s[0]=='R')c++;
if(s[0]=='W')d=1;
if(s[0]=='N')d=0;
if... | a.cc: In function 'int main()':
a.cc:4:39: error: 'scanf' was not declared in this scope
4 | for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
| ^~~~~
a.cc:4:56: error: 'printf' was not declared in this scope
4 | for(int a,b,c,n,r,d;a=c... |
s451695578 | p00425 | C++ | #include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5};
char s[99];
int main(){
s[87]=1;s[78]=4;s[69]=3;s[83]=2;
for(int a,b,c,n,r,d;a=c=0,b=r=scanf("%d",&n),n;printf("%d\n",r)){
for(gets(s);n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
d=s[*gets(s)];
d?a=m[4*a+(d+c)%4],b=m[4*b+(d+c)%4]:c+... | a.cc: In function 'int main()':
a.cc:7:21: error: 'gets' was not declared in this scope; did you mean 'getw'?
7 | for(gets(s);n--;r+=a%3?b%3?(b+6-a)%6<3?2:5:b?3:4:a?6:1){
| ^~~~
| getw
|
s254132316 | p00425 | C++ | #include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;char s[99];int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));} | a.cc: In function 'int main()':
a.cc:2:170: error: expected primary-expression before ',' token
2 | int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;char s[99];int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b... |
s796009507 | p00425 | C++ | #include<stdio.h>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;char s[99];int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));} | a.cc: In function 'int main()':
a.cc:2:133: error: 'gets' was not declared in this scope; did you mean 'getw'?
2 | int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;char s[99];int main(){ for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;gets(s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m... |
s224386544 | p00425 | C++ | #include<set>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;
char s[99];
int main(){
for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
} | a.cc: In function 'int main()':
a.cc:5:46: error: 'scanf' was not declared in this scope
5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
| ... |
s532259530 | p00425 | C++ | #include<map>
int m[]={5,1,2,4,1,3,1,0,0,2,3,2,2,4,5,1,4,0,4,3,3,5,0,5},a,b,c,d,r;
char s[99];
int main(){
for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
} | a.cc: In function 'int main()':
a.cc:5:46: error: 'scanf' was not declared in this scope
5 | for(s[87]=1,s[78]=4,s[69]=3,s[83]=2;~scanf("%s",s);*s<60?printf(r?"%d\n":0,r),a=c=0,b=r=1:(d=s[*s],d?d=d+c&3,a=m[4*a+d],b=m[4*b+d]:c+=*s-76?1:3,r+=a%3?b%3?(b+6-a)%6<3?2:5:3+!b:a?6:1));
| ... |
s436761663 | p00425 | C++ | #include<iostream>
#include<string>
int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;if(r=="Left")a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=dice[0];}cout... | a.cc: In function 'int main()':
a.cc:3:16: error: 'string' was not declared in this scope
3 | int main(){for(string r;std::cin>>n;){string r;int a,b,c[3]={1,2,3},d,n,s=1;if(!n)break;for(std::cin>>r;n>0;n--){if(r=="North")a=1,b=0;if(r=="East")a=0,b=2;if(r=="West")a=2,b=0;if(r=="South")a=0,b=1;if(r=="Right")a=2,b=1;i... |
s012155581 | p00425 | C++ | N[]={ 6, 14, 18, 10, 2, 9, 22, 15, 1, 17, 23, 7, 3, 5, 21, 19, 0, 13, 20, 11, 4, 8, 16, 12};
E[]={13, 17, 9, 5, 8, 21, 14, 1, 16, 22, 6, 0, 4, 20, 18, 2, 12, 23, 10, 3, 11, 19, 15, 7};
R[]={ 3, 0, 1, 2, 7, 4, 5, 6, 11, 8, 9, 10, 15, 12, 13, 14, 19, 16, 17, 18, 23, 20, 21, 22};
a=-1;
d;
char ... | a.cc:1:1: error: 'N' does not name a type
1 | N[]={ 6, 14, 18, 10, 2, 9, 22, 15, 1, 17, 23, 7, 3, 5, 21, 19, 0, 13, 20, 11, 4, 8, 16, 12};
| ^
a.cc:2:1: error: 'E' does not name a type
2 | E[]={13, 17, 9, 5, 8, 21, 14, 1, 16, 22, 6, 0, 4, 20, 18, 2, 12, 23, 10, 3, 11, 19, 15, 7};
... |
s447812475 | p00425 | C++ | a=-1,A=65,d;
char
*N="GKSOCNWLDFVTBRXHAJUPEMQI",
*E="PHLTIDOXQAGWECSUMBKVJFNR",
s[9];
main(c)
{
for(;c-48&&scanf("%s",s);a+=d/4+1)
{
(c=*s)<A?~a&&printf("%d\n",a),a=d=0:0;
if(c==78)d=N[d]-A;
if(c==69)d=E[d]-A;
if(c==87)d=E[E[E[d]-A]-A]-A;
if(c==83)d=N[N[N[d]-A]-A]-A;
if(c==82)d=d&28|d%4+1&3;
if(c==76)d=d&28|d%4+3&3;
}} | a.cc:1:1: error: 'a' does not name a type
1 | a=-1,A=65,d;
| ^
a.cc:3:4: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
3 | *N="GKSOCNWLDFVTBRXHAJUPEMQI",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:4:4: warning: ISO C++ forbids converting a string constant to 'char*' [-... |
s024218645 | p00425 | C++ | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | a.cc:1:1: error: 'a' does not name a type
1 | a,b,d,n;main(){for(;scanf("%d\n",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&gets(r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}}
|... |
s203384732 | p00425 | C++ | a,b,d,n;main(){for(;scanf("%d",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | a.cc:1:1: error: 'a' does not name a type
1 | a,b,d,n;main(){for(;scanf("%d",&n),n;){char r[9];int c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]=='E')a=0,b=2;if(r[0]=='W')a=2,b=0;if(r[0]=='S')a=0,b=1;if(r[0]=='R')a=2,b=1;if(r[0]=='L')a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}}
... |
s211572914 | p00425 | C++ | main(n){for(;scanf("%d",&n),n;){char r[9];int a,b,d,c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]==69)a=0,b=2;if(r[0]==87)a=2,b=0;if(r[0]==83)a=0,b=1;if(r[0]==82)a=2,b=1;if(r[0]==76)a=1,b=2;d=c[a];c[a]=7-c[b];c[b]=d;s+=c[0];}printf("%d\n",s);}} | a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
1 | main(n){for(;scanf("%d",&n),n;){char r[9];int a,b,d,c[3]={1,2,3},s=1;for(;n>0&&scanf("%s",r);n--){a=1,b=0;if(r[0]==69)a=0,b=2;if(r[0]==87)a=2,b=0;if(r[0]==83)a=0,b=1;if(r[0]==82)a=2,b=1;if(r[0]==76)a=1,b=2;d=c[a];c[a]=7-c[b];... |
s802862055 | p00425 | C++ | #include <stdio.h>
int T,F,R,c,a,t;char s[9];
main()
{
for(;c+21&&gets(s);a+=T)
{
c=*s-69;
c<0?a&&printf("%d\n",a),a=0,T=1,F=2,R=3:0;
c==9?t=T,T=F,F=7-t:0;
c==14?t=F,F=T,T=7-t:0;
!c?t=R,R=T,T=7-t:0;
c==18?t=T,T=R,R=7-t:0;
c==13?t=F,F=R,R=7-t:0;
c==7?t=R,R=F,F=7-t:0;
}} | a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:5:12: error: 'gets' was not declared in this scope; did you mean 'getw'?
5 | for(;c+21&&gets(s);a+=T)
| ^~~~
| getw
|
s047975485 | p00425 | C++ | #import<ios>
int D,d,c,a,X=448;char s[9];
int main()
{
for(;cin>>s;a+=D/64)
c=*s-69,
d=511-D,
D=
c-9?c-14?c?c-18?c-13?c-7?
a&&printf("%d\n",a),a=0,83:
D&X|d*8&56|D/8&7:
D&X|D*8&56|d/8&7:
D*64&X|D&56|d/64:
d*64&X|D&56|D/64:
d*8&X|D/8&56|D&7:
D*8&X|d/8&56|D&7;
} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<ios>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: 'cin' was not declared in this scope
5 | for(;cin>>s;a+=D/64)
| ^~~
|
s567870258 | p00425 | C++ | #import<iostream>
int D,d,c,a,X=448;char s[9];
int main()
{
for(;cin>>s;a+=D/64)
c=*s-69,
d=511-D,
D=
c-9?c-14?c?c-18?c-13?c-7?
a&&printf("%d\n",a),a=0,83:
D&X|d*8&56|D/8&7:
D&X|D*8&56|d/8&7:
D*64&X|D&56|d/64:
d*64&X|D&56|D/64:
d*8&X|D/8&56|D&7:
D*8&X|d/8&56|D&7;
} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<iostream>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:5:6: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | for(;cin>>s;a+=D/64)
| ^~~
| std::cin
In file included from a.cc... |
s284089662 | p00425 | C++ | #import<cstdio>
int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n--;r+=*d-48)scanf("%s",s),*s%6-4a=*s%5+*s%2*2+c&3,t=*d,*d=d[++a],d[++a-1]=d[5],d[5]=d[a%4+1],d[a%4+1]=t:c+=*s+3;} | a.cc:1:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
1 | #import<cstdio>
| ^~~~~~
a.cc: In function 'int main()':
a.cc:2:127: error: unable to find numeric literal operator 'operator""a'
2 | int main(){for(int n,a,c,r,t;c=r=scanf("%d",&n),n;printf("%d\n",r))for(char d[]="123546",s[9];n... |
s528438681 | p00425 | C++ | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
main(t,c){s=!scanf("%d",&c),c?:exit(0);for(m=2,y=3;c--;s+=t)scanf("%s",&r),
r%=8,r-2?r-3?r-4?r-5?r-6?r-7?:mov(&t,&y):mov(&t,&m):mov(&y,&t):mov(&y,&m):mov(&m,&t):mov(&m,&y);
main(1,printf("%d\n",s+1));} | a.cc:1:1: error: 'r' does not name a type
1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
| ^
a.cc:1:9: error: ISO C++ forbids declaration of 'mov' with no type [-fpermissive]
1 | r,m,y,s;mov(int*a,int*b){r=*a,*a=*b,*b=7-r;}
| ^~~
a.cc: In function 'int mov(int*, int*)':
a.cc:1:26: error: '... |
s702789899 | p00425 | C++ | #include <stdio.h>
#include <stdlib.h>
int main(void) {
int top=1,front=2,right=3,n=0,sum=1,swap,;
char opr;
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s",&opr);
switch (opr){
case 'N':
swap=top;
top=front;
front=(7-swap);
break;
case 'E':
swap=right;
right=top;
top=(7-swap);
b... | a.cc: In function 'int main()':
a.cc:6:50: error: expected unqualified-id before ';' token
6 | int top=1,front=2,right=3,n=0,sum=1,swap,;
| ^
|
s770991648 | p00425 | C++ | #include <stdio.h>
#include <stdlib.h>
int main() {
int top=1,front=2,right=3,n=0,sum=1,swap,;
char opr[10];
scanf("%d",&n);
for(int i=0;i<n;i++){
for (int j=0;j<5;j++) scanf("%s",&opr[j]);
switch (opr[0]){
case 'N':
swap=top;
top=front;
front=(7-swap);
break;
case 'E':
swap=right;
righ... | a.cc: In function 'int main()':
a.cc:6:50: error: expected unqualified-id before ';' token
6 | int top=1,front=2,right=3,n=0,sum=1,swap,;
| ^
|
s525718127 | p00425 | C++ | #include <iostream>
#include <string>
using namespace std;
struct{
char s[10];
int d[6];
} map[6]={
{"North",{1,5,2,0,4,3}},
{"East" ,{2,1,5,3,0,4}},
{"West" ,{4,1,0,3,5,2}},
{"South",{3,0,2,5,4,1}},
{"Right",{0,2,3,4,1,5}},
{"Left" ,{0,4,1,2,3,5}}
};
int main(){
int n;
for(;cin>>n,n;){
string s;
int i,j,dice... | a.cc: In function 'int main()':
a.cc:24:25: error: 'memcpy' was not declared in this scope
24 | memcpy(t,dice,sizeof(t));
| ^~~~~~
a.cc:2:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include ... |
s500298875 | p00425 | C++ | #include<cstdio>
#include<string>
#include<iostream>
using namespace std;
int main(){
int n;
string str;
while(true){
for(int i = 0; i < 3; i++){
dice[i] = i + 1;
}
scanf("%d", &n);
if( n == 0){ break;}
// 初期値
int count = 1;
int temp;
for(int i = 0; i < n; i++){
cin >> str;
... | a.cc: In function 'int main()':
a.cc:12:25: error: 'dice' was not declared in this scope
12 | dice[i] = i + 1;
| ^~~~
a.cc:23:32: error: 'dice' was not declared in this scope
23 | temp = dice[0];
| ^... |
s555459898 | p00425 | C++ | #include <iostream>
#include <string>
using namespace std;
class Dice {
private :
void Swap( int &a, int &b ) { int t = a; a = b; b = t; }
public :
union {
struct _X {
int back, front;
int left, right;
int bottom, top;
} X;
struct _Y {
int top, bottom;
int front, back;
int left, right;
} Y... | a.cc:11:24: error: 'struct Dice::<unnamed union>::_X' invalid; an anonymous union may only have public non-static data members [-fpermissive]
11 | struct _X {
| ^~
a.cc:16:24: error: 'struct Dice::<unnamed union>::_Y' invalid; an anonymous union may only have public non-s... |
s547231057 | p00425 | C++ | #include<iostream>
#include<string>
using namespace std;
int main(){
int n;
string f[6]={"North","East","West","South","Right","Left"};
int cf[6][3]={{1,5,2},{4,1,0},{2,1,5},{3,0,2},{0,2,3},{0,4,1}};
int sum=1;
int a=0;
int me[6]={1,2,3,5,4,6};
int ne[3];
cin>>n:
for(int i=0;i<n;i++){
cin>>s;
for(int j=0;j<6;j++){
if(... | a.cc: In function 'int main()':
a.cc:13:7: error: expected ';' before ':' token
13 | cin>>n:
| ^
| ;
a.cc:14:13: error: 'i' was not declared in this scope
14 | for(int i=0;i<n;i++){
| ^
|
s738244120 | p00425 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
string a;
int n;
int b;//上面
int c;//前面
int d;//右面
int e;
int f;
while(cin>>n){
if(n!=0){
b=1;
c=2;
d=3;
e=0;
while(e<n){
cin>>a;
if(a=="North"){f=c; c=7-b; b=f;}
if(a=="East"){f=b; b=7-d; d=f;}
if(a=="West"){f=d; d=7-b; b=f;}
if(a=="South"){f=b; b=7... | a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
29 | }
| ^
a.cc:4:11: note: to match this '{'
4 | int main(){
| ^
|
s202481851 | p00425 | C++ | #include <cstdio>
char opr[10];
int dice(int n){
scanf("%d",&n);
if(n==0) return 0;
int top=1,front=2,right=3,n=0,sum=1,swap;
for(int i=0;i<n;i++){
scanf("%s",opr);
switch (opr[0]){
case 'N':
swap=top;
top=front;
front=(7-swap);
break;
case 'E':
swap=right;
right=top;
top=(7-swap);... | a.cc: In function 'int dice(int)':
a.cc:8:35: error: declaration of 'int n' shadows a parameter
8 | int top=1,front=2,right=3,n=0,sum=1,swap;
| ^
a.cc:5:14: note: 'int n' previously declared here
5 | int dice(int n){
| ~~~~^
a.cc: In function 'int m... |
s686716795 | p00425 | C++ | #include <cstdio>
int n;
char opr[10];
int dice(int n){
scanf("%d",&n);
if(n==0) return 0;
int top=1,front=2,right=3,n=0,sum=1,swap;
for(int i=0;i<n;i++){
scanf("%s",opr);
switch (opr[0]){
case 'N':
swap=top;
top=front;
front=(7-swap);
break;
case 'E':
swap=right;
right=top;
top=(7-... | a.cc: In function 'int dice(int)':
a.cc:8:35: error: declaration of 'int n' shadows a parameter
8 | int top=1,front=2,right=3,n=0,sum=1,swap;
| ^
a.cc:5:14: note: 'int n' previously declared here
5 | int dice(int n){
| ~~~~^
a.cc:47:15: warning: con... |
s841013087 | p00425 | C++ | #include <iostream>
#include <queue>
#include <string>
#include <map>
using namespace std;
typedef pair<int,int> mypair;
int main()
{
int H,W,N,c;
char cmap[1002][1002];
queue<mypair> que;
map<char,mypair>::iterator it;
map<char,mypair> gole;
mypair temp,start;
while(cin >> H >> W >> N && H || W || N){
for(... | a.cc: In function 'int main()':
a.cc:43:28: error: no matching function for call to 'std::map<char, std::pair<int, int> >::insert(char, mypair&)'
43 | gole.insert('0',start);
| ~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/map:63,
from a.cc:4:... |
s167263075 | p00425 | C++ | 100
West
North
North
Right
Left
Right
South
Right
East
Left
North
Right
West
North
East
East
East
North
East
Right
West
Left
West
West
West
West
West
Right
West
East
East
South
West
South
East
North
East
West
Left
South
North
Right
Right
South
Right
North
West
Left
North
Right
North
East
Left
East
West
East
East
Right
... | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 100
| ^~~
|
s170103579 | p00425 | C++ | #include<iostream>
#include<string>
using namespace std;
int North(int *p){
int mem;
mem = p[1];
p[1] = p[2];
p[2] = p[6];
p[6] = p[5];
p[5] = mem;
return p[1];
}
int East(int *p){
int mem;
mem = p[1];
p[1] = p[4];
p[4] = p[6];
p[6] = p[3];
p[3] = mem;
return p[1];
}
int West(int *p){
int ... | a.cc: In function 'int main()':
a.cc:72:21: error: too few arguments to function 'int Left(int*)'
72 | else s += Left();
| ~~~~^~
a.cc:49:5: note: declared here
49 | int Left(int *p){
| ^~~~
|
s485178139 | p00426 | Java | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
... | Main.java:49: error: cannot find symbol
if(queA.size()==n||queC.size==n) return depth;
^
symbol: variable size
location: variable queC of type Deque<Integer>
Main.java:68: error: variable u is already defined in method dfs(int)
int u=dfs(depth+1);
^
Main.java:69: error: method pollFirst... |
s658579181 | p00426 | Java | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
... | Main.java:69: error: method pollFirst in interface Deque<E> cannot be applied to given types;
queA.pollFirst(temp);
^
required: no arguments
found: int
reason: actual and formal argument lists differ in length
where E is a type-variable:
E extends Object declared in interface Deque
Main.java:76: erro... |
s364382730 | p00426 | Java | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
... | Main.java:79: error: variable s might not have been initialized
return Math.min(Math.min(s,t),Math.min(u,v));
^
Main.java:79: error: variable t might not have been initialized
return Math.min(Math.min(s,t),Math.min(u,v));
^
Main.java:79: error: variable u might not ha... |
s134664484 | p00426 | Java | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
... | Main.java:99: error: illegal start of type
return Math.min(Math.min(s,t),Math.min(u,v));
^
Main.java:99: error: <identifier> expected
return Math.min(Math.min(s,t),Math.min(u,v));
^
Main.java:99: error: <identifier> expected
return Math.min(Math.min(s,t),Math.min(u,v));
^
Main.jav... |
s652676826 | p00426 | Java | import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.InputMismatchException;
... | Main.java:78: error: method dfs in class Main cannot be applied to given types;
u=dfs(depth+1,3);
^
required: int
found: int,int
reason: actual and formal argument lists differ in length
Main.java:85: error: method dfs in class Main cannot be applied to given types;
u=dfs(depth+1,3);
^
required: int
fo... |
s801187711 | p00426 | C | #include<stdio.h>
struct cup{
int num;
int item[15];
cup *next;
}
int put(cup *old,cup *new) {
if(old.item[old.num-1]<new.item[new.num-1]){
new.item[new.num]=old.item[old.num-1];
new.num++;
old.num--;
return TRUE;
}
return FALSE;
}
void scan(cup *first){
in... | main.c:6:5: error: unknown type name 'cup'
6 | cup *next;
| ^~~
main.c:9:1: error: expected ';', identifier or '(' before 'int'
9 | int put(cup *old,cup *new) {
| ^~~
main.c:9:9: error: unknown type name 'cup'
9 | int put(cup *old,cup *new) {
| ^~~
main.c:9:18: error: unkno... |
s108059404 | p00426 | C | #include<stdio.h>
struct cup{
int num;
int item[15];
}
int put(struct cup *old,struct cup *new) {
if(old.item[old.num-1]<new.item[new.num-1]){
new.item[new.num]=old.item[old.num-1];
new.num++;
old.num--;
return TRUE;
}
return FALSE;
}
int main(int argc, char const... | main.c:8:1: error: expected ';', identifier or '(' before 'int'
8 | int put(struct cup *old,struct cup *new) {
| ^~~
main.c: In function 'put':
main.c:9:11: error: 'old' is a pointer; did you mean to use '->'?
9 | if(old.item[old.num-1]<new.item[new.num-1]){
| ^
| ->
ma... |
s477633514 | p00426 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct{
int num;
int *cups;
}HANOI;
int n,m;
int min;
void HanoiMove(HANOI *Hanoi, HANOI *prev, int count){
int i,j,k;
int check, count_left, count_right;
HANOI *Move_left, *Move_right;
Move_left=(HANOI *)calloc(4,sizeof(HANOI));
for(i=0;i<4;i++... | main.c: In function 'main':
main.c:135:23: error: 'INT_MAX' undeclared (first use in this function)
135 | min = INT_MAX;
| ^~~~~~~
main.c:4:1: note: 'INT_MAX' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
3 | #include<string... |
s607612818 | p00426 | C | #include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define LEFT 0
#define RIGHT 1
#define QUEUE_SIZE 1500000
typedef struct{
int num;
int cups[15];
}HANOI;
typedef struct{
HANOI current[4];
HANOI privious[4];
int count;
}QUEUE;
int n,m;
int min = INT_MAX;
HANOI Hanoi[4], Prev[4];
HANOI Move_left[4], Move... | main.c:21:11: error: 'INT_MAX' undeclared here (not in a function)
21 | int min = INT_MAX;
| ^~~~~~~
main.c:4:1: note: 'INT_MAX' is defined in header '<limits.h>'; this is probably fixable by adding '#include <limits.h>'
3 | #include<string.h>
+++ |+#include <limits.h>
4 |
|
s209324694 | p00426 | C | m,i,j,k,t[16],c[16],p,d;
int main(n){
for(*t=1;++i<16;)t[i]=n*=3;
for(;scanf("%d%d",&n,&m),n;printf("%d\n",j>m?-1:j=fmin(j,t[n]+~j))){
for(k=3;k--;)
for(scanf("%d",&i);i--;c[j]=k)scanf("%d",&j);
for(p=j=k=0;k++<n;)
j+=t[n-k]*abs(i=p-c[k]),p=i%2*2+p&3;
}
return 0;
} | main.c:1:1: warning: data definition has no type or storage class
1 | m,i,j,k,t[16],c[16],p,d;
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'm' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | m,i,j,k,t[16],c[16],p,d;
| ^
main... |
s858052416 | p00426 | C | #include <iostream>
#include <tuple>
#include <map>
using namespace std;
const int NONE = -1;
typedef tuple<int, int, int> Tuple;
map<Tuple, int> S;
Tuple goal;
int n, m;
int get_last( int m ) {
for ( int i = n - 1; i >= 0; -- i ) {
if ( ( m & ( 1 << i ) ) == ( 1 << i ) ) return 1 << i;
}
return 0... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s310265210 | p00426 | C | c[];f="%d\n";main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}} | main.c:1:1: warning: data definition has no type or storage class
1 | c[];f="%d\n";main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}
| ^
main.c:1:1: error: type defaults t... |
s149332767 | p00426 | C | f="%d\n";c[];main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}} | main.c:1:1: warning: data definition has no type or storage class
1 | f="%d\n";c[];main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}
| ^
main.c:1:1: error: type defaults t... |
s964664058 | p00426 | C | #include <stdio.h>
#define NMAX 15
#define MMAX 15000000
int cup[3];
int cup_move[4][2] = {{0,1},{1,0},{1,2},{2,1}};
int stack[MMAX][3];
int move(int temp[3],int a,int amin, int amax)
{
int i,l,m;
bool flag;
for(m=0;m<4;m++){
if(temp[cup_move[m][0]]>temp[cup_move[m][1]]){
l= 1<<NMAX;
while((l & temp[cup_... | main.c: In function 'move':
main.c:13:9: error: unknown type name 'bool'
13 | bool flag;
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include <stdio.h>
+++ |+#include <stdbool.h>
2 |
main.c:34:32: e... |
s690615519 | p00426 | C++ |
{
finish.push(i);
}
for(int i=0;i<3;i++)
{
int size;
cin>>size;
for(int j=0;j<size;j++)
{
int tmp;
cin>>tmp;
table[i].push(tmp);
}
}
//stack,step;
queue<pair<pair<stack<char>,stack<char> >,pair<stack<char> ,int> > > qu;
qu.push(make_pair(make_pair(... | a.cc:2:9: error: expected unqualified-id before '{' token
2 | {
| ^
a.cc:5:7: error: expected unqualified-id before 'for'
5 | for(int i=0;i<3;i++)
| ^~~
a.cc:5:19: error: 'i' does not name a type
5 | for(int i=0;i<3;i++)
| ^
a.cc:5:23: er... |
s331891207 | p00426 | C++ | #include<iostream>
#include<vector>
#include<queue> | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s635477879 | p00426 | C++ | #include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
typedef struct Cup
{
vector<int>P[3];
int T;
bool operator <(const Cup &a)const{ return T>a.T;};
}S;
int N,M;
bool f[3][3][3][3][3][3][3][3][3][3][3][3][3][3][3];
int main()
{
for(;scanf("%d%d",&N,&M),N;)
{
Cup tmp;
int ... | a.cc: In function 'int main()':
a.cc:20:17: error: 'memset' was not declared in this scope
20 | memset(f,0,sizeof(f));
| ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
4 | #include<algorithm>
+++ |+... |
s876925920 | p00426 | C++ | #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include "graph.h"
#pragma warning(disable:4996)
#define RE... | a.cc:16:10: fatal error: graph.h: No such file or directory
16 | #include "graph.h"
| ^~~~~~~~~
compilation terminated.
|
s956296259 | p00426 | C++ | #include<iostream>
#include<vector>
#include<queue> | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s239876623 | p00426 | C++ | 3 10
1 1
1 3
1 2
4 100
1 3
3 1 2 4
0
5 100
0
4 2 3 4 5
1 1
10 10000
4 1 4 5 9
3 2 3 7
3 6 8 10
15 15000000
4 1 2 9 12
6 4 7 11 13 14 15
5 3 5 6 8 10
0 0 | a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3 10
| ^
|
s044785073 | p00426 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int n, m;
struct puzzle {
char f[3][15];
int len[3], cnt;
};
bool operator==(const puzzle&left, const puzzle&right) {
rep(i, 3) {
if (strcmp(left.f[i], right.f[i]))return false;
}
return true;
}
template<>
class hash<puzzle> {
pub... | a.cc:17:7: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
17 | class hash<puzzle> {
| ^~~~~~~~~~~~
|
s870778045 | p00426 | C++ | #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
int n, m;
struct puzzle {
char f[3][15];
int len[3], cnt;
};
bool operator==(const puzzle&left, const puzzle&right) {
rep(i, 3) {
if (strcmp(left.f[i], right.f[i]))return false;
}
return true;
}
template<>
struct hash<puzzle> {
i... | a.cc:17:8: error: explicit specialization of 'template<class _Tp> struct std::hash' outside its namespace must use a nested-name-specifier [-fpermissive]
17 | struct hash<puzzle> {
| ^~~~~~~~~~~~
|
s321774221 | p00426 | C++ | #include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T... | a.cc: In function 'int solve(const std::array<int, 3>&)':
a.cc:26:37: error: use of deleted function 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map() [with _Key = std::array<int, 3>; _Tp = int; _Hash = std::hash<std::array<int, 3> >; _Pred = std::equal_to<std::array<int, 3> >; _Alloc = std::allocat... |
s560606359 | p00426 | C++ | #include <bits/stdc++.h>
#include <spdlog/spdlog.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 1 << 30
#define LLINF LLONG_MAX/3
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
... | a.cc:2:10: fatal error: spdlog/spdlog.h: No such file or directory
2 | #include <spdlog/spdlog.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
|
s073112532 | p00426 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#define rep(i,s,n) for(int i... | a.cc: In function 'int main()':
a.cc:77:14: error: redeclaration of 'bool curs'
77 | bool curs = 1;
| ^~~~
a.cc:67:14: note: 'bool curs' previously declared here
67 | bool curs = 0;
| ^~~~
|
s455004811 | p00426 | C++ | #include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#define rep(i,s,n) for(int i... | a.cc: In function 'int main()':
a.cc:77:14: error: redeclaration of 'bool curs'
77 | bool curs = 1;
| ^~~~
a.cc:67:14: note: 'bool curs' previously declared here
67 | bool curs = 0;
| ^~~~
|
s978914577 | p00426 | C++ | #include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <functional>
#define INPUT_FROM_FILE (1)
#if INPUT_FROM_FILE
#include <fstream>
#endif
const char Max_n = 15;
int f_A(std::deque<char> stack_A, std::deque<char> stack_B, std::deque<char> stack_C);
int f_B(std::deque<cha... | a.cc: In function 'int f_A(std::deque<char>, std::deque<char>, std::deque<char>)':
a.cc:36:61: error: 'pow' was not declared in this scope
36 | return f_C(stack_A, stack_B, stack_C) + int(pow(3, n));
| ^~~
a.cc:43:65: error: 'pow' was ... |
s335660794 | p00426 | C++ | #include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <functional>
#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif
const char Max_n = 15;
int f_A(std::deque<char> stack_A, std::deque<char> stack_B, std::deque<char> stack_C);
int f_B(std::deque<cha... | a.cc: In function 'int f_A(std::deque<char>, std::deque<char>, std::deque<char>)':
a.cc:36:61: error: 'pow' was not declared in this scope
36 | return f_C(stack_A, stack_B, stack_C) + int(pow(3, n));
| ^~~
a.cc:43:65: error: 'pow' was ... |
s556607986 | p00426 | C++ | #include <iostream>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <functional>
#define INPUT_FROM_FILE (0)
#if INPUT_FROM_FILE
#include <fstream>
#endif
const char Max_n = 15;
int f_A(std::deque<char> stack_A, std::deque<char> stack_B, std::deque<char> stack_C);
int f_B(std::deque<cha... | a.cc: In function 'int f_A(std::deque<char>, std::deque<char>, std::deque<char>)':
a.cc:36:61: error: 'pow' was not declared in this scope
36 | return f_C(stack_A, stack_B, stack_C) + int(pow(3, n));
| ^~~
a.cc:43:65: error: 'pow' was ... |
s700138009 | p00426 | C++ | ??? | a.cc:1:1: error: expected unqualified-id before '?' token
1 | ???
| ^
|
s523510900 | p00426 | C++ | a | a.cc:1:1: error: 'a' does not name a type
1 | a
| ^
|
s287209525 | p00426 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
void input(vector<int> &);
int main() {
int n, m;
vector<int> table;
int point[] = { 0,2 };
int move[] = { 2,0,0 };
while (cin >> n >> m&&n != 0) {
table.resize(n + 1);
input(table);
int ans = (1 << 31) - 1;
int default = 1;
for... | a.cc: In function 'int main()':
a.cc:14:37: warning: integer overflow in expression of type 'int' results in '2147483647' [-Woverflow]
14 | int ans = (1 << 31) - 1;
| ~~~~~~~~~~^~~
a.cc:15:21: error: expected unqualified-id before 'default'
15 | int ... |
s435799516 | p00426 | C++ | #include <cstdio>
int nn = 1, an, bn, cn, a[20], b[20], c[20], total = 0, f = 1;
struct mm{
char ch;
int nu;
};
struct mm m1, m2;
int calculation(int min, int max){
if(min == max)return 0;
if(min < max)int sum = calculation(++min, max) * 3 + 2;
return sum;
}
int move(int flag){
int number;
if(flag == 0){
... | a.cc: In function 'int calculation(int, int)':
a.cc:15:16: error: 'sum' was not declared in this scope
15 | return sum;
| ^~~
|
s891729656 | p00426 | C++ | #include<stdio.h>
int main(void){
int n, m, a[1000], b[10000][1000] = { 0 };
scanf("%d %d", &n, &m);
while ( 1 ) {
for ( i = 0; i < n; i++ ) {
scanf("%d", &a[i]);
for ( j = 0; j < a[i]; j++ ) {
scanf("%d", &b[i][j]);
}
}
for ( i = 0... | a.cc: In function 'int main()':
a.cc:6:15: error: 'i' was not declared in this scope
6 | for ( i = 0; i < n; i++ ) {
| ^
a.cc:8:19: error: 'j' was not declared in this scope
8 | for ( j = 0; j < a[i]; j++ ) {
| ^
a.cc:12:15: error: 'i' was not decl... |
s258982510 | p00426 | C++ | #include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <fstream>
using namespace std;
int main()
{
int N, M, K;
while(cin>>N>>M && (N || M)){
//iÔÚÉå«¢lªÇÌgCɨ¢Ä é©
vector<int> v(N+1);
... | a.cc: In function 'int main()':
a.cc:40:53: error: 'pow' was not declared in this scope
40 | c[i-1] = c[i] + 2 * pow(3.0, N-i+1);
| ^~~
|
s580308503 | p00426 | C++ | #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
using namespace std;
typ... | a.cc: In function 'int bfs(int, std::vector<int>&, std::map<std::vector<int>, int>&)':
a.cc:33:21: error: declaration of 'std::vector<int> sets' shadows a parameter
33 | vector<int> sets;
| ^~~~
a.cc:27:28: note: 'std::vector<int>& sets' previously declared here
27 | int bfs(int ... |
s898698091 | p00426 | C++ | #define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <hash_map>
using... | In file included from /usr/include/c++/14/backward/hash_map:60,
from a.cc:17:
/usr/include/c++/14/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated... |
s288772278 | p00426 | C++ | #include <iostream>
#include <math>
#define step(n) pow(3,x-n+1)/2
using namespace std;
int x,hanoi[16];
int move(int s,int d,int c){
if(abs(s-d)==2) return move(s,1,c)+move(1,d,c);
if(c==x) return abs(s-d);
if(s==d) return move(hanoi[c+1], s, c+1);
for(int i=c+1;i<=x;i++)if(hanoi[i]==s || hanoi[i]==d)return ste... | a.cc:2:10: fatal error: math: No such file or directory
2 | #include <math>
| ^~~~~~
compilation terminated.
|
s310593509 | p00426 | C++ | #include <iostream>
#include <tuple>
#include <map>
#include <climit>
using namespace std;
const int NONE = INT_MAX;
typedef tuple<int, int, int> Tuple;
map<Tuple, int> S;
Tuple goal;
int n, m;
int get_last( int m ) {
for ( int i = n - 1; i >= 0; -- i ) {
if ( ( m & ( 1 << i ) ) == ( 1 << i ) ) return 1 <... | a.cc:4:10: fatal error: climit: No such file or directory
4 | #include <climit>
| ^~~~~~~~
compilation terminated.
|
s872394756 | p00426 | C++ | #include <iostream>
#include <math.h>
#define S(n) (int)(pow(3,x-(n)+1)/2)
using namespace std;
int main(){
int h[17],a[17],c[17],x,i,n,m;
while(cin>>x>>n,n){
for(i=0;i<3;i++)for(cin>>m;m--;h[t]=i)cin>>t;
a[x]=h[x];c[x]=2-h[x];
for(i=x;i>1;i--){
if(h[i-1]==0){
a[i-1]=a[i];
c[i-1]=c[i]+2+4*S(i);
}... | a.cc: In function 'int main()':
a.cc:9:50: error: 't' was not declared in this scope
9 | for(i=0;i<3;i++)for(cin>>m;m--;h[t]=i)cin>>t;
| ^
a.cc:23:17: error: 't' was not declared in this scope
23 | t=min(a[1],c[1]);
| ... |
s636455771 | p00426 | C++ | #include <iostream>
#include <math.h>
#define S(n) (int)(pow(3,x-(n)+1)/2)
using namespace std;
int main(){
int h[17],a[17],c[17],x,i,n,m,t;
while(cin>>x>>n,n){
for(i=0;i<3;i++)for(cin>>m;m--;h[t]=i)cin>>t;
a[x]=h[x];c[x]=2-h[x];
for(i=x;i>1;i--){
if(h[i-1]==0){
a[i-1]=a[i];
c[i-1]=c[i]+2+4*S(i);
... | a.cc: In function 'int main()':
a.cc:24:24: error: no match for 'operator>' (operand types are 'std::basic_ostream<char>' and 'int')
24 | cout<<t>n?-1:t<<endl;
| ~~~~~~~^~
| | |
| | int
| std::basi... |
s002391359 | p00426 | C++ | #include<cstdio>
#include<iostream>
#include <stack>
using namespace std;
void main()
{
stack<int>a,b,c;
while(1)
{
int count=0,n,m,check;
scanf("%d %d",&n,&m);
if(n==0 && m==0)
{
puts("-1");
break;
}
int A,B,C,
kari;
/*エラー対策*/
a.push(0);
b.push(0);
c.push(0);
scanf("%d",&... | a.cc:8:1: error: '::main' must return 'int'
8 | void main()
| ^~~~
|
s062150697 | p00426 | C++ | c[];main(n,m,i,j,k,f){for(f="%d\n";scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}} | a.cc:1:1: error: 'c' does not name a type
1 | c[];main(n,m,i,j,k,f){for(f="%d\n";scanf("%d%d",&n,&m)*n;printf(f,j>m?i:j)){for(i=3;i--;)for(scanf(f,&j);j--;c[n-k]=i)scanf(f,&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}
| ^
a.cc:1:9: error: expected constructor, destructor, or typ... |
s074889354 | p00426 | C++ | #include <iostream>
#include <algorithm>
#include <queue>
#include <map>
#include <vector>
#include <cmath>
using namespace std;
const int MAXN = 17;
const int SSIZE = 15000000;
const int INF = INT_MAX;
const int W = 3;
int N, M;
int three[MAXN];
bool vis[SSIZE];
void init() {
three[0] = 1;
for(int i = 1; i < M... | a.cc:11:17: error: 'INT_MAX' was not declared in this scope
11 | const int INF = INT_MAX;
| ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
6 | #include <cmath>
+++ |+#include <climits>
7 | using namespace std... |
s411123570 | p00426 | C++ | #include <algorithm>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
int n, m;
int ans;
inline int msb(int x) {
if(!x) return 0;
return (1 << (31 - __builtin_clz(x)));
}
void dfs(vector<int> state, vector<int> prev, int cnt = 0) {
if(cnt > min(m, ans))
return;
if(state[0] == (1... | a.cc: In function 'int main()':
a.cc:38:16: error: no matching function for call to 'std::basic_istream<char>::tie(bool)'
38 | cin.tie(false);
| ~~~~~~~^~~~~~~
In file included from /usr/include/c++/14/ios:46,
from /usr/include/c++/14/ostream:40,
from /usr/incl... |
s310402403 | p00426 | C++ | #include <stdio.h>
#include <stdbool.h>
#define INF 15
#define A 0
#define B 1
#define C 2
char cond[INF];
char n;
int m;
int sum;
void move(int pos, char dist) {
char now = cond[pos];
if (now == dist) {
return;
} else if (abs(now-dist) == 2) {
move(pos, B);
move(pos, dist);
... | a.cc: In function 'void move(int, char)':
a.cc:19:16: error: 'abs' was not declared in this scope
19 | } else if (abs(now-dist) == 2) {
| ^~~
|
s633675766 | p00426 | C++ | //E? Nanndatte?
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1... | a.cc: In function 'int rec(std::vector<int>*, int, int)':
a.cc:43:47: error: cannot convert 'std::vector<int>' to 'std::vector<int>*'
43 | val=min(val,rec(_cur[3],a,b-1));
| ~~~~~~^
| |
| ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.