submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3 values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s423153693 | p00436 | C | #include <stdio.h>
#include <stdlib.h>
void shuffle(int **p,int k,int arraynum){
int* first;
first = (int *)calloc(k,sizeof(int));
if(first == NULL){
exit(EXIT_FAILURE);
}
int* second;
second = (int *)calloc(arraynum-k,sizeof(int));
if(second == NULL){
exit(EXIT_FAILURE);
}
int i;
for(i=0;i<k;i++){
first[i] = *p[i];
}
for(;i<arraynum;i++){
second[i-k] = *p[i];
}
for(i=0;i<2*arraynum;i++){
if(i<(arraynum-k)){
*p[i] = second[i];
}
else{
*p[i] = first[i+k-arraynum];
}
}
}
void refshf(int **p,int arraynum){
int* first;
first = (int *)calloc(arraynum,sizeof(int));
int* second;
second = (int *)calloc(arraynum,sizeof(int));
int i;
for(i=0;i<arraynum;i++){
first[i] = *p[i];
second[i] = *p[i+arraynum];
}
for(i=0;i<2*arraynum;i++){
switch(i%2){
case (0):*p[i] = first[i/2];
case (1):*p[i] = second[i/2];
}
}
}
void center(int **p1,int **p2,int arraynum){
int i;
for(i=0;i<sizeof(*p1);i++){
switch(*p1[i]){
case 0: refshf(&(*p2),arraynum);break;
default: shuffle(&(*p2),*p1[i],arraynum);break;
}
}
for(i=0;i<sizeof(p2);i++){
printf("%d\n",*p2[i]);
}
}
int main(void)
{
int arraynum,times;
int *shfjudge,*array;
scanf_s("%d",&arraynum);
array = (int *)calloc(2*arraynum,sizeof(int));
if(array == NULL){
return EXIT_FAILURE;
}
scanf_s("%d",×);
shfjudge = (int *)calloc(times,sizeof(int));
if(shfjudge == NULL){
return EXIT_FAILURE;
}
int i;
for(i=0;i<arraynum;i++){
array[i] = i;
}
for(i=0;i<times;i++){
scanf("%d",&shfjudge[i]);
}
center(&shfjudge,&array,arraynum);
return 0;
}
| main.c: In function 'main':
main.c:69:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
69 | scanf_s("%d",&arraynum);
| ^~~~~~~
| scanf
|
s011856800 | p00436 | C | #include <stdio.h>
#include <stdlib.h>
void shuffle(int **p,int k,int arraynum){
int* first;
first = (int *)calloc(k,sizeof(int));
if(first == NULL){
exit(EXIT_FAILURE);
}
int* second;
second = (int *)calloc(arraynum-k,sizeof(int));
if(second == NULL){
exit(EXIT_FAILURE);
}
int i;
for(i=0;i<k;i++){
first[i] = *p[i];
}
for(;i<arraynum;i++){
second[i-k] = *p[i];
}
for(i=0;i<2*arraynum;i++){
if(i<(arraynum-k)){
*p[i] = second[i];
}
else{
*p[i] = first[i+k-arraynum];
}
}
}
void refshf(int **p,int arraynum){
int* first;
first = (int *)calloc(arraynum,sizeof(int));
int* second;
second = (int *)calloc(arraynum,sizeof(int));
int i;
for(i=0;i<arraynum;i++){
first[i] = *p[i];
second[i] = *p[i+arraynum];
}
for(i=0;i<2*arraynum;i++){
switch(i%2){
case (0):*p[i] = first[i/2];
case (1):*p[i] = second[i/2];
}
}
}
void center(int **p1,int **p2,int arraynum){
int i;
for(i=0;i<sizeof(*p1);i++){
switch(*p1[i]){
case 0: refshf(&(*p2),arraynum);break;
default: shuffle(&(*p2),*p1[i],arraynum);break;
}
}
for(i=0;i<sizeof(p2);i++){
printf("%d\n",*p2[i]);
}
}
int main(void)
{
int arraynum,times;
int *shfjudge,*array;
scanf_s("%d",&arraynum);
array = (int *)calloc(2*arraynum,sizeof(int));
if(array == NULL){
return EXIT_FAILURE;
}
scanf_s("%d",×);
shfjudge = (int *)calloc(times,sizeof(int));
if(shfjudge == NULL){
return EXIT_FAILURE;
}
int i;
for(i=0;i<arraynum;i++){
array[i] = i;
}
for(i=0;i<times;i++){
scanf("%d",&shfjudge[i]);
}
center(&shfjudge,&array,arraynum);
return 0;
}
| main.c: In function 'main':
main.c:69:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
69 | scanf_s("%d",&arraynum);
| ^~~~~~~
| scanf
|
s295211706 | p00436 | C | #include <stdio.h>
int main(){
int n,k,i,j,t,m,a[201],b[201];
scanf("%d",&n);
for(i=1;i<=2*n;i++){
a[i]=i;
}
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d",&k);
if(k==0){
t=1;
for(j=1;j<=n;j=j+2){
b[j]=a[t];
b[j+1]=a[n+t];
t++;
}
for(j=1;j<=2*n;j++){
a[j]=b[j];
}
}
else if(1<=k && k<=2*n-1){
t=1;
for(j=k+1;j<=2*n-k;j++){
b[t]=a[j];
t++;
}
for(j=1;j<=k;j++){
b[t]=a[j];
t++;
}
for(j=1;j<=2*n;j++){
a[j]=b[j];
}
}
for(i=1;i<=2*n;i++){
printf("%d\n",a[i]);
}
return 0;
} | main.c: In function 'main':
main.c:44:1: error: expected declaration or statement at end of input
44 | }
| ^
|
s459740957 | p00436 | C | #include <stdio.h>
int main(void){
int i, j, k, m, n, card[201], tmp[201];
scanf("%d %d", &n, &m);
for(i = 1; i <= 2 * n; i++) card[i] = i;
for(i = 0; i < m; i++){
scanf("%d", &k);
for(j = 1; j <= 2 * n; j++) tmp[j] = card[j];
if(k == 0){
for(j = 1; j <= n; j++);
card[2 * j - 1] = tmp[j];
card[2 * j] = tmp[j + n];
}
}
else{
for(j = 1; j <= 2 * n - k; j++)
card[j] = tmp[j + k];
for(j = 2 * n - k + 1; j <= 2 * n + k)
card[j] = tmp[j - 2 * n + k];
}
}
for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
return 0;
} | main.c: In function 'main':
main.c:18:9: error: 'else' without a previous 'if'
18 | else{
| ^~~~
main.c:21:54: error: expected ';' before ')' token
21 | for(j = 2 * n - k + 1; j <= 2 * n + k)
| ^
| ;
main.c: At top level:
main.c:25:9: error: expected identifier or '(' before 'for'
25 | for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
| ^~~
main.c:25:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
25 | for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
| ^~
main.c:25:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
25 | for(i = 1; i <= 2 * n; i++) printf("%d\n", card[i]);
| ^~
main.c:26:9: error: expected identifier or '(' before 'return'
26 | return 0;
| ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
27 | }
| ^
|
s576732838 | p00436 | C | #include <stdio.h>
int main(void) {
int i,j,k,l,m,n,card[201],tmp[201];
for(i = 0; i <= 200; i++) card[i] = i;
scanf("%d %d", &n, &m);
for(i = 0; i < m; i++){
scanf("%d", &k);
for(j=1; j<=2*n;j++) tmp[j]=card[j];
if(k==0){
for(j=1;j<=n;j++){
card[2*j-1]=tmp[j];
card[2*j]=tmp[j+n];
}
}
else{
for(j=1;j<=n-k;j++){
card[j]=tmp[j+k];
for(j=2*n-k+1;j<=2*n;j++){
card[j]=tmp[j-2*n+k];
}
}
for(i = 1; i <= 2*n; i++)printf("%d\n", card[i]);
return(0);
} | main.c: In function 'main':
main.c:31:1: error: expected declaration or statement at end of input
31 | }
| ^
main.c:31:1: error: expected declaration or statement at end of input
|
s154248413 | p00436 | C++ | #include <iostream>
using namespace std;
void cut(int *p, int k) {
for(i=0;i<k;i++) {
A[i] = *(p+i);
}
for(i=0;i<2*n-k;i++) {
*(p+i) = *(p+i+k)
}
for(i=0;i<k;i++) {
*(p+2*n-k) = A[i];
}
return;
}
void riffle(int *p) {
for(i=0;i<n;i++) {
A[i] = *(p+i);
B[i] = *(p+i+n);
}
for(i=0;i<2*n;i++) {
if(i % 2 == 0) *(p+i) = A[i];
else *(p+i) = B[i];
}
return;
}
int main () {
int n, p[200], m, a, i, A[100], B[100];
cin << n;
for (i=0;i<2*n;i++) {
p[i] = i+1;
}
cin >> m;
for(i=0;i<m;i++) {
cin >> a;
if(a=0) riffle(p);
else cut(p,a);
}
for(i=0;i<2*n;i++) {
cout << p[i] << endl;
}
} | a.cc: In function 'void cut(int*, int)':
a.cc:5:9: error: 'i' was not declared in this scope
5 | for(i=0;i<k;i++) {
| ^
a.cc:6:9: error: 'A' was not declared in this scope
6 | A[i] = *(p+i);
| ^
a.cc:8:9: error: 'i' was not declared in this scope
8 | for(i=0;i<2*n-k;i++) {
| ^
a.cc:8:17: error: 'n' was not declared in this scope
8 | for(i=0;i<2*n-k;i++) {
| ^
a.cc:11:9: error: 'i' was not declared in this scope
11 | for(i=0;i<k;i++) {
| ^
a.cc:12:15: error: 'n' was not declared in this scope
12 | *(p+2*n-k) = A[i];
| ^
a.cc:12:22: error: 'A' was not declared in this scope
12 | *(p+2*n-k) = A[i];
| ^
a.cc: In function 'void riffle(int*)':
a.cc:18:9: error: 'i' was not declared in this scope
18 | for(i=0;i<n;i++) {
| ^
a.cc:18:15: error: 'n' was not declared in this scope
18 | for(i=0;i<n;i++) {
| ^
a.cc:19:9: error: 'A' was not declared in this scope
19 | A[i] = *(p+i);
| ^
a.cc:20:9: error: 'B' was not declared in this scope
20 | B[i] = *(p+i+n);
| ^
a.cc:22:9: error: 'i' was not declared in this scope
22 | for(i=0;i<2*n;i++) {
| ^
a.cc:22:17: error: 'n' was not declared in this scope
22 | for(i=0;i<2*n;i++) {
| ^
a.cc:23:33: error: 'A' was not declared in this scope
23 | if(i % 2 == 0) *(p+i) = A[i];
| ^
a.cc:24:37: error: 'B' was not declared in this scope
24 | else *(p+i) = B[i];
| ^
a.cc: In function 'int main()':
a.cc:31:9: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int')
31 | cin << n;
| ~~~ ^~ ~
| | |
| | int
| std::istream {aka std::basic_istream<char>}
a.cc:31:9: note: candidate: 'operator<<(int, int)' (built-in)
31 | cin << n;
| ~~~~^~~~
a.cc:31:9: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int'
In file included from /usr/include/c++/14/bits/basic_string.h:47,
from /usr/include/c++/14/string:54,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)'
763 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
4077 | operator<<(basic_ostream<_CharT, _Traits>& __os,
| ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
In file included from /usr/include/c++/14/bits/memory_resource.h:38,
from /usr/include/c++/14/string:68:
/usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)'
125 | operator<<(byte __b, _IntegerType __shift) noexcept
| ^~~~~~~~
/usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed:
a.cc:31:5: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte'
31 | cin << n;
| ^~~
In file included from /usr/include/c++/14/bits/ios_base.h:46:
/usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)'
339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
| ^~~~~~~~
/usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)'
563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)'
573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)'
579 | operator<<(basic_ostream<char, _Traits>& __out, char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)'
590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)'
595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
| ^~~~~~~~
/usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)'
654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)'
307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)'
671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:671:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:684:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const signed char*)'
684 | operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
| ^~~~~~~~
/usr/include/c++/14/ostream:684:5: note: template argument deduction/substitution failed:
a.cc:31:12: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>'
31 | cin << n;
| ^
/usr/include/c++/14/ostream:689:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const unsig |
s348496828 | p00436 | C++ | #include <iostream>
using namespace std;
void cut(int *p, int k, int n) {
int A[200], i;
for(i=0;i<k;i++) {
A[i] = *(p+i);
}
for(i=0;i<2*n-k;i++) {
*(p+i) = *(p+i+k)
}
for(i=0;i<k;i++) {
*(p+2*n-k) = A[i];
}
return;
}
void riffle(int *p, int n) {
int A[100], B[100], i;
for(i=0;i<n;i++) {
A[i] = *(p+i);
B[i] = *(p+i+n);
}
for(i=0;i<2*n;i++) {
if(i % 2 == 0) *(p+i) = A[i];
else *(p+i) = B[i];
}
return;
}
int main () {
int n, p[200], m, a, i;
cin >> n;
for (i=0;i<2*n;i++) {
p[i] = i+1;
}
cin >> m;
for(i=0;i<m;i++) {
cin >> a;
if(a=0) riffle(p,n);
else cut(p,a,n);
}
for(i=0;i<2*n;i++) {
cout << p[i] << endl;
}
} | a.cc: In function 'void cut(int*, int, int)':
a.cc:10:26: error: expected ';' before '}' token
10 | *(p+i) = *(p+i+k)
| ^
| ;
11 | }
| ~
|
s948920511 | p00436 | C++ | #include <iostream>
using namespace std;
int n, m, a[1000] = { 1 } ,b[400] ,i;
int katto(){
int f[400] = {};
for (int k = 0; k < (2 * n); i++){
f[i] = b[i];
}
for (int k = 0; k < (2*n)-i; k++){
b[k] = f[i + k];
}
for (int k = 0; k < i; k++){
b[k + i] = f[k];
}
return;
}
int refuru(){
int f[400] = {};
for (int i = 0; i < (2 * n); i++){
f[i * 2] = b[i];
}
for (int i = 0; i < n; i + 2){
f[i + 1] = f[n + i];
}
for (int i = 0; i < 2*n; i++){
b[i] = f[i];
}
return;
}
int main() {
cin >> n >> m;
for (int l = 0; l < (2 * n); l++){
b[l] = l;
}
for ( i = 0; i < m; i ++){
cin >> a[i];
if (a[i] == 0){
refuru();
}
if (a[i] != 0){
katto();
}
}
for (int l = 0; l < (2 * n); l++){
cout << b[i] << endl;
}
return 0;
} | a.cc: In function 'int katto()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
15 | return;
| ^~~~~~
a.cc: In function 'int refuru()':
a.cc:28:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
28 | return;
| ^~~~~~
|
s647119195 | p00436 | C++ | #include <iostream>
using namespace std;
int n, m, a[1000] = { 1 } ,b[400] ,i;
int katto(){
int f[400] = {};
for (int k = 0; k < (2 * n); i++){
f[i] = b[i];
}
for (int k = 0; k < (2*n)-i; k++){
b[k] = f[i + k];
}
for (int k = 0; k < i; k++){
b[k + i] = f[k];
}
return;
}
int refuru(){
int f[400] = {};
for (int i = 0; i < (2 * n); i++){
f[i * 2] = b[i];
}
for (int i = 0; i < n; i + 2){
f[i + 1] = f[n + i];
}
for (int i = 0; i < 2*n; i++){
b[i] = f[i];
}
return;
}
int main() {
cin >> n >> m;
for (int l = 0; l < (2 * n); l++){
b[l] = l;
}
for ( i = 0; i < m; i ++){
cin >> a[i];
if (a[i] == 0){
refuru();
}
if (a[i] != 0){
katto();
}
}
for (int l = 0; l < (2 * n); l++){
cout << b[???] << endl;
}
return 0;
} | a.cc: In function 'int katto()':
a.cc:15:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
15 | return;
| ^~~~~~
a.cc: In function 'int refuru()':
a.cc:28:9: error: return-statement with no value, in function returning 'int' [-fpermissive]
28 | return;
| ^~~~~~
a.cc: In function 'int main()':
a.cc:47:35: error: expected primary-expression before '?' token
47 | cout << b[???] << endl;
| ^
a.cc:47:36: error: expected primary-expression before '?' token
47 | cout << b[???] << endl;
| ^
a.cc:47:37: error: expected primary-expression before '?' token
47 | cout << b[???] << endl;
| ^
a.cc:47:38: error: expected primary-expression before ']' token
47 | cout << b[???] << endl;
| ^
a.cc:47:38: error: expected ':' before ']' token
47 | cout << b[???] << endl;
| ^
| :
a.cc:47:38: error: expected primary-expression before ']' token
a.cc:47:38: error: expected ':' before ']' token
47 | cout << b[???] << endl;
| ^
| :
a.cc:47:38: error: expected primary-expression before ']' token
a.cc:47:38: error: expected ':' before ']' token
47 | cout << b[???] << endl;
| ^
| :
a.cc:47:38: error: expected primary-expression before ']' token
|
s181758948 | p00436 | C++ | #include <cstdio>
using namespace std;
int card[201];
int main()
{
int n, m; cin >> n >> m;
for (int i = 1; i <= 2*n; ++i) card[i] = i;
for (int i = 0; i < m; ++i) {
int k; cin >> k;
int temp[201];
if (k == 0) {
int idx = 1;
for (int j = 1; j <= n; ++j) {
temp[idx] = card[j];
temp[idx+1] = card[n+j];
idx += 2;
}
} else {
int idx = 1;
for (int j = 0; j < 2*n-k; ++j) {
temp[idx++] = card[k+1+j];
}
for (int j = 0; j < k; ++j) {
temp[idx++] = card[j+1];
}
}
for (int j = 1; j <= 2 * n; ++j) {
card[j] = temp[j];
}
}
for (int i = 1; i <= 2*n; ++i) {
printf("%d\n", card[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:9:15: error: 'cin' was not declared in this scope
9 | int n, m; cin >> n >> m;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <cstdio>
+++ |+#include <iostream>
2 |
|
s364698741 | p00436 | C++ | #include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int n;
cin >>n;
int card[205]={0};
int cardA[205]={0};
int cardB[205]={0};
for(int i=0;i<2*n;i++){cards[i]=i+1;}
int m;
cin >>m;
for(int i=0;i<m;i++){
int k;
cin >>k;
if(k==0){
for(int i=0;i<n;i++){cardA[i]=car[i];}
for(int i=0,j=n;i<n;i++,j++){
cardB[i]=card[j];
}
for(int i=0;i<n;i++){
cards[2*i] = cardA[i];
cards[2*i+1] = cardB[i];
}
}
else{
for(int i=0;i<k;i++){cardA[i]=card[i];}
for(int i=k,j=0;i<2*n;i++,j++){cardB[j]=card[i];}
for(int i=0;i<2*n-k;i++){card[i]=cardB[i];}
for(int i=2*n-k,j=0;i<2*n;i++,j++){card[i] = cardA[j];}
}
}
for(int i=0;i<2*n;i++){
cout <<cards[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:14:40: error: 'cards' was not declared in this scope; did you mean 'cardB'?
14 | for(int i=0;i<2*n;i++){cards[i]=i+1;}
| ^~~~~
| cardB
a.cc:21:63: error: 'car' was not declared in this scope; did you mean 'card'?
21 | for(int i=0;i<n;i++){cardA[i]=car[i];}
| ^~~
| card
a.cc:26:41: error: 'cards' was not declared in this scope; did you mean 'cardB'?
26 | cards[2*i] = cardA[i];
| ^~~~~
| cardB
a.cc:38:32: error: 'cards' was not declared in this scope; did you mean 'cardB'?
38 | cout <<cards[i]<<endl;
| ^~~~~
| cardB
|
s101550178 | p00436 | C++ | #include<iostream>
using namespace std;
int n,m,a,k[100000][1001];
int main(){for(int i=1;i<=1000;i++){k[0][i]==i;}
cin>>n>>m;
for(int i=1;i<=m;i++){
cin>>a;
if(a>=1){for(int j=a+1;j<=n*2;j++){k[i][j-a]=k[j-1][j];}
for(int j=1;j<=a;j++){k[i][j+(n-a)]=k[i][j];}}
else{for(int j=1;j<=n;j++){k[i][j*2-1]=k[i][j];}
for(int j=1;j<=n;j+){k[i][j*2]=k[i][j+n];}}
}
for(int i=1;i<=n;i++){cout<<k[m][i]<<endl;}
} | a.cc: In function 'int main()':
a.cc:11:20: error: expected primary-expression before ')' token
11 | for(int j=1;j<=n;j+){k[i][j*2]=k[i][j+n];}}
| ^
|
s672063972 | p00436 | C++ | #include<iostream>
using namespace std;
int riffle();
int cut(int);
int n,m,i,j,k;
int cut(int*card,int k,int n){
int spare[2*n];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];
for(i=0;i<2*n;i++)card[i]=spare_a[i];
}
int riffle(int*card,int n){
int spare[2*n];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare_a[i];
}
int main(){
cin>>n>>m;
int card[2*n];
int spare_a[2*n];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
} | a.cc: In function 'int cut(int*, int, int)':
a.cc:12:27: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
12 | for(i=0;i<2*n;i++)card[i]=spare_a[i];
| ^~~~~~~
| spare
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
a.cc: In function 'int riffle(int*, int)':
a.cc:20:28: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
20 | for(i=0;i<2*n;i++) card[i]=spare_a[i];
| ^~~~~~~
| spare
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
22 | }
| ^
|
s565822628 | p00436 | C++ | #include<iostream>
using namespace std;
int riffle();
int cut(int);
int n,m,i,j,k;
int cut(int*card,int k,int n){
int spare[2*n];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];
for(i=0;i<2*n;i++)card[i]=spare_a[i];
}
int riffle(int*card,int n){
int spare[2*n];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare[i];
}
int main(){
cin>>n>>m;
int card[2*n];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
} | a.cc: In function 'int cut(int*, int, int)':
a.cc:12:27: error: 'spare_a' was not declared in this scope; did you mean 'spare'?
12 | for(i=0;i<2*n;i++)card[i]=spare_a[i];
| ^~~~~~~
| spare
a.cc:13:1: warning: no return statement in function returning non-void [-Wreturn-type]
13 | }
| ^
a.cc: In function 'int riffle(int*, int)':
a.cc:22:1: warning: no return statement in function returning non-void [-Wreturn-type]
22 | }
| ^
|
s378236384 | p00436 | C++ | #include<iostream>
using namespace std;
void cut(int*card,int k,int n){
int spare[200];
for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
for(i=k;i<(2*n);i++) spare[i-k]=card[i];
for(i=0;i<2*n;i++)card[i]=spare[i];
}
void riffle(int*card,int n){
int spare[200];
for(i=0;i<2*n;i++){
spare[i*2]=card[i];
spare[i*2+1]=card[n+i];
}
for(i=0;i<2*n;i++) card[i]=spare[i];
}
int main(){
int n,m,i,k;
cin>>n>>m;
int card[200];
for(i=0;i<2*n;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(card,k,n);else riffle(card,n);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
} | a.cc: In function 'void cut(int*, int, int)':
a.cc:6:5: error: 'i' was not declared in this scope
6 | for(i=0;i<k;i++)spare[(2*n)-k+i]=card[i];
| ^
a.cc:7:5: error: 'i' was not declared in this scope
7 | for(i=k;i<(2*n);i++) spare[i-k]=card[i];
| ^
a.cc:8:5: error: 'i' was not declared in this scope
8 | for(i=0;i<2*n;i++)card[i]=spare[i];
| ^
a.cc: In function 'void riffle(int*, int)':
a.cc:12:5: error: 'i' was not declared in this scope
12 | for(i=0;i<2*n;i++){
| ^
a.cc:16:5: error: 'i' was not declared in this scope
16 | for(i=0;i<2*n;i++) card[i]=spare[i];
| ^
|
s481836248 | p00436 | C++ | #include<iostream>
void cut(int* cards,int n,int k) {
int result[200];
int i;
for(i=0;i<k;i++) {
result[2*n-k+i]=cards[i];
}
for(i=k;i<2*n;i++) {
result[i-k]=cards[i];
}
for(i=0;i<n*2;i++) {
cards[i]=result[i];
}
}
void rf(int* cards,int n) {
int result[200];
int i;
for(i=0;i<n;i++) {
result[i*2]=cards[i];
result[i*2+1]=cards[i+n];
}
for(i=0;i<n*2;i++) {
cards[i]=result[i];
}
}
int main(void) {
int cards[200];
int i,n,m,k;
cin>>n>>m;
for(i=0;i<n*2;i++)cards[i]=i+1;
for(i=0;i<m;i++) {
cin>>k;
if(k==0)rf(cards,n);
else cut(cards,n,k);
}
for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
return 0;
} | a.cc: In function 'int main()':
a.cc:32:2: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
32 | cin>>n>>m;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:39:23: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
39 | for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:39:39: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
39 | for(i=0;i<n*2;i++)cout<<cards[i]<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s663691189 | p00436 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,m,x;
int main()
{
cin>>n>>m;
for(int i=1;i<=2n;i++) value[0][i]=i;
for(int i=0;i<m;i++){
cin>>x;
if(x==0){
for(int j=1;j<=2n;j++){
if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
else value[(i+1)&1][j]=value[i&1][j/2+n];
}
else{
for(int j=1;j<=2*n-k;j++) value[(i+1)&1][j]=value[i&1][k+j];
for(int j=2*n-k+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+k];
}
}
}
for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: unable to find numeric literal operator 'operator""n'
9 | for(int i=1;i<=2n;i++) value[0][i]=i;
| ^~
a.cc:13:19: error: unable to find numeric literal operator 'operator""n'
13 | for(int j=1;j<=2n;j++){
| ^~
a.cc:17:3: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:12:11: note: to match this '{'
12 | if(x==0){
| ^
a.cc:18:24: error: 'k' was not declared in this scope
18 | for(int j=1;j<=2*n-k;j++) value[(i+1)&1][j]=value[i&1][k+j];
| ^
a.cc:19:19: error: 'k' was not declared in this scope
19 | for(int j=2*n-k+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+k];
| ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^~~
a.cc:23:14: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:23:21: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:24:1: error: expected declaration before '}' token
24 | }
| ^
|
s152339899 | p00436 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;
int main()
{
cin>>n>>k;
for(int i=1;i<=2n;i++) value[0][i]=i;
for(int i=0;i<k;i++){
cin>>x;
if(x==0){
for(int j=1;j<=2n;j++){
if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
else value[(i+1)&1][j]=value[i&1][j/2+n];
}
else{
for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
}
}
}
for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
} | a.cc: In function 'int main()':
a.cc:9:17: error: unable to find numeric literal operator 'operator""n'
9 | for(int i=1;i<=2n;i++) value[0][i]=i;
| ^~
a.cc:13:19: error: unable to find numeric literal operator 'operator""n'
13 | for(int j=1;j<=2n;j++){
| ^~
a.cc:17:3: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:12:11: note: to match this '{'
12 | if(x==0){
| ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^~~
a.cc:23:14: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:23:21: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:24:1: error: expected declaration before '}' token
24 | }
| ^
|
s747929509 | p00436 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;
int main()
{
cin>>n>>k;
for(int i=1;i<=2*n;i++) value[0][i]=i;
for(int i=0;i<k;i++){
cin>>x;
if(x==0){
for(int j=1;j<=2*n;j++){
if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
else value[(i+1)&1][j]=value[i&1][j/2+n];
}
else{
for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
}
}
}
for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
} | a.cc: In function 'int main()':
a.cc:17:3: error: expected '}' before 'else'
17 | else{
| ^~~~
a.cc:12:11: note: to match this '{'
12 | if(x==0){
| ^
a.cc: At global scope:
a.cc:23:2: error: expected unqualified-id before 'for'
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^~~
a.cc:23:14: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:23:21: error: 'i' does not name a type
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
a.cc:24:1: error: expected declaration before '}' token
24 | }
| ^
|
s194208144 | p00436 | C++ | #include <iostream>
#include <algorithm>
using namespace std;
int value[2][201],n,k,x;
int main()
{
cin>>n>>k;
for(int i=1;i<=2*n;i++) value[0][i]=i;
for(int i=0;i<k;i++){
cin>>x;
if(x==0){
for(int j=1;j<=2*n;j++){
if(j&1) value[(i+1)&1][j]=value[i&1][j/2+1];
else value[(i+1)&1][j]=value[i&1][j/2+n];
}
}
else{
for(int j=1;j<=2*n-x;j++) value[(i+1)&1][j]=value[i&1][x+j];
for(int j=2*n-x+1;j<=2*n;j++) value[(i+1)&1][j]=value[i&1][j-2*n+x];
}
}
for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
} | a.cc: In function 'int main()':
a.cc:23:38: error: 'm' was not declared in this scope
23 | for(int i=1;i<=2*n;i++) cout<<value[m&1][i]<<endl;
| ^
|
s916004294 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int m; cin >> m;
int k[1000] = {};
for(int i = 0; i < m; i++){
cin >> k[i];
}
int num[200]
for(int i = 0; i < 2 * n; i++){
num[i] = i + 1;
}
for(int i = 0; i < m; i++){
if(k[i] != 0){
int shafled[200];
for(int j = 1; j < 2 * n - k[i]; j++){
shafled[j - 1] = k[i] + j;
}
for(int j = 0; j < k[i]; j++){
shafled[j + 2 * n - k[i]] = j + 1
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}else{
for(int j = 0; j < 2 * n; j += 2){
int shafled[200];
shafled[j] = j + 1;
shafled[j + 1] = n + j + 1;
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}
}
for(int i = 0; i < 2 *n ; i++){
cout << num[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:14:9: error: expected initializer before 'for'
14 | for(int i = 0; i < 2 * n; i++){
| ^~~
a.cc:14:24: error: 'i' was not declared in this scope
14 | for(int i = 0; i < 2 * n; i++){
| ^
a.cc:25:72: error: expected ';' before '}' token
25 | shafled[j + 2 * n - k[i]] = j + 1
| ^
| ;
26 | }
| ~
a.cc:28:33: error: 'nmu' was not declared in this scope
28 | nmu[i] = shafled[i];
| ^~~
a.cc:37:33: error: 'nmu' was not declared in this scope
37 | nmu[i] = shafled[i];
| ^~~
a.cc:37:42: error: 'shafled' was not declared in this scope
37 | nmu[i] = shafled[i];
| ^~~~~~~
a.cc:42:25: error: 'num' was not declared in this scope; did you mean 'enum'?
42 | cout << num[i] << endl;
| ^~~
| enum
|
s549245188 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int m; cin >> m;
int k[1000] = {};
for(int i = 0; i < m; i++){
cin >> k[i];
}
int num[200];
for(int i = 0; i < 2 * n; i++){
num[i] = i + 1;
}
for(int i = 0; i < m; i++){
if(k[i] != 0){
int shafled[200];
for(int j = 1; j < 2 * n - k[i]; j++){
shafled[j - 1] = k[i] + j;
}
for(int j = 0; j < k[i]; j++){
shafled[j + 2 * n - k[i]] = j + 1
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}else{
for(int j = 0; j < 2 * n; j += 2){
int shafled[200];
shafled[j] = j + 1;
shafled[j + 1] = n + j + 1;
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}
}
for(int i = 0; i < 2 *n ; i++){
cout << num[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:25:72: error: expected ';' before '}' token
25 | shafled[j + 2 * n - k[i]] = j + 1
| ^
| ;
26 | }
| ~
a.cc:28:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
28 | nmu[i] = shafled[i];
| ^~~
| num
a.cc:37:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
37 | nmu[i] = shafled[i];
| ^~~
| num
a.cc:37:42: error: 'shafled' was not declared in this scope
37 | nmu[i] = shafled[i];
| ^~~~~~~
|
s678914842 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int m; cin >> m;
int k[1000] = {};
for(int i = 0; i < m; i++){
cin >> k[i];
}
int num[200];
for(int i = 0; i < 2 * n; i++){
num[i] = i + 1;
}
for(int i = 0; i < m; i++){
if(k[i] != 0){
int shafled[200];
for(int j = 1; j < 2 * n - k[i]; j++){
shafled[j - 1] = k[i] + j;
}
for(int j = 0; j < k[i]; j++){
shafled[j + 2 * n - k[i]] = j + 1;
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}else{
for(int j = 0; j < 2 * n; j += 2){
int shafled[200];
shafled[j] = j + 1;
shafled[j + 1] = n + j + 1;
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}
}
for(int i = 0; i < 2 *n ; i++){
cout << num[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
28 | nmu[i] = shafled[i];
| ^~~
| num
a.cc:37:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
37 | nmu[i] = shafled[i];
| ^~~
| num
a.cc:37:42: error: 'shafled' was not declared in this scope
37 | nmu[i] = shafled[i];
| ^~~~~~~
|
s637301719 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int m; cin >> m;
int k[1000] = {};
for(int i = 0; i < m; i++){
cin >> k[i];
}
int num[200];
for(int i = 0; i < 2 * n; i++){
num[i] = i + 1;
}
for(int i = 0; i < m; i++){
if(k[i] != 0){
int shafled[200];
for(int j = 1; j < 2 * n - k[i]; j++){
shafled[j - 1] = k[i] + j;
}
for(int j = 0; j < k[i]; j++){
shafled[j + 2 * n - k[i]] = j + 1;
}
for(int j = 0; j < 2 * n; j++){
nmu[i] = shafled[i];
}
}else{
for(int j = 0; j < 2 * n; j += 2){
int shafled[200];
shafled[j] = j + 1;
shafled[j + 1] = n + j + 1;
}
for(int j = 0; j < 2 * n; j++){
num[i] = shafled[i];
}
}
}
for(int i = 0; i < 2 *n ; i++){
cout << num[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:33: error: 'nmu' was not declared in this scope; did you mean 'num'?
28 | nmu[i] = shafled[i];
| ^~~
| num
a.cc:37:42: error: 'shafled' was not declared in this scope
37 | num[i] = shafled[i];
| ^~~~~~~
|
s407538637 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n; cin >> n;
int m; cin >> m;
int k[1000] = {};
for(int i = 0; i < m; i++){
cin >> k[i];
}
int num[200];
for(int i = 0; i < 2 * n; i++){
num[i] = i + 1;
}
for(int i = 0; i < m; i++){
if(k[i] != 0){
int shafled[200];
for(int j = 1; j < 2 * n - k[i]; j++){
shafled[j - 1] = k[i] + j;
}
for(int j = 0; j < k[i]; j++){
shafled[j + 2 * n - k[i]] = j + 1;
}
for(int j = 0; j < 2 * n; j++){
num[i] = shafled[i];
}
}else{
for(int j = 0; j < 2 * n; j += 2){
int shafled[200];
shafled[j] = j + 1;
shafled[j + 1] = n + j + 1;
}
for(int j = 0; j < 2 * n; j++){
num[i] = shafled[i];
}
}
}
for(int i = 0; i < 2 *n ; i++){
cout << num[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:37:42: error: 'shafled' was not declared in this scope
37 | num[i] = shafled[i];
| ^~~~~~~
|
s583064370 | p00436 | C++ | #include<iostream>
using namespace std;
void riffle(int n,int card[n*2]);
void cut(int k,int n,int card[n*2]);
int main(){
int n,m,k,i;
cin>>n>>m;
int card[n*2];
for(i=0;i<n*2;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(k,n,card);else riffle(n,card);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}
void cut(int k,int n,int card[n*2]){
int a[n],b[n],i;
for(i=0;i<k;i++)a[i]=card[i];
for(i=k;i<2*n;i++)b[i-k]=card[i];
for(i=k;i<2*n;i++)card[i-k]=b[i-k];
for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
}
void riffle(int n,int card[n*2]){
int a[n],b[n],i,j=0;
for(i=0;i<n;i++)a[i]=card[i];
for(i=n;i<2*n;i++)b[i-n]=card[i];
for(i=0;i<n;i++){
card[j]=a[i];
card[j+1]=b[i];
j+=2;
}
} | a.cc:3:29: error: use of parameter outside function body before '*' token
3 | void riffle(int n,int card[n*2]);
| ^
a.cc:4:32: error: use of parameter outside function body before '*' token
4 | void cut(int k,int n,int card[n*2]);
| ^
a.cc:19:32: error: use of parameter outside function body before '*' token
19 | void cut(int k,int n,int card[n*2]){
| ^
a.cc: In function 'void cut(...)':
a.cc:20:7: error: 'n' was not declared in this scope
20 | int a[n],b[n],i;
| ^
a.cc:21:11: error: 'k' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:17: error: 'a' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:22: error: 'card' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^~~~
a.cc:22:7: error: 'k' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:19: error: 'b' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:26: error: 'card' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^~~~
a.cc:23:7: error: 'k' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:23:19: error: 'card' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^~~~
a.cc:23:29: error: 'b' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:24:11: error: 'k' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc:24:17: error: 'card' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^~~~
a.cc:24:33: error: 'a' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc: At global scope:
a.cc:26:29: error: use of parameter outside function body before '*' token
26 | void riffle(int n,int card[n*2]){
| ^
a.cc: In function 'void riffle(...)':
a.cc:27:11: error: 'n' was not declared in this scope
27 | int a[n],b[n],i,j=0;
| ^
a.cc:28:17: error: 'a' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^
a.cc:28:22: error: 'card' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^~~~
a.cc:29:19: error: 'b' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^
a.cc:29:26: error: 'card' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^~~~
a.cc:31:5: error: 'card' was not declared in this scope
31 | card[j]=a[i];
| ^~~~
a.cc:31:13: error: 'a' was not declared in this scope
31 | card[j]=a[i];
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | card[j+1]=b[i];
| ^
|
s014018459 | p00436 | C++ | #include<iostream>
using namespace std;
void riffle(int n,int card[n*2]);
void cut(int k,int n,int card[n*2]);
int main(){
int n,m,k,i;
cin>>n>>m;
int card[n*2];
for(i=0;i<n*2;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(k,n,card);else riffle(n,card);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}
void cut(int k,int n,int card[n*2]){
int a[n],b[n],i;
for(i=0;i<k;i++)a[i]=card[i];
for(i=k;i<2*n;i++)b[i-k]=card[i];
for(i=k;i<2*n;i++)card[i-k]=b[i-k];
for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
}
void riffle(int n,int card[n*2]){
int a[n],b[n],i,j=0;
for(i=0;i<n;i++)a[i]=card[i];
for(i=n;i<2*n;i++)b[i-n]=card[i];
for(i=0;i<n;i++){
card[j]=a[i];
card[j+1]=b[i];
j+=2;
}
}
} | a.cc:3:29: error: use of parameter outside function body before '*' token
3 | void riffle(int n,int card[n*2]);
| ^
a.cc:4:32: error: use of parameter outside function body before '*' token
4 | void cut(int k,int n,int card[n*2]);
| ^
a.cc:19:32: error: use of parameter outside function body before '*' token
19 | void cut(int k,int n,int card[n*2]){
| ^
a.cc: In function 'void cut(...)':
a.cc:20:7: error: 'n' was not declared in this scope
20 | int a[n],b[n],i;
| ^
a.cc:21:11: error: 'k' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:17: error: 'a' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:22: error: 'card' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^~~~
a.cc:22:7: error: 'k' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:19: error: 'b' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:26: error: 'card' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^~~~
a.cc:23:7: error: 'k' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:23:19: error: 'card' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^~~~
a.cc:23:29: error: 'b' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:24:11: error: 'k' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc:24:17: error: 'card' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^~~~
a.cc:24:33: error: 'a' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc: At global scope:
a.cc:26:29: error: use of parameter outside function body before '*' token
26 | void riffle(int n,int card[n*2]){
| ^
a.cc: In function 'void riffle(...)':
a.cc:27:11: error: 'n' was not declared in this scope
27 | int a[n],b[n],i,j=0;
| ^
a.cc:28:17: error: 'a' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^
a.cc:28:22: error: 'card' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^~~~
a.cc:29:19: error: 'b' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^
a.cc:29:26: error: 'card' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^~~~
a.cc:31:5: error: 'card' was not declared in this scope
31 | card[j]=a[i];
| ^~~~
a.cc:31:13: error: 'a' was not declared in this scope
31 | card[j]=a[i];
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | card[j+1]=b[i];
| ^
a.cc: At global scope:
a.cc:36:1: error: expected declaration before '}' token
36 | }
| ^
|
s435727104 | p00436 | C++ | #include<iostream>
using namespace std;
void riffle(int n,int card[n*2]);
void cut(int k,int n,int card[n*2]);
int main(){
int n,m,k,i;
cin>>n>>m;
int card[n*2];
for(i=0;i<n*2;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(k,n,card);else riffle(n,card);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}
void cut(int k,int n,int card[n*2]){
int a[n],b[n],i;
for(i=0;i<k;i++)a[i]=card[i];
for(i=k;i<2*n;i++)b[i-k]=card[i];
for(i=k;i<2*n;i++)card[i-k]=b[i-k];
for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
}
void riffle(int n,int card[n*2]){
int a[n],b[n],i,j=0;
for(i=0;i<n;i++)a[i]=card[i];
for(i=n;i<2*n;i++)b[i-n]=card[i];
for(i=0;i<n;i++){
card[j]=a[i];
card[j+1]=b[i];
j+=2;
}
}
} | a.cc:3:29: error: use of parameter outside function body before '*' token
3 | void riffle(int n,int card[n*2]);
| ^
a.cc:4:32: error: use of parameter outside function body before '*' token
4 | void cut(int k,int n,int card[n*2]);
| ^
a.cc:19:32: error: use of parameter outside function body before '*' token
19 | void cut(int k,int n,int card[n*2]){
| ^
a.cc: In function 'void cut(...)':
a.cc:20:7: error: 'n' was not declared in this scope
20 | int a[n],b[n],i;
| ^
a.cc:21:11: error: 'k' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:17: error: 'a' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:22: error: 'card' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^~~~
a.cc:22:7: error: 'k' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:19: error: 'b' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:26: error: 'card' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^~~~
a.cc:23:7: error: 'k' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:23:19: error: 'card' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^~~~
a.cc:23:29: error: 'b' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:24:11: error: 'k' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc:24:17: error: 'card' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^~~~
a.cc:24:33: error: 'a' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc: At global scope:
a.cc:26:29: error: use of parameter outside function body before '*' token
26 | void riffle(int n,int card[n*2]){
| ^
a.cc: In function 'void riffle(...)':
a.cc:27:11: error: 'n' was not declared in this scope
27 | int a[n],b[n],i,j=0;
| ^
a.cc:28:17: error: 'a' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^
a.cc:28:22: error: 'card' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^~~~
a.cc:29:19: error: 'b' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^
a.cc:29:26: error: 'card' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^~~~
a.cc:31:5: error: 'card' was not declared in this scope
31 | card[j]=a[i];
| ^~~~
a.cc:31:13: error: 'a' was not declared in this scope
31 | card[j]=a[i];
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | card[j+1]=b[i];
| ^
a.cc: At global scope:
a.cc:36:1: error: expected declaration before '}' token
36 | }
| ^
|
s355181113 | p00436 | C++ | #include<iostream>
using namespace std;
void riffle(int n,int card[]);
void cut(int k,int n,int card[]);
int main(){
int n,m,k,i;
cin>>n>>m;
int card[n*2];
for(i=0;i<n*2;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(k,n,card);else riffle(n,card);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}
void cut(int k,int n,int card[n*2]){
int a[n],b[n],i;
for(i=0;i<k;i++)a[i]=card[i];
for(i=k;i<2*n;i++)b[i-k]=card[i];
for(i=k;i<2*n;i++)card[i-k]=b[i-k];
for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
}
void riffle(int n,int card[n*2]){
int a[n],b[n],i,j=0;
for(i=0;i<n;i++)a[i]=card[i];
for(i=n;i<2*n;i++)b[i-n]=card[i];
for(i=0;i<n;i++){
card[j]=a[i];
card[j+1]=b[i];
j+=2;
}
}
} | a.cc:19:32: error: use of parameter outside function body before '*' token
19 | void cut(int k,int n,int card[n*2]){
| ^
a.cc: In function 'void cut(...)':
a.cc:20:7: error: 'n' was not declared in this scope
20 | int a[n],b[n],i;
| ^
a.cc:21:11: error: 'k' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:17: error: 'a' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^
a.cc:21:22: error: 'card' was not declared in this scope
21 | for(i=0;i<k;i++)a[i]=card[i];
| ^~~~
a.cc:22:7: error: 'k' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:19: error: 'b' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^
a.cc:22:26: error: 'card' was not declared in this scope
22 | for(i=k;i<2*n;i++)b[i-k]=card[i];
| ^~~~
a.cc:23:7: error: 'k' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:23:19: error: 'card' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^~~~
a.cc:23:29: error: 'b' was not declared in this scope
23 | for(i=k;i<2*n;i++)card[i-k]=b[i-k];
| ^
a.cc:24:11: error: 'k' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc:24:17: error: 'card' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^~~~
a.cc:24:33: error: 'a' was not declared in this scope
24 | for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
| ^
a.cc: At global scope:
a.cc:26:29: error: use of parameter outside function body before '*' token
26 | void riffle(int n,int card[n*2]){
| ^
a.cc: In function 'void riffle(...)':
a.cc:27:11: error: 'n' was not declared in this scope
27 | int a[n],b[n],i,j=0;
| ^
a.cc:28:17: error: 'a' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^
a.cc:28:22: error: 'card' was not declared in this scope
28 | for(i=0;i<n;i++)a[i]=card[i];
| ^~~~
a.cc:29:19: error: 'b' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^
a.cc:29:26: error: 'card' was not declared in this scope
29 | for(i=n;i<2*n;i++)b[i-n]=card[i];
| ^~~~
a.cc:31:5: error: 'card' was not declared in this scope
31 | card[j]=a[i];
| ^~~~
a.cc:31:13: error: 'a' was not declared in this scope
31 | card[j]=a[i];
| ^
a.cc:32:15: error: 'b' was not declared in this scope
32 | card[j+1]=b[i];
| ^
a.cc: At global scope:
a.cc:36:1: error: expected declaration before '}' token
36 | }
| ^
|
s894058204 | p00436 | C++ | #include<iostream>
using namespace std;
void riffle(int n,int card[]);
void cut(int k,int n,int card[]);
int main(){
int n,m,k,i;
cin>>n>>m;
int card[n*2];
for(i=0;i<n*2;i++)card[i]=i+1;
for(i=0;i<m;i++){
cin>>k;
if(k!=0)cut(k,n,card);else riffle(n,card);
}
for(i=0;i<2*n;i++)cout<<card[i]<<endl;
return 0;
}
void cut(int k,int n,int card[]){
int a[n],b[n],i;
for(i=0;i<k;i++)a[i]=card[i];
for(i=k;i<2*n;i++)b[i-k]=card[i];
for(i=k;i<2*n;i++)card[i-k]=b[i-k];
for(i=0;i<k;i++)card[i+(2*n)-k]=a[i];
}
void riffle(int n,int card[]){
int a[n],b[n],i,j=0;
for(i=0;i<n;i++)a[i]=card[i];
for(i=n;i<2*n;i++)b[i-n]=card[i];
for(i=0;i<n;i++){
card[j]=a[i];
card[j+1]=b[i];
j+=2;
}
}
} | a.cc:36:1: error: expected declaration before '}' token
36 | }
| ^
|
s103929423 | p00436 | C++ | riffle = lambda half, x: [j for i in zip(x[:half], x[half:]) for j in i]
cut = lambda index, x: x[index:] + x[:index]
cards = [str(x) for x in range(1, int(input())*2 + 1)]
half = int(len(cards) / 2)
for _ in range(int(input())):
order = int(input())
if order == 0:
cards = riffle(half, cards)
else:
cards = cut(order, cards)
print("\n".join(cards)) | a.cc:1:1: error: 'riffle' does not name a type
1 | riffle = lambda half, x: [j for i in zip(x[:half], x[half:]) for j in i]
| ^~~~~~
|
s141109292 | p00436 | C++ | #include <iostream>
#include <vector>
using namespace std;
void shuffle(int n, vector<int> stock);
void cut(int n, int k, vector<int> stock);
int main() {
int n, m;
int k;
cin >> n;
cin >> m;
for (int i = 0; i < m; i++) {
cin >> k;
if (k == 0) shuffle(n, stock);
else cut(n, k, stock);
}
for (int i = 0; i < n; i++) {
cout << stock[i] << endl;
}
return 0;
}
void shuffle(int n, vector<int> stock) {
vector<int> res;
for (int i = 0; i < n / 2; i++) {
res.push_back(stock[i]);
res.push_back(stock[i + n]);
}
for (int i = 0; i < n; i++) stock[i] = res[i];
}
void cut(int n, int k, vector<int> stock) {
vector<int> res;
for (int i = k; i < n; i++) res.push_back(stock[i]);
for (int i = 0; i < k; i++) res.push_back(stock[i]);
for (int i = 0; i < n; i++) stock[i] = res[i];
} | a.cc: In function 'int main()':
a.cc:14:28: error: 'stock' was not declared in this scope
14 | if (k == 0) shuffle(n, stock);
| ^~~~~
a.cc:15:20: error: 'stock' was not declared in this scope
15 | else cut(n, k, stock);
| ^~~~~
a.cc:18:13: error: 'stock' was not declared in this scope
18 | cout << stock[i] << endl;
| ^~~~~
|
s802857082 | p00436 | C++ | #include <iostream>
#include <vector>
using namespace std;
void shuffle(vector<int>& stock);
void cut(int k, vector<int>& stock);
int main() {
int n, m, k;
int size = 2 * n;
vector<int> stock;
cin >> n;
cin >> m;
for (int i = 0; i < size; i++) stock.push_back(i + 1);
for (int i = 0; i < m; i++) {
cin >> k;
if (k == 0) shuffle(stock);
else cut(k, stock);
}
for (int i = 0; i < size; i++) cout << stock[i] << endl;
return 0;
}
void shuffle(vector<int>& stock) {
vector<int> res;
int size = stock.size();
for (int i = 0; i < n; i++) {
res.push_back(stock[i]);
res.push_back(stock[i + n]);
}
for (int i = 0; i < size; i++) stock[i] = res[i];
}
void cut(int k, vector<int>& stock) {
int size = stock.size();
vector<int> res;
for (int i = k; i < size; i++) res.push_back(stock[i]);
for (int i = 0; i < k; i++) res.push_back(stock[i]);
for (int i = 0; i < size; i++) stock[i] = res[i];
} | a.cc: In function 'void shuffle(std::vector<int>&)':
a.cc:25:23: error: 'n' was not declared in this scope
25 | for (int i = 0; i < n; i++) {
| ^
|
s477643961 | p00436 | C++ | #include "stdafx.h"
#include "cstdio"
#include <vector>
#include <iostream>
using namespace std;
inline vector<int> shuffle(vector<int> stock) {
vector<int> result;
int n = stock.size() / 2; //stock???????????????????´???°???????????§?????£???n?????£??\
for (int i = 0; i < n; i++) {
result.push_back(stock[i]);//result???stock[i]?????????
result.push_back(stock[i + n]);//result???stock[i+n]??????????????????
}
return stock; //stock?????????????????????????????????
}
inline vector<int> cut(vector<int> stock, int k) {
vector<int> result;
for (int i = k; i < stock.size(); i++)
result.push_back(stock[i]);
for (int i = 0; i < k; i++)
result.push_back(stock[i]);
return result;
}
int main() {
int n, m;
cin >> n;
cin >> m;
cout << n << endl;// end line = ??????
vector<int> stock(2 * n);//()???????´???°
for (int i = 0; i < 2 * n; i++)
stock[i] = i + 1;
for (int i = 0; i < m; i++) {
int k;
cin >> k;
cout << k;
if (k == 0) {
stock = shuffle(stock);
}
else {
stock = cut(stock, k);
}
}
for (int i = 0; i<stock.size(); i++){
printf("%d\n", stock[i]);
}
return 0;
} | a.cc:1:10: fatal error: stdafx.h: No such file or directory
1 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s140056876 | p00436 | C++ |
#include "stdafx.h"
#include "cstdio"
#include <vector>
#include <iostream>
using namespace std;
inline vector<int> shuffle(vector<int> stock) {
vector<int> result;
int n = stock.size() / 2; //stock???????????????????´???°???????????§?????£???n?????£??\
for (int i = 0; i < n; i++) {
result.push_back(stock[i]);//result???stock[i]?????????
result.push_back(stock[i + n]);//result???stock[i+n]??????????????????
}
return stock; //stock?????????????????????????????????
}
inline vector<int> cut(vector<int> stock, int k) {
vector<int> result;
for (int i = k; i < stock.size(); i++)
result.push_back(stock[i]);
for (int i = 0; i < k; i++)
result.push_back(stock[i]);
return result;
}
int main() {
int n, m;
cin >> n;
cin >> m;
cout << n << endl;// end line = ??????
vector<int> stock(2 * n);//()???????´???°
for (int i = 0; i < 2 * n; i++)
stock[i] = i + 1;
for (int i = 0; i < m; i++) {
int k;
cin >> k;
cout << k;
if (k == 0) {
stock = shuffle(stock);
}
else {
stock = cut(stock, k);
}
}
for (int i = 0; i<stock.size(); i++){
printf("%d\n", stock[i]);
}
return 0;
} | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s741330500 | p00436 | C++ |
#include "stdafx.h"
#include "cstdio"
#include <vector>
#include <iostream>
using namespace std;
inline vector<int> shuffle(vector<int> stock) {
vector<int> result;
int n = stock.size() / 2; //stock???????????????????´???°???????????§?????£???n?????£??\
for (int i = 0; i < n; i++) {
result.push_back(stock[i]);//result???stock[i]?????????
result.push_back(stock[i + n]);//result???stock[i+n]??????????????????
}
return stock; //stock?????????????????????????????????
}
inline vector<int> cut(vector<int> stock, int k) {
vector<int> result;
for (int i = k; i < stock.size(); i++)
result.push_back(stock[i]);
for (int i = 0; i < k; i++)
result.push_back(stock[i]);
return result;
}
int main() {
int n, m;
cin >> n;
cin >> m;
vector<int> stock(2 * n);//()???????´???°
for (int i = 0; i < 2 * n; i++)
stock[i] = i + 1;
for (int i = 0; i < m; i++) {
int k;
cin >> k;
if (k == 0) {
stock = shuffle(stock);
}
else {
stock = cut(stock, k);
}
}
for (int i = 0; i<stock.size(); i++){
//printf("%d\n", stock[i]);
cout << stock[i];
}
return 0;
} | a.cc:2:10: fatal error: stdafx.h: No such file or directory
2 | #include "stdafx.h"
| ^~~~~~~~~~
compilation terminated.
|
s062462474 | p00436 | C++ | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main (void)
{
string a;
int k,n,A,B,zzz;
for (int i = 0; i < 100; i++)
{
cin >> n;
cin >> a;
for (int j = 0; j < 2n; j++)
{
cin >> k;
A = 0;
B = n;
zzz = 0;
if (k == 0)
{
for (int z = 0; z < n; z++)
{
a.substr(A,A + 1) = a.substr(z,n);
A += 2;
n++;
}
}
else if (k > 1 && k < 100)
{
a.substr(0,k - 1) = a.substr(k,2n - 1);
a.substr(k,2n - 1) = a.substr(0,k - 1);
}
}
}
} | a.cc: In function 'int main()':
a.cc:24:26: error: unable to find numeric literal operator 'operator""n'
24 | for (int j = 0; j < 2n; j++)
| ^~
a.cc:41:49: error: unable to find numeric literal operator 'operator""n'
41 | a.substr(0,k - 1) = a.substr(k,2n - 1);
| ^~
a.cc:42:29: error: unable to find numeric literal operator 'operator""n'
42 | a.substr(k,2n - 1) = a.substr(0,k - 1);
| ^~
|
s917821118 | p00436 | C++ | #include<stdio.h>
#include<string.h>
#include<stdlib.h>
int i,j;
int k[1002],n,m,a[204],b[204];
int main(){
scanf("%d",&n);
for(i=1;i<=n*2;i++)a[i]=i,b[i]=i;
scanf("%d",&m);
for(i=0;i<m;i++)fscanf("%d",&k[i]);
for(i=0;i<m;i++){
if(k[i]==0){
for(j=1;j<=n*2;j++){
if(j%2==1)b[j]=a[(j+1)/2];
else b[j]=a[n+j/2];
}
for(j=1;j<=n*2;j++)a[j]=b[j];
}else{
for(j=1;j<=n*2;j++){
if(j<=n*2-k[i])b[j]=a[k[i]+j];
else b[j]=a[j-n*2+k[i]];
}
for(j=1;j<=n*2;j++)a[j]=b[j];
}
}
for(i=1;i<=n*2;i++)printf("%d\n",a[i]);
return 0;
} | a.cc: In function 'int main()':
a.cc:12:32: error: cannot convert 'const char*' to 'FILE*'
12 | for(i=0;i<m;i++)fscanf("%d",&k[i]);
| ^~~~
| |
| const char*
In file included from a.cc:1:
/usr/include/stdio.h:422:37: note: initializing argument 1 of 'int fscanf(FILE*, const char*, ...)'
422 | extern int fscanf (FILE *__restrict __stream,
| ~~~~~~~~~~~~~~~~~^~~~~~~~
|
s661150003 | p00436 | C++ | #include <iostream>
using namespace std;
int main(){
int n, m;
int card[2][200];
while(cin >> n >> m){
for(int i=0;i<2*n;i++) card[0][i] = i;
for(int i=0;i<m;i++){
int cur = i%2, next = 1-i%2;
int K; cin >> K;
if(K>0){
for(int i=0;i<2*n;i++) card[next][i] = card[cur][(i+K)%(2*n)];
} else {
for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
}
}
for(int i=0;i<2*n;i++) cout << card[m%2][i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:16:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
16 | for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
| ^
a.cc:16:24: error: found ':' in nested-name-specifier, expected '::'
16 | for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
| ^
| ::
a.cc:16:23: error: 'n' is not a class, namespace, or enumeration
16 | for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
| ^
a.cc:17:9: error: expected primary-expression before 'for'
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^~~
a.cc:16:61: error: expected ';' before 'for'
16 | for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
| ^
| ;
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ~~~
a.cc:17:9: error: expected primary-expression before 'for'
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^~~
a.cc:16:61: error: expected ')' before 'for'
16 | for(int i=0;i<n:i++) card[next][2*i] = card[cur][i];
| ~ ^
| )
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ~~~
a.cc:17:21: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^
a.cc:17:24: error: found ':' in nested-name-specifier, expected '::'
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^
| ::
a.cc:17:23: error: 'n' is not a class, namespace, or enumeration
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^
a.cc:18:7: error: expected primary-expression before '}' token
18 | }
| ^
a.cc:17:65: error: expected ';' before '}' token
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ^
| ;
18 | }
| ~
a.cc:18:7: error: expected primary-expression before '}' token
18 | }
| ^
a.cc:17:65: error: expected ')' before '}' token
17 | for(int i=0;i<n:i++) card[next][2*i+1] = card[cur][i+K];
| ~ ^
| )
18 | }
| ~
a.cc:18:7: error: expected primary-expression before '}' token
18 | }
| ^
|
s173546797 | p00436 | C++ | #include "stdio.h"
int c[200];
int c2[200];
int main()
{
int n;
scanf("%d",&n);
int m;
scanf("%d",&m);
for(int i = 0; i < 2 * n; i++)
{
c[i] = i + 1;
}
for(int i = 0; i < m; i++)
{
int w;
scanf("%d",&w);
if(w == 0)
{
for(int i = 0; i < n; i++)
{
c2[i * 2] = c[i];
c2[i * 2 + 1] = c[n + i];
}
}
else
{
int h = 0;
for(int i = w; i < 2 * n; i++)
{
c2[h] = c[i];
h++;
}
for(int i = 0; i < w; i++)
{
c2[h] = c[i];
}
}
for(int i = 0; i < 2 * n; i++)
{
c[i] = c2[i];
}
}
for(int i = 0; i < 2 * n; I++)
{
printf("%d\n",c[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:46:27: error: 'I' was not declared in this scope
46 | for(int i = 0; i < 2 * n; I++)
| ^
|
s580798743 | p00437 | Java | import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Quality_Checking {
public static void main(String[] args) throws Exception {
// TODO ?????????????????????????????????????????????
int[] arg =new int[100];
int i=0,sum=0,num=0;
int[] motor=null,cav=null,io=null,all=null;
int[][] result=null;
boolean first=true;
try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
String line;
while ((line = br.readLine()) != null) {
if(first){
String[] str=line.split(" ");
if(str[0].equals(str[1])&&str[2].equals(str[1])&&str[0].equals("0"))break;
io=new int[Integer.parseInt(str[0])];
motor=new int[Integer.parseInt(str[1])];
cav=new int[Integer.parseInt(str[2])];
all=new int[io.length+motor.length+cav.length+1];
for(int k=1;k<all.length;k++){
all[k]=2;
}
num=Integer.parseInt(br.readLine());
result=new int[num][4];
i=0;
first=false;
}else{
String[] str=line.split(" ");
for(int k=0;k<4;k++){
result[i][k]=Integer.parseInt(str[k]);
}
i++;
if(i==num){
for(int k=0;k<result.length;k++){
if(result[k][3]==1){
for(int j=0;j<3;j++){
all[result[k][j]]=1;
}
}
}
for(int k=0;k<result.length;k++){
if(result[k][3]==0){
if(all[result[k][0]]==1&&all[result[k][1]]==1){
all[result[k][2]]=0;
}else if(all[result[k][2]]==1&&all[result[k][1]]==1){
all[result[k][0]]=0;
}else if(all[result[k][0]]==1&&all[result[k][2]]==1){
all[result[k][1]]=0;
}
}
}
for(int k=1;k<all.length;k++){
System.out.println(all[k]);
}
first=true;
}
}
}
}
}
} | Main.java:4: error: class Quality_Checking is public, should be declared in a file named Quality_Checking.java
public class Quality_Checking {
^
1 error
|
s874525753 | p00437 | Java | import java.util.Scanner;
public class q6{
public static void main(String[] args){
final int WIN = 3, PASS = 1, FAIL = 0, UNKNOWN = 2;
Scanner scn = new Scanner(System.in);
int n;
int den,mon,cab,total;
byte[] glist;
int[][] exps;
boolean[] provedp;
den = scn.nextInt();
mon = scn.nextInt();
cab = scn.nextInt();
total = den+mon+cab;
n = scn.nextInt();
glist = new byte[total+1];
provedp = new boolean[n];
exps = new int[n][4];
for(int i=0; i<glist.length; i++)
glist[i] = UNKNOWN;
for(int i=0; i<n; i++) for(int j=0; j<4; j++)
exps[i][j] = scn.nextInt();
boolean complete = true;
while(complete){
complete = false;
for(int i=0; i<n; i++)
if(provedp[i]){
continue;
}else if(exps[i][WIN] == PASS){
complete = true;
for(int j=0; j<3; j++)
glist[exps[i][j]] = PASS;
provedp[i] = true;
}else{
int cnt = 0;
for(int j=0; j<3; j++)
if(glist[exps[i][j]] == PASS)
cnt++;
if(cnt == 2){
complete = true;
for(int j=0; j<3; j++)
if(glist[exps[i][j]] == UNKNOWN)
glist[exps[i][j]] = FAIL;
provedp[i] = true;
}else{
for(int j=0; j<3; j++)
if(exps[i][j] == FAIL){
provedp[i] = true;
complete = true;
}
}
}
}
for(int i=1 ; i<=total; i++){
System.out.println(glist[i]);
}
}
} | Main.java:3: error: class q6 is public, should be declared in a file named q6.java
public class q6{
^
1 error
|
s870248755 | p00437 | Java | import java.util.Scanner;
public class main{
public static void main(String[] args){
final int WIN = 3, PASS = 1, FAIL = 0, UNKNOWN = 2;
Scanner scn = new Scanner(System.in);
int n;
int den,mon,cab,total;
byte[] glist;
int[][] exps;
boolean[] provedp;
den = scn.nextInt();
mon = scn.nextInt();
cab = scn.nextInt();
total = den+mon+cab;
n = scn.nextInt();
glist = new byte[total+1];
provedp = new boolean[n];
exps = new int[n][4];
for(int i=0; i<glist.length; i++)
glist[i] = UNKNOWN;
for(int i=0; i<n; i++) for(int j=0; j<4; j++)
exps[i][j] = scn.nextInt();
boolean complete = true;
while(complete){
complete = false;
for(int i=0; i<n; i++)
if(provedp[i]){
continue;
}else if(exps[i][WIN] == PASS){
complete = true;
for(int j=0; j<3; j++)
glist[exps[i][j]] = PASS;
provedp[i] = true;
}else{
int cnt = 0;
for(int j=0; j<3; j++)
if(glist[exps[i][j]] == PASS)
cnt++;
if(cnt == 2){
complete = true;
for(int j=0; j<3; j++)
if(glist[exps[i][j]] == UNKNOWN)
glist[exps[i][j]] = FAIL;
provedp[i] = true;
}else{
for(int j=0; j<3; j++)
if(exps[i][j] == FAIL){
provedp[i] = true;
complete = true;
}
}
}
}
for(int i=1 ; i<=total; i++){
System.out.println(glist[i]);
}
}
} | Main.java:3: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s072855091 | p00437 | Java | import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
while (in.hasNext()) {
int a = in.nextInt();
int b = in.nextInt();
int c = in.nextInt();
if (a == 0 && b == 0 && c == 0) {
break;
}
int m = in.nextInt();
for (int i = 0; i < m; i++) {
new Unit(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
}
for (int i = 1; i <= a + b + c; i++) {
System.out.println(Parts.of(i).state);
}
}
}
}
class Parts {
final int num;
int state = 2;
final Set<Unit> needCheckUnits = new HashSet<Unit>();
Parts(int num) {
this.num = num;
}
static HashMap<Integer, Parts> map = new HashMap<Integer, Parts>();
static Parts of(int num) {
if (map.containsKey(num)) {
return map.get(num);
} else {
Parts result = new Parts(num);
map.put(num, result);
return result;
}
}
@Override
public int hashCode() {
return num;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
Parts other = (Parts) obj;
if (num != other.num)
return false;
return true;
}
void setOK() {
this.state = 1;
for (Iterator<Unit> i = needCheckUnits.iterator(); i.hasNext();) {
Unit unit = i.next();
if (unit.isAllset()) {
i.remove();
}
}
}
}
class Unit {
final Parts a, b, c;
final boolean isOK;
Unit(int i, int j, int k, int r) {
a = Parts.of(i);
b = Parts.of(j);
c = Parts.of(k);
isOK = (r == 1);
isAllset();
}
boolean isAllset() {
if (isOK) {
a.setOK();
b.setOK();
c.setOK();
return true;
} else {
boolean result = a.state == 0 && b.state == 0 && c.state == 0;
result = result || c(a, b, c);
result = result || c(b, c, a);
result = result || c(c, a, b);
return result;
}
}
private boolean c(Parts x, Parts y, Parts z) {
if (x.state == 2) {
if (y.state == 1 && z.state == 1) {
x.state = 0;
return true;
} else {
x.needCheckUnits.add(this);
int size = x.needCheckUnits.size();
}
}
return false;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((a == null) ? 0 : a.hashCode());
result = prime * result + ((b == null) ? 0 : b.hashCode());
result = prime * result + ((c == null) ? 0 : c.hashCode());
result = prime * result + (isOK ? 1231 : 1237);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (!(obj instanceof Unit))
return false;
Unit other = (Unit) obj;
if (a == null) {
if (other.a != null)
return false;
} else if (!a.equals(other.a))
return false;
if (b == null) {
if (other.b != null)
return false;
} else if (!b.equals(other.b))
return false;
if (c == null) {
if (other.c != null)
return false;
} else if (!c.equals(other.c))
return false;
if (isOK != other.isOK)
return false;
return true;
} | Main.java:155: error: reached end of file while parsing
}
^
1 error
|
s736347234 | p00437 | C | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}} | main.c:1:1: warning: data definition has no type or storage class
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:9: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:17: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:25: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:33: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:40: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:42: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:44: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:46: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:48: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:50: error: return type defaults to 'int' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~
main.c: In function 'main':
main.c:1:62: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
main.c:1:62: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~
main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:97: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
main.c:1:97: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~
main.c:1:97: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:1:62: error: void value not ignored as it ought to be
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~
main.c:1:347: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),exit(0);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| |
s095180126 | p00437 | C | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}} | main.c:1:1: warning: data definition has no type or storage class
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:9: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:17: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:25: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:33: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:40: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:42: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:44: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:46: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:48: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^
main.c:1:50: error: return type defaults to 'int' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~
main.c: In function 'main':
main.c:1:62: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
main.c:1:62: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~
main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:97: error: expected expression before 'return'
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~~
main.c:1:348: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c),return 0;){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}}
| ^~~~~~
main.c:1:348: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:348: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:348: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s076660322 | p00437 | C | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);} | main.c:1:1: warning: data definition has no type or storage class
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:9: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:17: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:25: error: type defaults to 'int' in declaration of 'd' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:33: error: type defaults to 'int' in declaration of 'p' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:40: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:42: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:44: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:46: error: type defaults to 'int' in declaration of 'y' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:48: error: type defaults to 'int' in declaration of 'z' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
main.c:1:50: error: return type defaults to 'int' [-Wimplicit-int]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~
main.c: In function 'main':
main.c:1:62: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
main.c:1:62: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~~
main.c:1:62: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:1:339: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~~~
main.c:1:339: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:339: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:1:339: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:1:354: error: lvalue required as increment operand
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~
main.c:1:362: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){ |
s902606923 | p00437 | C | #include<stdio.h>
#include<string.h>
int bitcnt( int bit )
{
int ret = 0 ;
int i ;
for( i = 0 ; i < 3 ; ++i )
{
ret += ( bit >> i ) & 1 ;
}
return ret ;
}
int main()
{
bool BOOL[ 1000 + 1 ] = { false } ;
int ans[ 1000 + 1 ] ;
int i[ 1000 + 1 ] ,I[ 100 + 1 ] = { 0 } ;
int j[ 1000 + 1 ] ,J[ 100 + 1 ] = { 0 } ;
int k[ 1000 + 1 ] ,K[ 100 + 1 ] = { 0 } ;
int n ,m ;
int lp ;
for( lp = m = 0 ; lp < 3 ; ++lp )
{
scanf( "%d" ,&n ) ;
m += n ;
}
scanf( "%d" ,&n ) ;
for( lp = 1 ; lp <= n ; ++lp )
{
int ifs ;
scanf( "%d %d %d %d" ,&i[ lp ] ,&j[ lp ] ,&k[ lp ] ,&ifs ) ;
if( ifs )
{
I[ i[ lp ] ] = 4 ;
J[ j[ lp ] ] = 2 ;
K[ k[ lp ] ] = 1 ;
ans[ i[ lp ] ] = ans[ j[ lp ] ] = ans[ k[ lp ] ] = 1 ;
BOOL[ lp ] = true ;
}
else
{
ans[ I[ i[ lp ] ] ? 0 : i[ lp ] ] = ans[ J[ j[ lp ] ] ? 0 : j[ lp ] ] = ans[ K[ k[ lp ] ] ? 0 : k[ lp ] ] = 2 ;
}
}
bool flg = true ;
while( flg )
{
flg = false ;
for( lp = 1 ; lp <= n ; ++lp )
{
if( BOOL[ lp ] == false && bitcnt( I[ i[ lp ] ] | J[ j[ lp ] ] | K[ k[ lp ] ] ) == 2 )
{
flg = BOOL[ lp ] = true ;
ans[ !( I[ i[ lp ] ] & 7 ) ? i[ lp ] : !( J[ j[ lp ] ] & 7 ) ? j[ lp ] : !( K[ k[ lp ] ] & 7 ) ? k[ lp ] : 0 ] = 0 ;
}
}
}
for( lp = 1 ; lp <= m ; ++lp )
{
printf( "%d\n" ,ans[ lp ] ) ;
}
return 0 ;
} | main.c: In function 'main':
main.c:21:9: error: unknown type name 'bool'
21 | bool BOOL[ 1000 + 1 ] = { false } ;
| ^~~~
main.c:3:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
2 | #include<string.h>
+++ |+#include <stdbool.h>
3 |
main.c:21:35: error: 'false' undeclared (first use in this function)
21 | bool BOOL[ 1000 + 1 ] = { false } ;
| ^~~~~
main.c:21:35: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:21:35: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:38: error: 'true' undeclared (first use in this function)
57 | BOOL[ lp ] = true ;
| ^~~~
main.c:57:38: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:66:9: error: unknown type name 'bool'
66 | bool flg = true ;
| ^~~~
main.c:66:9: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s392149035 | p00437 | C | #include <cstdio>
#include <list>
#define N 100
using namespace std;
/** Crazy Motor-Cycle */
struct cmc
{
int a;
int b;
int c;
};
/** Application main entry point. */
int
main (
int argc,
char * argv[ ]
)
{
int i;
for ( ; ; )
{
list<struct cmc> lis;
int d[ 3 * N ];
int a, b, c;
int n;
scanf ( "%d%d%d", &a, &b, &c );
if ( !( a | b | c ) ) break ;
b += a; c += b;
for ( i = 0; i < c; ++i )
{
d[ i ] = 2;
}
scanf ( "%d", &n );
while ( n-- )
{
struct cmc t;
int s;
scanf ( "%d%d%d%d", &t.a, &t.b, &t.c, &s );
--t.a; --t.b; --t.c;
if ( s )
{
d[ t.a ] =
d[ t.b ] =
d[ t.c ] = 1;
}
else
{
lis.push_back ( t );
}
}
for ( list<struct cmc>::iterator it = lis.begin ( )
; it != lis.end ( ); )
{
if ( ( d[ it->a ] == 2 && d[ it->b ] == 1 && d[ it->c ] == 1 )
|| ( d[ it->a ] == 1 && d[ it->b ] == 2 && d[ it->c ] == 1 )
|| ( d[ it->a ] == 1 && d[ it->b ] == 1 && d[ it->c ] == 2 ) )
{
if ( d[ it->a ] == 2 ) d[ it->a ] = 0;
else if ( d[ it->b ] == 2 ) d[ it->b ] = 0;
else d[ it->c ] = 0;
lis.erase ( it );
it = lis.begin ( );
}
else ++it;
}
for ( i = 0; i < c; ++i )
{
printf ( "%d\n", d[ i ] );
}
}
return ( 0 );
} | main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s842124249 | p00437 | C | #include<stdio.h>
int main(){
while(1){
int parts[350], a, b, c, n, i;
int checks[1000][4];
for(i = 0;i < 350;i++)parts[i] = 2;
scanf("%d%d%d", &a, &b, &c);
if(a == 0 && b == 0 && c == 0) return 0;
scanf("%d", &n);
for(i = 0;i < n;i++){
scanf("%d%d%d%d", &check[i][0], &check[i][1], &check[i][2], &check[i][3]);
if(check[i][3] == 1){
parts[check[i][0]] = 1;
parts[check[i][1]] = 1;
parts[check[i][2]] = 1;
}
}
for(i = 0;i < n;i++){
if(check[i][3] == 0){
if(parts[check[i][0]] * parts[check[i][1]] * parts[check[i][2]] == 2){
if(parts[check[i][0]] == 2)parts[check[i][0]] = 0;
if(parts[check[i][1]] == 2)parts[check[i][1]] = 0;
if(parts[check[i][2]] == 2)parts[check[i][2]] = 0;
}
}
}
for(i = 1; i <= a + b + c;i++){
printf("%d\n", parts[i]);
}
}
} | main.c: In function 'main':
main.c:12:26: error: 'check' undeclared (first use in this function); did you mean 'checks'?
12 | scanf("%d%d%d%d", &check[i][0], &check[i][1], &check[i][2], &check[i][3]);
| ^~~~~
| checks
main.c:12:26: note: each undeclared identifier is reported only once for each function it appears in
|
s428780715 | p00437 | C++ | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);} | a.cc:1:1: error: 'a' does not name a type
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:50: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:77: error: 'a' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:79: error: 'b' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:81: error: 'c' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:62: error: 'scanf' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~
a.cc:1:102: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:110: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:124: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:139: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:178: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:188: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:197: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:204: error: 'j' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:215: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:247: error: 'x' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:261: error: 'y' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:287: error: 'z' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[ |
s807236407 | p00437 | C++ | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);} | a.cc:1:54: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:66: error: 'scanf' was not declared in this scope
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~
a.cc:1:342: error: 'printf' was not declared in this scope
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
a.cc:1:366: error: 'exit' was not declared in this scope
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc:1:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
+++ |+#include <cstdlib>
1 | int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
|
s125307739 | p00437 | C++ | #include<stdio.h>
int a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;
main(){
for(;scanf("%d%d%d",a,b,c)&(*a+=*b+*c);){
for(i=332;i;p[i--]=2);
for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));
for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);
for(i=0;i<*a;printf("%d\n",p[++i]));
}
exit(0);
} | a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:12:3: error: 'exit' was not declared in this scope
12 | exit(0);
| ^~~~
a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>'
1 | #include<stdio.h>
+++ |+#include <cstdlib>
2 |
|
s712271755 | p00437 | C++ | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);} | a.cc:1:1: error: 'a' does not name a type
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:50: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:77: error: 'a' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:79: error: 'b' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:81: error: 'c' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:62: error: 'scanf' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~
a.cc:1:103: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:111: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:125: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:140: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:179: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:189: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:198: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:205: error: 'j' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:216: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:248: error: 'x' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:262: error: 'y' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:288: error: 'z' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y |
s292316022 | p00437 | C++ | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);} | a.cc:1:1: error: 'a' does not name a type
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:50: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:77: error: 'a' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:79: error: 'b' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:81: error: 'c' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:62: error: 'scanf' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^~~~~
a.cc:1:103: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:111: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:125: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:140: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:179: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:189: error: 'i' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:198: error: 'p' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:205: error: 'j' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:216: error: 'd' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:248: error: 'x' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:262: error: 'y' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p+++i));}exit(0);}
| ^
a.cc:1:288: error: 'z' was not declared in this scope
1 | a[1111],b[1111],c[1111],d[1111],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j |
s111696819 | p00437 | C++ | #define A 1111
a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);} | a.cc:2:1: error: 'a' does not name a type
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:36: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:2:63: error: 'a' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:65: error: 'b' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:67: error: 'c' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:48: error: 'scanf' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~
a.cc:2:89: error: 'i' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:97: error: 'p' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:111: error: 'i' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:126: error: 'p' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:165: error: 'd' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:175: error: 'i' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:184: error: 'p' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:191: error: 'j' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:202: error: 'd' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:234: error: 'x' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:248: error: 'y' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:274: error: 'z' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:2:316: error: 'i' was not declared in this scope
2 | a[A],b[A],c[A],d[A],p[A |
s638828327 | p00437 | C++ | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);} | a.cc:1:1: error: 'a' does not name a type
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:46: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~
a.cc: In function 'int main()':
a.cc:1:73: error: 'a' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:75: error: 'b' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:77: error: 'c' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:58: error: 'scanf' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^~~~~
a.cc:1:99: error: 'i' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:107: error: 'p' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:121: error: 'i' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:136: error: 'p' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:175: error: 'd' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:185: error: 'i' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:194: error: 'p' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:201: error: 'j' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:212: error: 'd' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:244: error: 'x' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:258: error: 'y' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| ^
a.cc:1:284: error: 'z' was not declared in this scope
1 | a[999],b[999],c[999],d[999],p[333],i,j,x,y,z;main(){for(;scanf("%d%d%d",a,b,c)&&(*a+=*b+*c);){for(i=332;i;p[i--]=2);for(i=0,scanf("%d",p);i++<*p;scanf("%d%d%d%d",a+i,b+i,c+i,d+i));for(i=0;i++<*p;)for(j=0;j++<*p;d[j]?p[a[j]]=p[b[j]]=p[c[j]]=1:(x=p[a[j]]&1)&(y=p[b[j]]&1)?p[c[j]]=0:x&(z=p[c[j]])?p[b[j]]=0:y&z?p[a[j]]=0:0);for(i=0;i<*a;printf("%d\n",p[++i]));}exit(0);}
| |
s453582885 | p00437 | C++ | def f;gets.split.map &:to_i;end
while(n=f.inject:+)>0
m=[2]*n
t=[]
(1..f[0]).map{i,j,k,r=f;r>0?(m[i]=m[j]=m[k]=1;t.push i,j,k;nil):[i,j,k]}.map{|l|l&&((a=l-t).size>1||m[a[0]]=0)}
puts m
end | a.cc:5:2: error: too many decimal points in number
5 | (1..f[0]).map{i,j,k,r=f;r>0?(m[i]=m[j]=m[k]=1;t.push i,j,k;nil):[i,j,k]}.map{|l|l&&((a=l-t).size>1||m[a[0]]=0)}
| ^~~~
a.cc:1:1: error: 'def' does not name a type
1 | def f;gets.split.map &:to_i;end
| ^~~
a.cc:1:7: error: 'gets' does not name a type
1 | def f;gets.split.map &:to_i;end
| ^~~~
a.cc:1:29: error: 'end' does not name a type
1 | def f;gets.split.map &:to_i;end
| ^~~
a.cc:5:73: error: expected unqualified-id before '.' token
5 | (1..f[0]).map{i,j,k,r=f;r>0?(m[i]=m[j]=m[k]=1;t.push i,j,k;nil):[i,j,k]}.map{|l|l&&((a=l-t).size>1||m[a[0]]=0)}
| ^
a.cc:6:1: error: 'puts' does not name a type
6 | puts m
| ^~~~
|
s845252502 | p00437 | C++ | import java.awt.Point;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.Set;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(true){
final int a = sc.nextInt();
final int b = sc.nextInt();
final int c = sc.nextInt();
final int size = a + b + c;
if(size == 0){
break;
}
final int N = sc.nextInt();
int[] answer = new int[size];
Arrays.fill(answer, 2);
LinkedList<Integer> a_list = new LinkedList<Integer>();
LinkedList<Integer> b_list = new LinkedList<Integer>();
LinkedList<Integer> c_list = new LinkedList<Integer>();
LinkedList<Integer> answers = new LinkedList<Integer>();
for(int i = 0; i < N; i++){
final int a_part = sc.nextInt() - 1;
final int b_part = sc.nextInt() - 1;
final int c_part = sc.nextInt() - 1;
final int ans = sc.nextInt();
if(ans == 1){
a_list.addFirst(a_part);
b_list.addFirst(b_part);
c_list.addFirst(c_part);
answers.addFirst(ans);
}else{
a_list.addLast(a_part);
b_list.addLast(b_part);
c_list.addLast(c_part);
answers.addLast(ans);
}
}
while(!answers.isEmpty()){
final int a_part = a_list.poll();
final int b_part = b_list.poll();
final int c_part = c_list.poll();
final int ans = answers.poll();
if(ans == 1){
answer[a_part] = ans;
answer[b_part] = ans;
answer[c_part] = ans;
}else{
if(answer[a_part] == 1 && answer[b_part] == 1 && answer[c_part] == 2){
answer[c_part] = 0;
}else if(answer[a_part] == 1 && answer[b_part] == 2 && answer[c_part] == 1){
answer[b_part] = 0;
}else if(answer[a_part] == 2 && answer[b_part] == 1 && answer[c_part] == 1){
answer[a_part] = 0;
}
}
}
for(int i = 0; i < size; i++){
System.out.println(answer[i]);
}
}
}
} | a.cc:1:1: error: 'import' does not name a type
1 | import java.awt.Point;
| ^~~~~~
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.util.ArrayList;
| ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: 'import' does not name a type
3 | import java.util.Arrays;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.util.HashSet;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1: error: 'import' does not name a type
5 | import java.util.LinkedList;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: 'import' does not name a type
6 | import java.util.PriorityQueue;
| ^~~~~~
a.cc:6:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:7:1: error: 'import' does not name a type
7 | import java.util.Scanner;
| ^~~~~~
a.cc:7:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:8:1: error: 'import' does not name a type
8 | import java.util.Set;
| ^~~~~~
a.cc:8:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:10:1: error: expected unqualified-id before 'public'
10 | public class Main {
| ^~~~~~
|
s940262828 | p00437 | C++ | #include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int p[500];
int sakurako(int a, int b, int c){
bool f1, f2, f3;
f1 = (p[a] == 1 ? true : false);
f2 = (p[b] == 1 ? true : false);
f3 = (p[c] == 1 ? true : false);
if (f1 && f2 && !f3) return c;
if (f1 && !f2 && f3) return b;
if (!f1 && f2 && f3) return a;
return -1;
}
int main(void)
{
int a, b, c, n;
int ni[1200], nj[1200], nk[1200], nr[1200];
while(cin >> a >> b >> c){
if (a == 0) break;
cin >> n;
fill(p, p + 500, 2);
for (int i = 0; i < n; i++){
scanf("%d %d %d %d", &ni[i], &nj[i], &nk[i], &nr[i]);
if (nr[i] == 1){
p[ni[i]] = 1;
p[nj[i]] = 1;
p[nk[i]] = 1;
}
}
for (int i = 0; i < n; i++){
if (nr[i] == 0){
int re = sakurako(ni[i], nj[i], nk[i]);
if (re == -1) continue;
p[re] = 0;
}
}
for (int i = 1; i <= a + b + c; i++){
printf("%d\n", p[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:54:2: error: expected '}' at end of input
54 | }
| ^
a.cc:22:1: note: to match this '{'
22 | {
| ^
|
s894417887 | p00437 | C++ | #include <cstdio>
#include <algorithm>
using namespace std;
int a, b, c, N, i[1000], j[1000], k[1000], r[1000], h[301];
int main(){
while(scanf("%d%d%d", &a, &b, &c), a+b+c){
scanf("%d", &N);
for(int x = 0; x < N; x++){
scanf("%d%d%d%d", i+x, j+x, k+x, r+x);
}
fill(h, h+a+b+c+1, 2);
for(int x = 0; x < N; x++){
if(r[x] == 1){
h[i[x]] = h[j[x]] = h[k[x]] = 1;
}
}a
for(int x = 0; x < N; x++){
if(r[x]) continue;
printf("%d %d %d\n", i[x], j[x], k[x]);
if(h[i[x]]%2 + h[j[x]]%2 + h[k[x]]%2 == 2){
if(h[i[x]]/2){
h[i[x]] = 0;
}
if(h[j[x]]/2){
h[j[x]] = 0;
}
if(h[k[x]]/2){
h[k[x]] = 0;
}
}
}
for(int x = 1; x <= a+b+c; x++){
printf("%d\n", h[x]);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:18:11: error: expected ';' before 'for'
18 | }a
| ^
| ;
19 | for(int x = 0; x < N; x++){
| ~~~
a.cc:19:24: error: 'x' was not declared in this scope
19 | for(int x = 0; x < N; x++){
| ^
|
s827620705 | p00437 | C++ | #include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
int main(){
int a,b,c,st[4],n,ch[1000][4],good[301]={0},sum,ans;
while(1){
scanf("%d%d%d%d",&a,&b,&c);
if(a+b+c=0)break;
scanf("%d",&n);
st[0]=1;
st[1]=a;
st[2]=a+b;
st[3]=a+b+c;
for(int i=0;i<n;i++){
for(int j=0;j<4;j++){
scanf("%d",&ch[i][j]);
}
}
for(int i=0;i<n;i++){
if(ch[i][3]==1){
for(int j=0;j<3;j++){
good[ch[i][j]]=1;
}
}
}
for(int i=0;i<n;i++){
sum=0;
for(int j=0;j<3;j++)
sum+=good[ch[i][j]];
if(sum==2){
for(int j=0;j<3;j++)
if(good[ch[i][j]]!=1){
good[ch[i][j]]=-1;
}
}
}
for(int i=1;i<=a+b+c;i++){
if(good[i]==-1)
ans=0;
else if(good[i]==1)
ans=1;
else
ans=2;
printf("%d\n",ans);
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:20:15: error: lvalue required as left operand of assignment
20 | if(a+b+c=0)break;
| ~~~^~
|
s330559179 | p00437 | C++ | #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define INF 1000000001
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
int main(){
int a,b,c,n;
while(cin>>a>>b>>c&&a&&b&&c){
cin>>n;
int x[1000],y[1000],z[1000],r[1000];
int f[a+b+c];
REP(i,a+b+c)f[i]=2;
int k=0;
REP(i,n){
cin>>x[k]>>y[k]>>z[k]>>r[k];x[k]--;y[k]--;z[k]--;
if(r[k]==1){
f[x[k]]=f[y[k]]=f[z[k]]=1;
}else k++;
}
bool update=true;
while(update){
update=false;
REP(i,k){
if(f[x[i]]==1&&f[y[i]]==1&&f[z[i]]==2){f[z[i]]=0;update=true;}
else if(f[x[i]]==1&&f[y[i]]==2&&f[z[i]]==1){f[y[i]]=0;update=true;}
else if(f[x[i]]==2&&f[y[i]]==1&&f[z[i]]==1){f[x[i]]=0;update=true;}
}
}
REP(i,a+b+c)cout<<f[i]<<endl;
} | a.cc: In function 'int main()':
a.cc:37:8: error: expected '}' at end of input
37 | }
| ^
a.cc:13:11: note: to match this '{'
13 | int main(){
| ^
|
s831552231 | p00437 | C++ | #include <iostream>
using namespace std;
int seihin[300];int test[1000][4];
int a,b,c,n;
bool henka
void check(){
for(int i=0;i<n;i++){
int p=0;int k;
if(test[i][3] == 0){
for(int j =0;j<=2;j++){
if(seihin[test[i][j]-1]!=1){
k=test[i][j]-1;
p++;}
}
if(p==1 and seihin[k]==2){
henka=true;
seihin[k]=0;
}
}
}
}
int main() {
while(1){
henka=true;
for(int i = 0;i<300;i++){
seihin[i]=2;
}
cin>>a>>b>>c;
if(a==0 and b==0 and c==0){break;}
cin>>n;
int y=a+b+c;
for(int i=0;i<n;i++){
cin>>test[i][0]>>test[i][1]>>test[i][2]>>test[i][3];
}
for(int i = 0;i<n;i++){
if(test[i][3]==1){
for(int j=0;j<=2;j++){
seihin[test[i][j]-1]=1;
}
}
}
while(henka==true){
henka=false;
check();
}
for(int i=0;i<y;i++){
cout<<seihin[i]<<endl;
}
}
return 0;
} | a.cc:7:1: error: expected initializer before 'void'
7 | void check(){
| ^~~~
a.cc: In function 'int main()':
a.cc:26:9: error: 'henka' was not declared in this scope
26 | henka=true;
| ^~~~~
a.cc:47:9: error: 'check' was not declared in this scope
47 | check();
| ^~~~~
|
s564905977 | p00437 | C++ | #include<iostream>
using namespace std;
int main(){
int a,b,c,k,x[1000][4],p[500];
while(true){
for(int i=0;i<500;i++){p[i]=2;}
cin>>a>>b>>c;
if(a==0 && b==0 && c==0){break;}
cin>>k;
for(int i=0;i<k;i++){
cin>>x[i][0]>>x[i][1]>>x[i][2]>>x[i][3];
if(x[i][3]==1){p[x[i][0]]=1;p[x[i][1]]=1;p[x[i][2]]=1;}
}
for(int i=0;i<k;i++){
if(p[x[i][0]]==1 && p[x[i][1]]==1&& x[i][3]==0){p[x[i][2]]=0;}
if(p[x[i][0]]==1 && p[x[i][2]]==1&& x[i][3]==0){p[x[i][1]]=0;}
if(p[x[i][1]]==1 && p[x[i][2]]==1&& x[i][3]==0){p[x[i][0]]=0;}
}
for(int i=1;i<=a+b+c;i++){cout<<p[i]<<endl;}
return 0;
} | a.cc: In function 'int main()':
a.cc:21:2: error: expected '}' at end of input
21 | }
| ^
a.cc:3:11: note: to match this '{'
3 | int main(){
| ^
|
s722098993 | p00437 | C++ | #include<iostream>
main(){
int a,b,c,k,x[1000][4],p[500];
while(true){
for(int i=0;i<500;i++){p[i]=2;}
std::cin>>a>>b>>c;
if(a==0){break;}
cin>>k;
for(int i=0;i<k;i++){cin>>x[i][0]>>x[i][1]>>x[i][2]>>x[i][3];
if(x[i][3]==1){p[x[i][0]]=1;p[x[i][1]]=1;p[x[i][2]]=1;}
}
for(int i=0;i<k;i++){
if(p[x[i][0]]==1&&p[x[i][1]]==1&&x[i][3]==0)
p[x[i][2]]=0;
if(p[x[i][0]]==1&&p[x[i][2]]==1&&x[i][3]==0)
p[x[i][1]]=0;
if(p[x[i][1]]==1&&p[x[i][2]]==1&&x[i][3]==0)
p[x[i][0]]=0;
}
for(int i=1;i<=a+b+c;i++){std::cout<<p[i]<<"\n";}
}
} | a.cc:2:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
2 | main(){
| ^~~~
a.cc: In function 'int main()':
a.cc:8:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
8 | cin>>k;
| ^~~
| std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
|
s843975095 | p00437 | C++ | #include <iostream>
using namespace std;
int main(){
while(1){
int a, b, c, n, list[1001][4], parts[301], judge, defect;
cin >> a >> b >> c >> n;
if(a == 0 && b == 0 && c == 0){
break;
}
for(int i = 1; i <= a + b + c; i++){
parts[i] = 2;
}
for(int i = 0; i < n; i++){
for(int j = 0; j < 4; j++){
cin >> list[i][j];
}
if(list[i][3] == 1){
for(int k = 0; k < 3; k++){
parts[list[i][k]] = 1;
}
}
}
for(int i = 0; i < n; i++){
if(!list[i][3]){
judge = 0;
for(int j = 0; j < 3; j++){
if(parts[list[i][j]] == 2){
defect = list[i][j];
} else{
judge += parts[list[i][j]];
}
if(judege == 2){
parts[defect] = 0;
}
}
}
}
for(int i = 1; i <= a + b + c; i++){
cout << parts[i] << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:36:24: error: 'judege' was not declared in this scope; did you mean 'judge'?
36 | if(judege == 2){
| ^~~~~~
| judge
|
s407544612 | p00437 | C++ | s | a.cc:1:1: error: 's' does not name a type
1 | s
| ^
|
s063691286 | p00437 | C++ | #include<bits/stdc++.h>
using namespace std;
int alist[10000],blist[10000],clist[10000],abc[10000],ans[10000];
int A,B,C,n,d,f,g,r;
int main(){
while(1){
alist[10000]={0};
blist[10000]={0};
clist[10000]={0};
abc[10000]={0};
ans[10000]={2};
cin >> A >> B >> C;
if(A==0&&B==0&&C==0)break;
cin >> n;
for(int i=0;i<n;i++){
cin >> d >> f >> g >> r;
alist[i]=d;
blist[i]=f;
clist[i]=g;A
ans[i]=r;
if(r==1){
abc[d]=1;
abc[f]=1;
abc[g]=1;
}else{
if(abc[d]==0)abc[d]=2;
if(abc[f]==0)abc[f]=2;
if(abc[g]==0)abc[g]=2;
}
}
for(int i=0;i<n;i++){
if(ans[i]==0){
if(abc[alist[i]]==1&&abc[blist[i]]==1&&abc[clist[i]]!=1)abc[clist[i]]=0;
else if(abc[blist[i]]==1&&abc[clist[i]]==1&&abc[alist[i]]!=1)abc[alist[i]]=0;
else if(abc[clist[i]]==1&&abc[alist[i]]==1&&abc[blist[i]]!=1)abc[blist[i]]=0;
}
}
for(int i=1;i<A+B+C+1;i++){
cout << abc[i] << endl;
}
}
return 0;
} | a.cc: In function 'int main()':
a.cc:23:17: error: expected ';' before 'ans'
23 | clist[i]=g;A
| ^
| ;
24 | ans[i]=r;
| ~~~
|
s805573419 | p00437 | C++ |
using namespace std;
int main(){
int a,b,c,n,i,j,k,r,d[1000][4];
int f[301]={0};
int g[301]={0};
cin>>a>>b>>c;
cin>>n;
for(int p=0;p<n;++p){
cin>>i>>j>>k>>r;
d[p][0]=i;d[p][1]=j;d[p][2]=k;d[p][3]=r;
if(r) g[i]=g[j]=g[k]=1;
}
for(int q=0;q<2;++q){
for(int p=0;p<n;++p){
if(!d[p][3]){
if(g[d[p][0]]&&g[d[p][1]]) f[d[p][2]]=1;
else if(g[d[p][0]]&&g[d[p][2]]) f[d[p][1]]=1;
else if(g[d[p][2]]&&g[d[p][1]]) f[d[p][0]]=1;
}
}
for(int p=0;p<n;++p){
if(!d[p][3]){
if(f[d[p][0]]&&f[d[p][1]]) g[d[p][2]]=1;
else if(f[d[p][0]]&&f[d[p][2]]) g[d[p][1]]=1;
else if(f[d[p][2]]&&f[d[p][1]]) g[d[p][0]]=1;
}
}
}
for(int p=1;p<=a+b+c;++p){
if(g[p]) cout<<1;
else if(f[p]) cout<<0;
else cout<<2;
cout<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
8 | cin>>a>>b>>c;
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 |
a.cc:32:14: error: 'cout' was not declared in this scope
32 | if(g[p]) cout<<1;
| ^~~~
a.cc:32:14: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:33:19: error: 'cout' was not declared in this scope
33 | else if(f[p]) cout<<0;
| ^~~~
a.cc:33:19: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:34:10: error: 'cout' was not declared in this scope
34 | else cout<<2;
| ^~~~
a.cc:34:10: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:5: error: 'cout' was not declared in this scope
35 | cout<<endl;
| ^~~~
a.cc:35:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:35:11: error: 'endl' was not declared in this scope
35 | cout<<endl;
| ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 |
|
s811266207 | p00437 | C++ | #include<iostream>
#include<algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int ans[300];
int q[1000][3],qtop;
int main(){
int n,s,a,b,z,c[3];
while(true){
cin>>s>>a>>b;
s+=a+b;
if(!s)break;
cin>>n;
rep(i,s)ans[i]=2;
qtop=0;
rep(i,n){
rep(j,3){cin>>c[j];c[j]--;}
cin>>z;
if(z)rep(j,3)ans[c[j]]=1;
else{
rep(j,3)q[qtop][j]=c[j];
vis[qtop]=false;
qtop++;
}
}
rep(i,qtop){
bool f[3]={false};
rep(j,3)if(ans[q[i][j]]==1)f[j]=true;
if(f[0]+f[1]+f[2]==2)rep(j,3)if(!f[j])ans[q[i][j]]=0;
}
rep(i,s)cout<<ans[i]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:22:25: error: 'vis' was not declared in this scope
22 | vis[qtop]=false;
| ^~~
|
s473466646 | p00437 | C++ | using namespace std;
/* {{{ */
#define CL(N) cout << N << endl
#define DCT(N) cout << "debug " << N << endl
#define REP(i, N) for (int i = 0; i < N; i++)
/* }}} */
int main()
{
int a, b, c;
while (cin >> a >> b >> c, a || b || c){
int n, m[1000][4], q[300];
fill(q, q + 300, 2);
cin >> n;
REP(i, n){
cin >> m[i][0] >> m[i][1] >> m[i][2] >> m[i][3];
m[i][0]--;
m[i][1]--;
m[i][2]--;
if (m[i][3] == 1){
q[m[i][0]] = q[m[i][1]] = q[m[i][2]] = 1;
}
}
REP(i, n){
if (m[i][3] == 0){
int onec = 0;
REP(j, 3){
if (q[m[i][j]] == 1) onec++;
}
}
if (onec == 2){
REP(j, 3){
if (q[m[i][j]] == 2){
q[m[i][j]] = 0;
}
}
}
}
}
REP(i, a + b + c){
CL(q[i]);
}
return (0);
} | a.cc: In function 'int main()':
a.cc:13:12: error: 'cin' was not declared in this scope
13 | while (cin >> a >> b >> c, a || b || c){
| ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
+++ |+#include <iostream>
1 | using namespace std;
a.cc:17:9: error: 'fill' was not declared in this scope
17 | fill(q, q + 300, 2);
| ^~~~
a.cc:38:18: error: 'onec' was not declared in this scope
38 | if (onec == 2){
| ^~~~
a.cc:4:15: error: 'cout' was not declared in this scope
4 | #define CL(N) cout << N << endl
| ^~~~
a.cc:50:9: note: in expansion of macro 'CL'
50 | CL(q[i]);
| ^~
a.cc:4:15: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
4 | #define CL(N) cout << N << endl
| ^~~~
a.cc:50:9: note: in expansion of macro 'CL'
50 | CL(q[i]);
| ^~
a.cc:50:12: error: 'q' was not declared in this scope
50 | CL(q[i]);
| ^
a.cc:4:23: note: in definition of macro 'CL'
4 | #define CL(N) cout << N << endl
| ^
a.cc:4:28: error: 'endl' was not declared in this scope
4 | #define CL(N) cout << N << endl
| ^~~~
a.cc:50:9: note: in expansion of macro 'CL'
50 | CL(q[i]);
| ^~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
+++ |+#include <ostream>
1 | using namespace std;
|
s229085707 | p00437 | C++ | #include <bits/stdc++.h>
using namespace std;
#define loop(i,n) for(int i=1;i<=n;i++)
struct test {
int i, j, k;
};
vector<test> t;
int p[302];
int main(){
int a, b, c, n, i, j, k, r;
while (cin >> a >> b >> c){
cin >> n;
t.clear();
loop(i, a + b + c)p[i] = 2;
loop(h, n){
cin >> i >> j >> k >> r;
if (r == 1){
p[h] = p[h] = p[h] = 1;
}
else{
t.push_back({ i, j, k });
}
}
for (int h = 0; h < t.size(); h++){
i = t[h].i; j= t[h].j; k = t[h].k;
if (p[i] == 1 && p[j] == 1){
p[k] = 0;
}
else if (p[j] == 1 && p[k] == 1){
p[i] = 0;
}
else if (p[k] == 1 && p[i] == 1){
p[j] = 0;
}
}
loop(i, a + b + c)cout << t[i] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:39:40: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'})
39 | loop(i, a + b + c)cout << t[i] << endl;
In file included from /usr/include/c++/14/istream:41,
from /usr/include/c++/14/sstream:40,
from /usr/include/c++/14/complex:45,
from /usr/include/c++/14/ccomplex:39,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
from a.cc:1:
/usr/include/c++/14/ostream:116:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ostream_type& (*)(__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:116:36: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&)' {aka 'std::basic_ostream<char>& (*)(std::basic_ostream<char>&)'}
116 | operator<<(__ostream_type& (*__pf)(__ostream_type&))
| ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:125:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(__ios_type& (*)(__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; __ios_type = std::basic_ios<char>]'
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ^~~~~~~~
/usr/include/c++/14/ostream:125:32: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&)' {aka 'std::basic_ios<char>& (*)(std::basic_ios<char>&)'}
125 | operator<<(__ios_type& (*__pf)(__ios_type&))
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:135:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ^~~~~~~~
/usr/include/c++/14/ostream:135:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'std::ios_base& (*)(std::ios_base&)'
135 | operator<<(ios_base& (*__pf) (ios_base&))
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ostream:174:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
174 | operator<<(long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:174:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'long int'
174 | operator<<(long __n)
| ~~~~~^~~
/usr/include/c++/14/ostream:178:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
178 | operator<<(unsigned long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:178:32: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'long unsigned int'
178 | operator<<(unsigned long __n)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:182:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
182 | operator<<(bool __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:182:23: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'bool'
182 | operator<<(bool __n)
| ~~~~~^~~
In file included from /usr/include/c++/14/ostream:1022:
/usr/include/c++/14/bits/ostream.tcc:96:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]'
96 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:97:22: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'short int'
97 | operator<<(short __n)
| ~~~~~~^~~
/usr/include/c++/14/ostream:189:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
189 | operator<<(unsigned short __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:189:33: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'short unsigned int'
189 | operator<<(unsigned short __n)
| ~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/ostream.tcc:110:5: note: candidate: 'std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]'
110 | basic_ostream<_CharT, _Traits>::
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/ostream.tcc:111:20: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'int'
111 | operator<<(int __n)
| ~~~~^~~
/usr/include/c++/14/ostream:200:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
200 | operator<<(unsigned int __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:200:31: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'unsigned int'
200 | operator<<(unsigned int __n)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:211:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
211 | operator<<(long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:211:28: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'long long int'
211 | operator<<(long long __n)
| ~~~~~~~~~~^~~
/usr/include/c++/14/ostream:215:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
215 | operator<<(unsigned long long __n)
| ^~~~~~~~
/usr/include/c++/14/ostream:215:37: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'long long unsigned int'
215 | operator<<(unsigned long long __n)
| ~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:231:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
231 | operator<<(double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:231:25: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'double'
231 | operator<<(double __f)
| ~~~~~~~^~~
/usr/include/c++/14/ostream:235:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
235 | operator<<(float __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:235:24: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'float'
235 | operator<<(float __f)
| ~~~~~~^~~
/usr/include/c++/14/ostream:243:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
243 | operator<<(long double __f)
| ^~~~~~~~
/usr/include/c++/14/ostream:243:30: note: no known conversion for argument 1 from '__gnu_cxx::__alloc_traits<std::allocator<test>, test>::value_type' {aka 'test'} to 'long double'
243 | operator<<(long double __f)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:301:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Tr |
s391954601 | p00437 | C++ | #include<iostream>
using namespace std;
int main(){
int data[300]=2;
int a,b,c;
cin >> a>> b>>c;
for(int i=0;i<a+b+c;i++){
data[i]=2;
}
int n;
cin >> n;
int x,y,z,re;
int save[n][4];
int nows=0;
for(int i=0;i<n;i++){
cin >>x>>y>>z>>re;
if(re==1){
data[x]=1;
data[y]=1;
data[z]=1;
}
else(re==0){
save[nows][0]=x;
save[nows][1]=y;
save[nows][2]=z;
nows++;
}
}
for(int i=0;i<nows;i++){
if(save[i][0]==1 && save[i][1]==1){
data[save[i][2]]=0;
}else if(save[i][1]==1 && save[i][2]==1){
data[save[i][0]]=0;
}else if(save[i][2]==1 && save[i][0]==1){
data[save[i][1]]=0;
}
}
for(int i=0;i<a+b+c;i++){
cout<<data[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:17: error: array must be initialized with a brace-enclosed initializer
6 | int data[300]=2;
| ^
a.cc:24:16: error: expected ';' before '{' token
24 | else(re==0){
| ^
| ;
|
s511789210 | p00437 | C++ | #include<iostream>
using namespace std;
int main(){
int data[300]=2;
int a,b,c;
cin >> a>> b>>c;
for(int i=0;i<a+b+c;i++){
data[i]=2;
}
int n;
cin >> n;
int x,y,z,re;
int save[n][4];
int nows=0;
for(int i=0;i<n;i++){
cin >>x>>y>>z>>re;
if(re==1){
data[x]=1;
data[y]=1;
data[z]=1;
}else{
save[nows][0]=x;
save[nows][1]=y;
save[nows][2]=z;
nows++;
}
}
for(int i=0;i<nows;i++){
if(save[i][0]==1 && save[i][1]==1){
data[save[i][2]]=0;
}else if(save[i][1]==1 && save[i][2]==1){
data[save[i][0]]=0;
}else if(save[i][2]==1 && save[i][0]==1){
data[save[i][1]]=0;
}
}
for(int i=0;i<a+b+c;i++){
cout<<data[i]<<endl;
}
} | a.cc: In function 'int main()':
a.cc:6:17: error: array must be initialized with a brace-enclosed initializer
6 | int data[300]=2;
| ^
|
s673018664 | p00437 | C++ | #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;
//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;
signed main() {
int a, b, c;
while (cin >> a >> b >> c, a || b || c) {
int n; cin >> n;
vector<int>i, j, k, ans(a + b + c + 1, 2);
rep(x, 0, n) {
int e, f, g, h;
cin >> e >> f >> g >> h;
if (h) {
ans[e] = ans[f] = ans[g] = 1;
}
else {
i.push_back(e);
j.push_back(f);
k.push_back(g);
}
}
int m = i.size();
for (int x = 0; x < m; x++) {
int p(i[x]), q(j[x]), r(k[x]);
if (ans[p] == 1 && ans[q] == 1 && ans[r] == 2) {
ans[r] = 0;
f = true;
}
else if (ans[p] == 1 && ans[q] == 2 && ans[r] == 1) {
ans[q] = 0;
f = true;
}
else if (ans[p] == 2 && ans[q] == 1 && ans[r] == 1) {
ans[r] = 0;
f = true;
}
}
rep(x, 1, ans.size())cout << ans[x] << endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:40:33: error: 'f' was not declared in this scope
40 | f = true;
| ^
a.cc:44:33: error: 'f' was not declared in this scope
44 | f = true;
| ^
a.cc:48:33: error: 'f' was not declared in this scope
48 | f = true;
| ^
|
s185101814 | p00437 | C++ | #include<iostream>
using namespace std;
struct ST {
int a;
int b;
int c;
int an;
};
int reset(int, int */*[100 + 10]*/);
int main()
{
int ans[1000 + 10];
ST res[1000 + 10];
int an, bn, cn, n;
int ml;
int ln;
int i, j;
int af, bf, cf;
while (1)
{
cin >> an >> bn >> cn
if (an == 0 && bn == 0 && cn == 0)
{
return 0;
}
cin >> n;
ln = n;
ml = an + bn + cn;
reset(ml, ans);
for (i = 1; i <= ln; i++)
{
cin >> res[i].a >> res[i].b >> res[i].c >> res[i].an;
if (res[i].an == 1)
{
ans[res[i].a] = 1;
ans[res[i].b] = 1;
ans[res[i].c] = 1;
i--;
ln--;
}
}
for (i = 1; i <= ln; i++)
{
af = bf = cf = 0;
if (ans[res[i].a] == 1) af = 1;
if (ans[res[i].b] == 1) bf = 1;
if (ans[res[i].c] == 1) cf = 1;
if (af + bf + cf == 2)
{
if (af == 0)
{
ans[res[i].a] = 0;
}
if (bf == 0)
{
ans[res[i].b] = 0;
}
if (cf == 0)
{
ans[res[i].c] = 0;
}
}
}
for (i = 1; i <= ml; i++)
{
cout << ans[i] << endl;
}
}
return 0;
}
int reset(int n, int *le)
{
int i;
for (i = 0; i < n; i++)
{
le[i] = 2;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:32:38: error: expected ';' before 'if'
32 | cin >> an >> bn >> cn
| ^
| ;
33 | if (an == 0 && bn == 0 && cn == 0)
| ~~
|
s355910423 | p00437 | C++ | #include <iostream>
using namespace std;
int main(){
while(1){
int a,b,c;
cin >> a >> b >> c;
if(a==0 && b==0 && c==0) break;
int A[a+1],B[b+1],C[c+1];
int n;
cin >> n;
char NUM[5];
for(int w=0; w<n; w++){
int i,j,k,r;
cin >> i >> j >> k >> r;
if(r==1){
A[i] = 1;
B[j] = 1;
C[k] = 1;
}else{
NUM[0]=i;
NUM[1]=j;
NUM[2]=k;
NUM[3]=r;
A[i] = 3;
B[j] = 3;
C[k] = 3;
}
}
for(int i=1; i<=a+b+c; i++){
if(i<=a) cout << A[i] << endl;
if(i>a&&i<=a+b) cout << B[i] << endl;
if(i>a+b&&i<=a+b+c) cout << C[i] << endl;
}
int res=0;
while(1){
res++;
if(res==3) break;
for(int i=1; i<=a; i++){
for(int j=1; j<=b; j++){
for(int k=1; k<=c; k++){
if(NUM[i][j][k]==0){
cout << "NUM[" << i << "][" << j << "] = " << NUM[i][j][k] << endl;
if(A[i]==1&&B[j]==1){
cout << "C[" << k << "] = " << 0 << endl;
C[k] = 0;
}else if(A[i]==1&&C[k]==1){
cout << "B[" << j << "] = " << 0 << endl;
B[j] = 0;
}else if(B[j]==1&&C[k]==1){
cout << "B[" << j << "] = " << 0 << endl;
A[i] = 0;
}else{
if(A[i]!=1) A[i]=2; cout << "A[" << i << "]=" << A[i] << endl;
if(B[j]!=1) B[j]=2; cout << "B[" << i << "]=" << B[j] << endl;
if(C[k]!=1) C[k]=2; cout << "C[" << i << "]=" << C[k] << endl;
}
}
}
}
}
}
out:
for(int i=1; i<=a+b+c; i++){
if(i<=a) cout << A[i] << endl;
if(i>a&&i<=a+b) cout << B[i] << endl;
if(i>a+b&&i<=a+b+c) cout << C[i] << endl;
}
}
} | a.cc: In function 'int main()':
a.cc:42:11: error: invalid types 'char[int]' for array subscript
42 | if(NUM[i][j][k]==0){
| ^
a.cc:43:54: error: invalid types 'char[int]' for array subscript
43 | cout << "NUM[" << i << "][" << j << "] = " << NUM[i][j][k] << endl;
| ^
|
s914542092 | p00437 | C++ | #include <cstdio>
using namespace std;
int main(void){
printf("2\n1\n1\n0\n1\n0\n")
} | a.cc: In function 'int main()':
a.cc:4:33: error: expected ';' before '}' token
4 | printf("2\n1\n1\n0\n1\n0\n")
| ^
| ;
5 | }
| ~
|
s268454801 | p00437 | C++ | #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
while(1){
int a,b,c,q,w,e[300],l[1000][4];
cin>>a>>b>>c;
if(a==0&&b==0&&c==0)break;
cin>>n;
for(q=0;q<a+b+c;q++)e[q]=2;
for(q=0;q<n;q++){
cin>>l[q][0]>>l[q][1]>>l[q][2]>>l[q][3];
if(l[q][3]==1){
e[l[q][0]]=1;e[l[q][1]]=1;e[l[q][2]]=1;
}
}
for(q=0;q<n;q++){
for(w=0;w<n;w++){
if(l[w][3]==0&&e[l[w][0]]=1&&e[l[w][1]]==1)e[l[w][2]]=0;
if(l[w][3]==0&&e[l[w][2]]=1&&e[l[w][1]]==1)e[l[w][0]]=0;
if(l[w][3]==0&&e[l[w][0]]=1&&e[l[w][2]]==1)e[l[w][1]]=0;
}
}
for(q=0;q<a+b+c;q++)cout<<e[q]<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:6: error: 'n' was not declared in this scope
10 | cin>>n;
| ^
a.cc:20:14: error: lvalue required as left operand of assignment
20 | if(l[w][3]==0&&e[l[w][0]]=1&&e[l[w][1]]==1)e[l[w][2]]=0;
| ~~~~~~~~~~^~~~~~~~~~~~
a.cc:21:14: error: lvalue required as left operand of assignment
21 | if(l[w][3]==0&&e[l[w][2]]=1&&e[l[w][1]]==1)e[l[w][0]]=0;
| ~~~~~~~~~~^~~~~~~~~~~~
a.cc:22:14: error: lvalue required as left operand of assignment
22 | if(l[w][3]==0&&e[l[w][0]]=1&&e[l[w][2]]==1)e[l[w][1]]=0;
| ~~~~~~~~~~^~~~~~~~~~~~
|
s843785790 | p00437 | C++ | #include<iostream>
#include<algorithm>
#include<stdio.h>
using namespace std;
int main(){
while(1){
int a,b,c,q,w,e[300],l[1000][4];
cin>>a>>b>>c;
if(a==0&&b==0&&c==0)break;
cin>>n;
for(q=0;q<a+b+c;q++)e[q]=2;
for(q=0;q<n;q++){
cin>>l[q][0]>>l[q][1]>>l[q][2]>>l[q][3];
if(l[q][3]==1){
e[l[q][0]]=1;e[l[q][1]]=1;e[l[q][2]]=1;
}
}
for(q=0;q<n;q++){
for(w=0;w<n;w++){
if(l[w][3]==0&&e[l[w][0]]==1&&e[l[w][1]]==1)e[l[w][2]]=0;
if(l[w][3]==0&&e[l[w][2]]==1&&e[l[w][1]]==1)e[l[w][0]]=0;
if(l[w][3]==0&&e[l[w][0]]==1&&e[l[w][2]]==1)e[l[w][1]]=0;
}
}
for(q=0;q<a+b+c;q++)cout<<e[q]<<endl;
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:10:6: error: 'n' was not declared in this scope
10 | cin>>n;
| ^
|
s658970540 | p00437 | C++ | #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define loop(a,t) for(int a=0;a<t;a++)
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
int ans[100];
int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
while (true) {
int a, b, c, n;
cin >> a >> b >> c;
if (a + b + c == 0) { break; }
cin >> n;
int ak[100], bk[100], ck[100];
loop(i, 100) {
ak[i] = bk[i] = ck[i] = -1;
ans[i] = 2;
}
loop(i, n) {
int an, bn, cn, or ;
cin >> an >> bn >> cn >> or;
if (or==1) {
ans[an - 1] = 1;
ans[bn - 1] = 1;
ans[cn - 1] = 1;
}
else {
ak[i] = an - 1;
bk[i] = bn - 1;
ck[i] = cn - 1;
}
}
loop(j,n) {
loop(i, 100) {
if (ak[i] != -1) {
if (ans[ak[i]] == 2&& ans[bk[i]] == 1 && ans[ck[i]] == 1) {
ans[ak[i]] = 0;
}
if (ans[ak[i]] == 1 && ans[bk[i]] == 2 && ans[ck[i]] == 1) {
ans[bk[i]] = 0;
}
if (ans[ak[i]] == 1 && ans[bk[i]] == 1 && ans[ck[i]] == 2) {
ans[ck[i]] = 0;
}
}
}
}
loop(i, a + b + c) {
cout << ans[i] << endl;
}
}
return 0;
}
| a.cc: In function 'int main()':
a.cc:47:41: error: expected unqualified-id before 'or' token
47 | int an, bn, cn, or ;
| ^~
a.cc:48:50: error: expected primary-expression before 'or' token
48 | cin >> an >> bn >> cn >> or;
| ^~
a.cc:48:52: error: expected primary-expression before ';' token
48 | cin >> an >> bn >> cn >> or;
| ^
a.cc:49:29: error: expected primary-expression before 'or' token
49 | if (or==1) {
| ^~
a.cc:49:31: error: expected primary-expression before '==' token
49 | if (or==1) {
| ^~
|
s688083306 | p00437 | C++ | #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;
int main()
{
int a, b, c, n;
cin >> a >> b >> c >> n;
vector<vector<int> > check(n, 4);
for(int i=0; i<n; ++i){
for(int j=0; j<4; ++j)
cin >> check[i][j];
}
vector<int> quality(a+b+c+1, 2);
for(int i=0; i<n; ++i){
if(check[i][3] == 1){
quality[check[i][0]] = 1;
quality[check[i][1]] = 1;
quality[check[i][2]] = 1;
}
}
for(int i=0; i<n; ++i){
if(check[i][3] == 0){
if(quality[check[i][0]] == 1 && quality[check[i][1]] == 1)
quality[check[i][2]] = 0;
if(quality[check[i][1]] == 1 && quality[check[i][2]] == 1)
quality[check[i][0]] = 0;
if(quality[check[i][2]] == 1 && quality[check[i][0]] == 1)
quality[check[i][1]] = 0;
}
}
for(int i=1; i<=a+b+c; ++i)
cout << quality[i] << endl;
} | a.cc: In function 'int main()':
a.cc:24:36: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int&, int)'
24 | vector<vector<int> > check(n, 4);
| ^
In file included from /usr/include/c++/14/vector:66,
from a.cc:7:
/usr/include/c++/14/bits/stl_vector.h:707:9: note: candidate: 'template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
707 | vector(_InputIterator __first, _InputIterator __last,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:707:9: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/14/bits/stl_iterator_base_funcs.h:66,
from /usr/include/c++/14/string:47,
from /usr/include/c++/14/bits/locale_classes.h:40,
from /usr/include/c++/14/bits/ios_base.h:41,
from /usr/include/c++/14/ios:44,
from /usr/include/c++/14/ostream:40,
from /usr/include/c++/14/iostream:41,
from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_types.h: In substitution of 'template<class _InIter> using std::_RequireInputIter = std::__enable_if_t<((bool)std::is_convertible<typename std::iterator_traits< <template-parameter-1-1> >::iterator_category, std::input_iterator_tag>::value)> [with _InIter = int]':
/usr/include/c++/14/bits/stl_vector.h:705:9: required from here
705 | typename = std::_RequireInputIter<_InputIterator>>
| ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:252:57: error: no type named 'iterator_category' in 'struct std::iterator_traits<int>'
252 | input_iterator_tag>::value>;
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:678:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; allocator_type = std::allocator<std::vector<int> >]'
678 | vector(initializer_list<value_type> __l,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:678:43: note: no known conversion for argument 1 from 'int' to 'std::initializer_list<std::vector<int> >'
678 | vector(initializer_list<value_type> __l,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:659:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<int> >]'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:659:23: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >&&'
659 | vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
| ~~~~~~~~~^~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; allocator_type = std::allocator<std::vector<int> >; std::false_type = std::false_type]'
640 | vector(vector&& __rv, const allocator_type& __m, false_type)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:640:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; allocator_type = std::allocator<std::vector<int> >; std::true_type = std::true_type]'
635 | vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:635:7: note: candidate expects 3 arguments, 2 provided
/usr/include/c++/14/bits/stl_vector.h:624:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; std::__type_identity_t<_Alloc> = std::allocator<std::vector<int> >]'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:624:28: note: no known conversion for argument 1 from 'int' to 'const std::vector<std::vector<int> >&'
624 | vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
| ~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
620 | vector(vector&&) noexcept = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:620:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
601 | vector(const vector& __x)
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:601:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:569:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; size_type = long unsigned int; value_type = std::vector<int>; allocator_type = std::allocator<std::vector<int> >]'
569 | vector(size_type __n, const value_type& __value,
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:569:47: note: no known conversion for argument 2 from 'int' to 'const std::vector<std::vector<int> >::value_type&' {aka 'const std::vector<int>&'}
569 | vector(size_type __n, const value_type& __value,
| ~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; size_type = long unsigned int; allocator_type = std::allocator<std::vector<int> >]'
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:556:51: note: no known conversion for argument 2 from 'int' to 'const std::vector<std::vector<int> >::allocator_type&' {aka 'const std::allocator<std::vector<int> >&'}
556 | vector(size_type __n, const allocator_type& __a = allocator_type())
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector(const allocator_type&) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; allocator_type = std::allocator<std::vector<int> >]'
542 | vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:542:7: note: candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate: 'std::vector<_Tp, _Alloc>::vector() [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >]'
531 | vector() = default;
| ^~~~~~
/usr/include/c++/14/bits/stl_vector.h:531:7: note: candidate expects 0 arguments, 2 provided
|
s541942258 | p00437 | C++ | #include <iostream>
#include <vector>
using namespace std;
vector<int> ans;
bool check(vector<int> v) {
int count = 0, no;
for (int i = 0; i < 3; ++i)
if (ans[v[i]] != 1) {
no = v[i];
++count;
}
if (count > 1) return false;
else if (count == 0) { cout << "ERROR" << endl; return false; }
else ans[no] = 0;
return true;
}
vector<int> make_result(int a, int b, int c, int r) {
vector<int> ret;
ret.push_back(a);
ret.push_back(b);
ret.push_back(c);
ret.push_back(r);
return ret;
}
int main() {
int a, b, c;
while (cin >> a >> b >> c, a || b || c) {
int n = a + b + c;
int N; cin >> N;
ans.erase( ans.begin(), ans.end() );
for (int i = 0; i < n; ++i)
ans.push_back(2);
vector< vector<int> > results;
for (int i = 0; i < N; ++i) {
int r;
cin >> a >> b >> c >> r;
--a, --b, --c;
if (r == 1)
ans[a] = ans[b] = ans[c] = 1;
else results.push_back( make_result(a, b, c, r) );
}
while (1) {
bool update = false;
for (int i = 0; i < results.size(); ++i)
if (update = check(results[i]))
results.erase( i );
if (!update) break;
}
for (int i = 0; i < n; ++i)
cout << ans[i] << endl;
}
} | a.cc: In function 'int main()':
a.cc:61:54: error: no matching function for call to 'std::vector<std::vector<int> >::erase(int&)'
61 | results.erase( i );
| ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1536:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1536 | erase(const_iterator __position)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1536:28: note: no known conversion for argument 1 from 'int' to 'std::vector<std::vector<int> >::const_iterator'
1536 | erase(const_iterator __position)
| ~~~~~~~~~~~~~~~^~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate: 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator, const_iterator) [with _Tp = std::vector<int>; _Alloc = std::allocator<std::vector<int> >; iterator = std::vector<std::vector<int> >::iterator; const_iterator = std::vector<std::vector<int> >::const_iterator]'
1564 | erase(const_iterator __first, const_iterator __last)
| ^~~~~
/usr/include/c++/14/bits/stl_vector.h:1564:7: note: candidate expects 2 arguments, 1 provided
|
s295479823 | p00437 | C++ | #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
int parts[512], check, n, wk, tk, kt, kr;
vector<int> a, b, c;
while(cin >> wk >> tk >> kt >> check)
{
for(int i = 0; i < 300; i++)
{
parts[i] = -1;
}
n = wk + tk + kt;
for(int i = 0; i < check; i++)
{
cin >> wk >> tk >> kt >> kr;
if(kr)
{
parts[wk-1] = parts[tk-1] = parts[kt-1] = 1;
}
else
{
a.push_back(wk-1);
b.push_back(tk-1);
c.push_back(kt-1);
}
}
for(int i = 0; i < a.size(); i++)
{
if( (parts[a[i]] + parts[b[i]] + parts[c[i]]) == 1)
{
if(parts[a[i]] == -1)
{
parts[a[i]] = 0;
}
else if(parts[b[i]] == -1)
{
parts[b[i]] = 0;
}
else if(parts[c[i]] == -1)
{
parts[c[i]] = 0;
}
}
}
for(int i = 0; i < n; i++)
{
if(parts[i] == -1)
parts[i] = 2;
}
for(int i = 0; i < n; i++)
{
cout << parts[i] << endl;
}
}
a.clear();
b.clear();
c.clear();
}
/*
2 3 2
4
1 3 5 1
2 4 5 1
2 5 6 1
1 5 6 1
* | a.cc:87:1: error: unterminated comment
87 | /*
| ^
|
s269252868 | p00437 | C++ | #include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<sstream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cctype>
#include<climits>
using namespace std;
#define REP(i, j) for(int i = 0; i < j; i++)
#define FOR(i, j, k) for(int i = j; i < k; i++)
#define P pair<int, int>
const int INF = INT_MAX / 2;
class C{
public:
int abc[3], sign;
C(int _a, int _b, int _c, int _sign);
};
C::C(int _a, int _b, int _c, int _sign){
abc[0] = _a;
abc[1] = _b;
abc[2] = _c;
sign = _sign;
}
int cntOK(C cls, vector<int> ok){
int ret = 0;
REP(i, 3){
if(ok[cls.abc[i]] == true) ret++;
}
return ret;
}
int searchNG(C cls, vector<int> ok){
REP(i, 3){
if(ok[cls.abc[i]] == 2) return cls.abc[i];
}
return -1;
}
int main(){
int x, y, z;
while(cin >>x >>y >>z && (x && y && z)){
int sum = x + y + z;
vector<int> ok(sum + 1, 2);
int n;
cin >>n;
vector<C> vec;
REP(i, n){
int a, b, c, s;
cin >>a >>b >>c >>s;
if(s == 0){
C cls(a, b, c, s);
vec.push_back(cls);
} else{
ok[a] = 1; ok[b] = 1; ok[c] = 1;
}
}
REP(i, vec.size()){
if(vec[i].sign == 1) continue;
int cntok = cntOK(vec[i], ok);
if(cntok == 2){
ok[searchNG(vec[i], ok)] = 0;
vec[i].sign = 1;
isChanged = true;
}
}
FOR(i, 1, ok.size()) cout <<ok[i] <<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:79:17: error: 'isChanged' was not declared in this scope
79 | isChanged = true;
| ^~~~~~~~~
|
s864129379 | p00437 | C++ | #include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
int h;
while(cin >>a>>b>>c){
if(a==0&&b==0&&c==0){break;}
cin >>n;
int d[n];
int e[n];
int f[n];
int g[n];
int i[n];
h=0;
while(h<n){
cin >>d[h];
cin >>e[h];
cin >>f[h];
cin >>g[h];
i[h]==2;
h=h+1;}
h=0;
while(h<n){
if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
h=h+1;}
h=0;
while(h<n){
if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
h=h+1;}
h=0;
while(h<n){
cout <<i[h]<<endl;
h=h+1;}
}} | a.cc: In function 'int main()':
a.cc:11:7: error: 'n' was not declared in this scope
11 | cin >>n;
| ^
a.cc:19:7: error: 'd' was not declared in this scope
19 | cin >>d[h];
| ^
a.cc:20:7: error: 'e' was not declared in this scope
20 | cin >>e[h];
| ^
a.cc:21:7: error: 'f' was not declared in this scope
21 | cin >>f[h];
| ^
a.cc:22:7: error: 'g' was not declared in this scope
22 | cin >>g[h];
| ^
a.cc:23:1: error: 'i' was not declared in this scope
23 | i[h]==2;
| ^
a.cc:27:4: error: 'g' was not declared in this scope
27 | if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
| ^
a.cc:27:13: error: 'i' was not declared in this scope
27 | if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
| ^
a.cc:27:15: error: 'd' was not declared in this scope
27 | if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
| ^
a.cc:27:26: error: 'e' was not declared in this scope
27 | if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
| ^
a.cc:27:37: error: 'f' was not declared in this scope
27 | if(g[h]==1){i[d[h]]=1; i[e[h]]=1; i[f[h]]=1;}
| ^
a.cc:31:4: error: 'i' was not declared in this scope
31 | if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
| ^
a.cc:31:6: error: 'd' was not declared in this scope
31 | if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
| ^
a.cc:31:18: error: 'e' was not declared in this scope
31 | if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
| ^
a.cc:31:28: error: 'g' was not declared in this scope
31 | if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
| ^
a.cc:31:39: error: 'f' was not declared in this scope
31 | if(i[d[h]]==1&&i[e[h]]==1&&g[h]==0){i[f[h]]==0;}
| ^
a.cc:32:4: error: 'i' was not declared in this scope
32 | if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
| ^
a.cc:32:6: error: 'f' was not declared in this scope
32 | if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
| ^
a.cc:32:18: error: 'e' was not declared in this scope
32 | if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
| ^
a.cc:32:28: error: 'g' was not declared in this scope
32 | if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
| ^
a.cc:32:39: error: 'd' was not declared in this scope
32 | if(i[f[h]]==1&&i[e[h]]==1&&g[h]==0){i[d[h]]==0;}
| ^
a.cc:33:4: error: 'i' was not declared in this scope
33 | if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
| ^
a.cc:33:6: error: 'd' was not declared in this scope
33 | if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
| ^
a.cc:33:18: error: 'f' was not declared in this scope
33 | if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
| ^
a.cc:33:28: error: 'g' was not declared in this scope
33 | if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
| ^
a.cc:33:39: error: 'e' was not declared in this scope
33 | if(i[d[h]]==1&&i[f[h]]==1&&g[h]==0){i[e[h]]==0;}
| ^
a.cc:37:8: error: 'i' was not declared in this scope
37 | cout <<i[h]<<endl;
| ^
|
s039476388 | p00437 | C++ | #include<cstdio>
int main()
{
while(true) {
int a, b, c, n;
int test[3000], r[1000];
int ans[1000];
scanf("%d%d%d", &a, &b, &c);
if(a == 0)
break;
scanf("%d", &n);
for(int i = 0; i < n; ++i) {
scanf("%d%d%d%d", test + i * 3, test + i * 3 + 1, test + i * 3 + 2, r + i);
test[i * 3] -= 1, test[i * 3 + 1] -= 1, test[i * 3 + 2] -= 1;
}
for(int i = 0; i < a + b + c; ++i)
ans[i] = 2;
for(int i = 0; i < n; ++i) {
if(r[i] != 1)
continue;
for(int j = i * 3; j < i * 3 + 3; ++j)
ans[j] = 1;
}
for(int i = 0; i < n; ++i) {
if(tr[i] != 0)
continue;
int correct = 0;
for(int j = i * 3; j < i * 3 + 3; ++j)
correct += (ans[j] == 1);
if(correct != 2)
continue;
for(int j = i * 3; j < i * 3 + 3; ++j) {
if(ans[j] != 1)
ans[j] = 0;
}
}
for(int i = 0; i < a + b + c; ++i)
printf("%d\n", ans[i]);
}
return 0;
} | a.cc: In function 'int main()':
a.cc:28:4: error: 'tr' was not declared in this scope; did you mean 'r'?
28 | if(tr[i] != 0)
| ^~
| r
|
s337141956 | p00437 | C++ | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int a,b,c,n,flag=1;
while(1){
cin>>a>>b>>c;
if(a==0 && b==0 && c==0)
break;
cin>>n;
int p=0,w[n],x[n],y[n],z[n],ans[a+b+c+1];
for(int i=0;i<a+b+c+1;i++)
ans[i]=2;
for(int i=0;i<n;i++){
cin>>w[i]>>x[i]>>y[i]>>z[i];
if(z[i]==1){
ans[w[i]]==1;
ans[x[i]]==1;
ans[y[y]]==1;
}
}
for(int i=0;i<n;i++){
if(z[i]==0){
if(ans[w[i]]==1 && ans[x[i]]==1 && ans[y[i]]==2)
ans[y[i]]=0;
if(ans[w[i]]==1 && ans[x[i]]==2 && ans[y[i]]==1)
ans[x[i]]=0;
if(ans[w[i]]==2 && ans[x[i]]==1 && ans[y[i]]==1)
ans[w[i]]=0;
}
}
for(int i=1;i<=a+b+c;i++)
cout<<ans[i]<<endl;
}
return 0;
} | a.cc: In function 'int main()':
a.cc:19:38: error: invalid types 'int [n][int [n]]' for array subscript
19 | ans[y[y]]==1;
| ^
|
s870381339 | p00438 | Java | 5 4
3
2 2
2 3
4 2
5 4
3
2 2
2 3
4 2
0 0
| Main.java:1: error: class, interface, enum, or record expected
5 4
^
1 error
|
s891006613 | p00438 | Java | import java.util.Scanner;
public class AOJ0515{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
//while(true){
int w = sc.nextInt();
int h = sc.nextInt();
//if(w==0&&h==0)break;
int n = sc.nextInt();
boolean map[][]=new boolean[w+1][h+1];
for(int i=0;i<n;i++)map[sc.nextInt()][sc.nextInt()]=true;
//今いる場所を記録
int dp[][]=new int[w+1][h+1];
//for(int i=2;i<=w;i++)dp[i][1]=1;
//for(int i=2;i<=h;i++)dp[1][i]=1;
dp[1][1]=1;
for(int i=1;i<=w;i++){
for(int j=1;j<=h;j++){
// if(map[i][j])
// dp[i][j]=0;
if(map[i][j]){
dp[i][j]=0;
}else if(i==1&&j==1){
dp[i][j]=1;
}else if(i==1){
dp[i][j]=dp[i][j-1];
}else if(j==1){
dp[i][j]=dp[i-1][j];
}else{
dp[i][j]=dp[i][j-1]+dp[i-1][j];
}
//System.out.println(i+""+j+" "+dp[i][j-1]+" "+dp[i-1][j]+" "+dp[i][j]);
}
}
System.out.println(dp[w][h]);
}
//}
} | Main.java:2: error: class AOJ0515 is public, should be declared in a file named AOJ0515.java
public class AOJ0515{
^
1 error
|
s950385364 | p00438 | C | #include<iostream>
#include<algorithm>
using namespace std;
int dx[2]={0,1};
int dy[2]={1,0};
int a,b;
int MAP[17][17];
int x,y;
void func(int y,int x);
int main(void){
int i,j;
while(1){
for(i=0;i<17;i++){
for(j=0;j<17;j++){
MAP[i][j]=0;
}
}
cin>>a>>b;
if(a==0&&b==0) break;
cin>>n;
for(i=0;i<n){
cin>>x>>y;
MAP[x][y]=-1;
}
func(0,0);
}
return 0;
}
void func(int y,int x){
int xx,yy;
if(xx==a&&yy==b) cnt++;
for(i=0;i<2;i++){
xx=dx[i];
yy=dy[i];
}
if(xx<=a&&yy<=b&&MAP[xx][yy]!=-1){
}
| main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s493940528 | p00438 | C | #include<stdio.h>
int kai(int n) {
if (n <= 1) return 1;
return n * kai(n - 1);
}
int r(int nx, int ny, int kx, int ky) {
int m = kx - nx,l = ky - ny;
return kai(m + l) / kai(m) / kai(l);
}
int in(int n[2], int k[40][2]) {
int i,
for (i = 0; i < 40; i ++) {
if (n == k[i]) {
return 0;
}
}
return 1;
}
int road(int x, int y, int n[2], int m, int k[40][2]) {
int ans = r(x, y, n[0], n[1]), i;
for (i = 0; i < m; i ++) {
if (in(k[i], k)) {
ans -= r(x, y, k[i][0], k[i][1]) * r(k[i][0], k[i][1], n[0], n[1]);
} else {
ans -= r(x, y, k[i][0], k[i][1]) * road(k[i][0], k[i][1], n, m, k);
}
}
return ans;
}
int main() {
int ans[1000], i, l;
for (i = 0; i < 1000; i ++) {
ans[i] = -1;
}
int n[2];
while (1) {
scanf("%d %d", &n[0], &n[1]);
if (n[0] == 0 && n[1] == 0) {
for (i = 0; ans[i] != -1; i ++) {
printf("%d\n", ans[i]);
}
return 0;
} else {
int k[40][2], m;
scanf("%d", &m);
for (i = 0; i < m; i ++) {
scanf("%d %d", &k[i][0], &k[i][1]);
}
ans[l] = road(n, m, k); l ++;
}
}
} | main.c: In function 'in':
main.c:12:3: error: expected identifier or '(' before 'for'
12 | for (i = 0; i < 40; i ++) {
| ^~~
main.c:12:27: error: expected ';' before ')' token
12 | for (i = 0; i < 40; i ++) {
| ^
| ;
main.c:12:27: error: expected statement before ')' token
main.c: In function 'main':
main.c:49:21: error: passing argument 1 of 'road' makes integer from pointer without a cast [-Wint-conversion]
49 | ans[l] = road(n, m, k); l ++;
| ^
| |
| int *
main.c:19:14: note: expected 'int' but argument is of type 'int *'
19 | int road(int x, int y, int n[2], int m, int k[40][2]) {
| ~~~~^
main.c:49:27: error: passing argument 3 of 'road' from incompatible pointer type [-Wincompatible-pointer-types]
49 | ans[l] = road(n, m, k); l ++;
| ^
| |
| int (*)[2]
main.c:19:28: note: expected 'int *' but argument is of type 'int (*)[2]'
19 | int road(int x, int y, int n[2], int m, int k[40][2]) {
| ~~~~^~~~
main.c:49:16: error: too few arguments to function 'road'
49 | ans[l] = road(n, m, k); l ++;
| ^~~~
main.c:19:5: note: declared here
19 | int road(int x, int y, int n[2], int m, int k[40][2]) {
| ^~~~
|
s113052035 | p00438 | C | #include<stdio.h>
int main(void){
int road[20][20]={{0}},i,j,t,a,b,tree,tx,ty,ans;
for(;;){
road[1][1]=1;
scanf("%d %d",&a,&b);
if(a==0&&b==0)break;
scanf("%d",&tree);
for(t=0;t<tree;t++){
scanf("%d %d",&tx,&ty);
road[tx][ty]=-1;
}
for(i=1;i<=a;i++){
for(j=1;j<=b;j++){
if(road[i][j]==0){
if(i==1){
road[i][j]=road[i][j-1];
}
else if(j==1){
road[i][j]=road[i-1][j];
}
else{
if(road[i][j-1]==-1){
road[i][j]=road[i-1][j];
}
else if(road[i-1][j]==-1){
road[i][j]=road[i][j-1];
}
else road[i][j]=road[i-1][j]+road[i][j-1];
}
}
}
}
printf("%d\n",road[a][b]);
} | main.c: In function 'main':
main.c:35:1: error: expected declaration or statement at end of input
35 | }
| ^
|
s324730817 | p00438 | C | #include<stdio.h>
int main(){
int board[17][17]={0};
int i,j,n,x,y;
while(scanf("%d%d",&x,&y),x+y){
scanf("%d",&n);
for(i=0;i<17*17;i++)board[i%17][i/17]=-1;
for(i=0;i<n;i++){
scanf("%d%d",&p,&q);
board[p][q]=0;
}
board[1][1]=1;
for(i=1;i<17;i++){
if(board[i][j]<0){
board[i][j]=board[1][i-1];
board[i][j]=board[i-1][1];
}
}
for(i=2;i<x;i++){
for(j=2;j<y;j++){
if(board[i][j]<0){
board[i][j]=board[i][j-1]+board[i-1][j];
}
}
}
printf("%d\n",board[x][y]);
}
return 0;
} | main.c: In function 'main':
main.c:11:39: error: 'p' undeclared (first use in this function)
11 | scanf("%d%d",&p,&q);
| ^
main.c:11:39: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:42: error: 'q' undeclared (first use in this function)
11 | scanf("%d%d",&p,&q);
| ^
|
s999717768 | p00438 | C | #include<stdio.h>
int a,b;
int data[17][17];
int hoko(int nx,int ny);
int main(){
int i,j,p,q;
for(i=0;i<17;i++){
for(j=0;j<17;j++){
data[i][j]=-1;
}
}
scanf("%d %d",&a,&b);
sacnf("%d",&k);
for(i=0;i<k;i++){
scanf("%d %d",&p,&q);
data[p][q]=0;
}
printf("%d\n",hoko(a,b));
return(0);
}
int hoko(int nx,int ny){
if(0<nx&&0<ny&&nx<=a&&ny<=b){
if(nx==1&&ny==1) return 1;
if(data[nx][ny]!=-1) return data[nx][ny];
return data[nx][ny]=(hoko(nx,ny-1)+hoko(nx-1,ny));
}
}
| main.c: In function 'main':
main.c:16:3: error: implicit declaration of function 'sacnf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
16 | sacnf("%d",&k);
| ^~~~~
| scanf
main.c:16:15: error: 'k' undeclared (first use in this function)
16 | sacnf("%d",&k);
| ^
main.c:16:15: note: each undeclared identifier is reported only once for each function it appears in
|
s903061051 | p00438 | C | #include<stdio.h>
int main(void) {
int dp[16][16];
int a, b, n, x, y;
int i,j;
while (1) {
scanf("%d %d", &a, &b);
if (a == 0 && b == 0)break;
scanf("%d", &n);
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++)
dp[i][j] = 0;
}
for (i = 0; i < b; i++)
dp[0][i] = 1;
for (i = 0; i < a; i++)
dp[i][0] = 1;
for (i = 0; i < n; i++) {
scanf_s("%d %d", &x, &y);
dp[x - 1][y - 1] = -1;
if (x == 1)
for (j = y - 1; j < b; j++) { dp[0][j] = 0; }
if (y == 1)
for (j = x - 1; j < a; j++) { dp[j][0] = 0; }
}
for (i = 1; i < a; i++) {
for (j = 1; j < b; j++) {
if (dp[i][j] == -1) { dp[i][j] = 0; }
else dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
}
}
printf("%d\n", dp[a - 1][b - 1]);
}
return 0;
} | main.c: In function 'main':
main.c:24:25: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
24 | scanf_s("%d %d", &x, &y);
| ^~~~~~~
| scanf
|
s749445248 | p00438 | C | include <stdio.h>
int main(){
int a,b,n,i,j,cross[16][16],x,y;
while(1){
scanf("%d%d",&a,&b);
if(a == 0 && b == 0) {break;}
scanf("%d",&n);
for(i=0;i<a;i++){
for(j=0;j<b;j++){
cross[i][j] = 0;
}
}
for(i = 0;i < b;i++){
cross[0][i] = 1;
}
for(i = 0;i < a;i++){
cross[i][0] = 1;
}
for(i = 0;i < n;i++){
scanf("%d%d",&x,&y);
cross[x-1][y-1] = -1;
if(x == 1) {for(j=y-1;j<b;j++){ cross[0][j] = 0;}}
if(y == 1) {for(j=x-1;j<a;j++){ cross[j][0] = 0; }}
}
for(i=1;i<a;i++){
for(j=1;j<b;j++){
if(cross[i][j] == -1) {cross[i][j] = 0;}
else {cross[i][j] = cross[i][j-1] + cross[i-1][j];}
}
}
printf("%d\n",cross[a-1][b-1]);
}
return 0;
} | main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include <stdio.h>
| ^
|
s716682137 | p00438 | C++ | // #1140935 Solution for 0515: School Road by ryogo
#include<iostream>
using namespace std;
int dp[20][20];
int main(){
int a, b i, j, x, y;
while(cin>>a>>b){
if(a == 0 && b == 0) { break; }
int n;
cin>>n;
for(i=1;i<=16;i++)for(j=1;j<=16;j++){dp[i][j]=0;}
for(i=1;i<=n ;i++){
cin>>x>>y; dp[y][x]=-1;
}
dp[1][1]=1;
for(i=1;i<=b;i++){
for(j=1;j<=a;j++){
if(i==1 && j==1)continue;
if(dp[i][j]!=-1){
dp[i][j]=dp[i][j-1]+dp[i-1][j];
}
else dp[i][j]=0;
}
}
cout<<dp[b][a]<<endl;
}
}
| a.cc: In function 'int main()':
a.cc:6:18: error: expected initializer before 'i'
6 | int a, b i, j, x, y;
| ^
a.cc:7:23: error: 'b' was not declared in this scope
7 | while(cin>>a>>b){
| ^
a.cc:11:21: error: 'i' was not declared in this scope
11 | for(i=1;i<=16;i++)for(j=1;j<=16;j++){dp[i][j]=0;}
| ^
a.cc:11:39: error: 'j' was not declared in this scope
11 | for(i=1;i<=16;i++)for(j=1;j<=16;j++){dp[i][j]=0;}
| ^
a.cc:12:21: error: 'i' was not declared in this scope
12 | for(i=1;i<=n ;i++){
| ^
a.cc:13:30: error: 'x' was not declared in this scope
13 | cin>>x>>y; dp[y][x]=-1;
| ^
a.cc:13:33: error: 'y' was not declared in this scope
13 | cin>>x>>y; dp[y][x]=-1;
| ^
a.cc:16:21: error: 'i' was not declared in this scope
16 | for(i=1;i<=b;i++){
| ^
a.cc:17:29: error: 'j' was not declared in this scope
17 | for(j=1;j<=a;j++){
| ^
|
s814588297 | p00438 | C++ | // #1140935 Solution for 0515: School Road by ryogo
#include<iostream>
using namespace std;
int dp[17][17];
int main(){
int a, b ,i, j, x, y;
while(cin >> a >> b){
if(a == 0 && b == 0) { break; }
int n;
cin>>n;
for(i=1; i<=16; i++)for(j=1; j<=16; j++){dp[i][j] = 0;}
for(i=1; i<=n ; i++){
cin >> x >> y; dp[y][x] = -1;
}
dp[1][1] = 1;
for(i=1; i<=b; i++){
for(j=1; j<=a; j++){
if(i==1 && j==1)continue;
if(dp[i][j]! = -1){
dp[i][j] = dp[i][j-1] + dp[i-1][j];
}
else dp[i][j] = 0;
}
}
cout << dp[b][a] << endl;
}
}
| a.cc: In function 'int main()':
a.cc:19:44: error: expected ')' before '!' token
19 | if(dp[i][j]! = -1){
| ~ ^
| )
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.