submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s514453368
|
p00031
|
Java
|
import java.util.*;
public class Vol0_31{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
StringBuffer sb = new StringBuffer();
while(scan.hasNext()){
int w = scan.nextInt();
int i = 1;
while(i <= 512){
if((w & i) == i){
sb.append(i).append(' ');
}
i = i << 1;
}
String s = sb.toString().trim();
System.out.printf("%s\n", s);
}
}
}
|
Main.java:3: error: class Vol0_31 is public, should be declared in a file named Vol0_31.java
public class Vol0_31{
^
1 error
|
s525939573
|
p00031
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while(s.hasNext){
boolean flag[] = new boolean[10];
int in = s.nextInt();
int a = 1024;
for(int i=9 ; i>=0 ; i--){
a /= 2;
if(in>=a){
in -= a;
flag[i] = true;
}
}
int b = 1;
for(int i=0 ; i<10 ; i++){
if(flag[i]==true)
System.out.print(b + " ");
b *= 2;
}
System.out.println();
}
}
}
|
Main.java:7: error: cannot find symbol
while(s.hasNext){
^
symbol: variable hasNext
location: variable s of type Scanner
1 error
|
s336277861
|
p00031
|
Java
|
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
while(s.hasNext){
boolean flag[] = new boolean[10];
int in = s.nextInt();
int a = 1024;
int n = 0;
for(int i=9 ; i>=0 ; i--){
a /= 2;
if(in>=a){
in -= a;
flag[i] = true;
n++;
}
}
int b = 1;
for(int i=0 ; i<10 ; i++){
if(flag[i]==true)
n--;
System.out.print(b);
if(n!=0)
System.out.print(" ");
b *= 2;
}
System.out.println();
}
}
}
|
Main.java:7: error: cannot find symbol
while(s.hasNext){
^
symbol: variable hasNext
location: variable s of type Scanner
1 error
|
s297544833
|
p00031
|
Java
|
public class weight {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
int input=32;
System.out.println("Input:"+input);
System.out.print("Output:");
System.out.println(weight(input));
}
public static String weight(int num){ //num=蛟、縲〔=菫よ焚
int number=num;
String sub=""; //途中経過
String result=""; //結果
int k=0;
while(number>1){
//int ans=number%2;
//System.out.println("number="+number);
int ans=(number%2);
sub=ans+","+sub;
number=number/2;
k++;
}
sub=number+","+sub;
//System.out.println("sub:"+sub);
String[] div_sub=sub.split(",");
for(int i=0;i<div_sub.length;i++){
int x=(int)Math.pow((double)2,(double)(k-i));
int ans=x*Integer.parseInt(div_sub[i]);
//System.out.println("ans("+(k-i)+","+x+")="+ans);
if(ans!=0){
if(!result.equals(""))result=ans+" "+result;
else result=""+ans;
}
}
return result;
}
}
|
Main.java:1: error: class weight is public, should be declared in a file named weight.java
public class weight {
^
1 error
|
s976933186
|
p00031
|
Java
|
public static void main(String[] args) {
// TODO Auto-generated method stub
int input=32;
System.out.println("Input:"+input);
System.out.print("Output:");
System.out.println(weight(input));
}
public static String weight(int num){ //num=蛟、縲〔=菫よ焚
int number=num;
String sub=""; //途中経過
String result=""; //結果
int k=0;
while(number>1){
//int ans=number%2;
//System.out.println("number="+number);
int ans=(number%2);
sub=ans+","+sub;
number=number/2;
k++;
}
sub=number+","+sub;
//System.out.println("sub:"+sub);
String[] div_sub=sub.split(",");
for(int i=0;i<div_sub.length;i++){
int x=(int)Math.pow((double)2,(double)(k-i));
int ans=x*Integer.parseInt(div_sub[i]);
//System.out.println("ans("+(k-i)+","+x+")="+ans);
if(ans!=0){
if(!result.equals(""))result=ans+" "+result;
else result=""+ans;
}
}
return result;
}
|
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
^
(use --enable-preview to enable unnamed classes)
1 error
|
s652563757
|
p00031
|
Java
|
public class Main {
/**
* @param args
*/
public static void main(String[] args) throws Exception{
// TODO Auto-generated method stub
//int input=32;
BufferedReader input_a =
new BufferedReader (new InputStreamReader (System.in));
int input = Integer.parseInt(input_a.readLine());
//System.out.println("Input:"+input);
//System.out.print("Output:");
System.out.println(weight(input));
}
public static String weight(int num){ //num=蛟、縲〔=菫よ焚
int number=num;
String sub=""; //途中経過
String result=""; //結果
int k=0;
while(number>1){
//int ans=number%2;
//System.out.println("number="+number);
int ans=(number%2);
sub=ans+","+sub;
number=number/2;
k++;
}
sub=number+","+sub;
//System.out.println("sub:"+sub);
String[] div_sub=sub.split(",");
for(int i=0;i<div_sub.length;i++){
int x=(int)Math.pow((double)2,(double)(k-i));
int ans=x*Integer.parseInt(div_sub[i]);
//System.out.println("ans("+(k-i)+","+x+")="+ans);
if(ans!=0){
//if(!result.equals(""))result=ans+" "+result;
if(!result.equals(""))result=ans+","+result;
else result=""+ans;
}
}
return result;
}
}
|
Main.java:9: error: cannot find symbol
BufferedReader input_a =
^
symbol: class BufferedReader
location: class Main
Main.java:10: error: cannot find symbol
new BufferedReader (new InputStreamReader (System.in));
^
symbol: class BufferedReader
location: class Main
Main.java:10: error: cannot find symbol
new BufferedReader (new InputStreamReader (System.in));
^
symbol: class InputStreamReader
location: class Main
3 errors
|
s262623104
|
p00031
|
C
|
#include <stdio.h>
int main(void)
{
int a[10],int c[10]={0},i,inp,same;
a[0]=1,a[1]=2,a[2]=4,a[3]=8,a[4]=16,a[5]=32,a[6]=64,a[7]=128,a[8]=256,a[9]=512;
for(;scanf("%d",&inp)!=EOF;)
{
c[10]={0};
same=inp;
if(inp%2!=0)
{
c[0]=1;
inp-=1;
}
for(i=9;i>=0;i--)
{
if(same-a[i]>=0)
{
c[i]=1;
same-=a[i];
}
}
for(i=0;i<10;i++)
{
if(c[i]==1)
{
printf("%d ",a[i]);
}
if(i==9)
{
printf("\n");
}
}
}
return 0;
}
|
main.c: In function 'main':
main.c:4:15: error: expected identifier or '(' before 'int'
4 | int a[10],int c[10]={0},i,inp,same;
| ^~~
main.c:4:28: error: expected expression before ',' token
4 | int a[10],int c[10]={0},i,inp,same;
| ^
main.c:4:29: error: 'i' undeclared (first use in this function)
4 | int a[10],int c[10]={0},i,inp,same;
| ^
main.c:4:29: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:31: error: 'inp' undeclared (first use in this function); did you mean 'int'?
4 | int a[10],int c[10]={0},i,inp,same;
| ^~~
| int
main.c:4:35: error: 'same' undeclared (first use in this function)
4 | int a[10],int c[10]={0},i,inp,same;
| ^~~~
main.c:8:9: error: 'c' undeclared (first use in this function)
8 | c[10]={0};
| ^
main.c:8:15: error: expected expression before '{' token
8 | c[10]={0};
| ^
|
s259428997
|
p00031
|
C
|
#include<stdio.h>
int main() {
int i, n;
while (scanf("%d", &n) != EOF) {
for (i = 0; i < 10; i ++) {
if (n & 1 << i) i{
printf("%d", 1 << i); break;
}
for (i = 0; i < 10; i ++) {
if (n & 1 << i) printf(" %d", 1 << i);
}
printf("\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:6:24: error: expected ';' before '{' token
6 | if (n & 1 << i) i{
| ^
| ;
main.c:15:1: error: expected declaration or statement at end of input
15 | }
| ^
|
s162854776
|
p00031
|
C
|
#include<stdio.h>
int main() {
int i, n;
while (scanf("%d", &n) != EOF) {
for (i = 0; i < 10; i ++) {
if (n & 1 << i) {
printf("%d", 1 << i); break;
}
for (i = 0; i < 10; i ++) {
if (n & 1 << i) printf(" %d", 1 << i);
}
printf("\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:15:1: error: expected declaration or statement at end of input
15 | }
| ^
|
s826386787
|
p00031
|
C
|
#include<stdio.h>
int main() {
int i, j, n;
while (scanf("%d", &n) != EOF) {
for (h = 0; j < 10; j ++) {
if (n & 1 << j) {
printf("%d", 1 << i); break;
}
}
for (i = j; i < 10; i ++) {
if (n & 1 << i) printf(" %d", 1 << i);
}
printf("\n");
}
return 0;
}
|
main.c: In function 'main':
main.c:5:10: error: 'h' undeclared (first use in this function)
5 | for (h = 0; j < 10; j ++) {
| ^
main.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
|
s986395030
|
p00031
|
C
|
#include <stdio.h>
int main()
{
int i, n;
while (scanf("%d", &n) != EOF){
for (i = 1; i <= 512; i *= 2){
if (n % (i * 2) != 0){
printf("%d", i);
n -= i;
if (n != 0){
printf(" ");
}
}
if (n == 0){
puts("");
break;
}
}
}
return 0;
|
main.c: In function 'main':
main.c:20:1: error: expected declaration or statement at end of input
20 | return 0;
| ^~~~~~
|
s350601219
|
p00031
|
C
|
#include <cstdio>
#include <algorithm>
using namespace std;
int main()
{
int n, c;
int a[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 516};
int b[10];
while (scanf("%d", &n) != EOF){
c = 0;
for (int i = 9; 0 <= i; i--){
if (n >= a[i]){
n -= a[i];
b[c] = a[i];
c++;
}
}
reverse(b, b + c);
for (int i = 0; i < c; i++){
printf("%d", b[i]);
if (i < c - 1){
printf(" ");
}
}
printf("\n");
}
return (0);
}
|
main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s281413298
|
p00031
|
C
|
#niclude<stdio.h>
int main(){
int a,x[12],k,i;
while(scanf("%d",&a)!=EOF){
k=0;
if(a>=512){
x[k++]=512;
a-=512;
if(a>=256){
x[k++]=256;
a-=256;
}
if(a>=128){
x[k++]=128;
a-=128;
}
if(a>=64){
x[k++]=64;
a-=64;
}
if(a>=32){
x[k++]=32;
a-=32;
}
if(a>=16){
x[k++]=16;
a-=16;
}
if(a>=8){
x[k++]=8;
a-=8;
}
if(a>=4){
x[k++]=4;
a-=4;
}
if(a>=2){
x[k++]=2;
a-=2;
}
if(a>=1;){
x[k++]=1;
a-=1;
}
if(a==0)
for(i=k-1;i>=0;i--)
printf("%d ",x[i]);
printf("\n");
}
return 0;
}
|
main.c:1:2: error: invalid preprocessing directive #niclude; did you mean #include?
1 | #niclude<stdio.h>
| ^~~~~~~
| include
main.c: In function 'main':
main.c:4:7: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%d",&a)!=EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | #niclude<stdio.h>
main.c:4:7: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("%d",&a)!=EOF){
| ^~~~~
main.c:4:7: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:23: error: 'EOF' undeclared (first use in this function)
4 | while(scanf("%d",&a)!=EOF){
| ^~~
main.c:4:23: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:23: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:8: error: expected ')' before ';' token
41 | if(a>=1;){
| ~ ^
| )
main.c:47:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
47 | printf("%d ",x[i]);
| ^~~~~~
main.c:47:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:47:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:47:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:48:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
48 | printf("\n");
| ^~~~~~
main.c:48:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:51:1: error: expected declaration or statement at end of input
51 | }
| ^
|
s128031979
|
p00031
|
C
|
main(f,n,x){
for(;~scanf("%d",&n);puts("")){
for(f=0,x=1;n;x+=x){
if(n&x){
if(f)putchar(' ');
printf("%d",x),n-=x,f=1;
}
}
}
return 0;
}
|
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(f,n,x){
| ^~~~
main.c: In function 'main':
main.c:1:1: error: type of 'f' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'x' defaults to 'int' [-Wimplicit-int]
main.c:2:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
2 | for(;~scanf("%d",&n);puts("")){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | main(f,n,x){
main.c:2:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
2 | for(;~scanf("%d",&n);puts("")){
| ^~~~~
main.c:2:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:2:24: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
2 | for(;~scanf("%d",&n);puts("")){
| ^~~~
main.c:2:24: note: include '<stdio.h>' or provide a declaration of 'puts'
main.c:5:14: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
5 | if(f)putchar(' ');
| ^~~~~~~
main.c:5:14: note: include '<stdio.h>' or provide a declaration of 'putchar'
main.c:6:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
6 | printf("%d",x),n-=x,f=1;
| ^~~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:6:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s490391022
|
p00031
|
C
|
#include<stdio.h>
int main(){
while(scanf("%d", &d) != EOF){
int d, first;
first = 1;
while(d){
if(!first)putchar(' ');
first = 0;
printf("%d", d & -d);
d -= d & -d;
}
puts("");
}
return 0;
}
|
main.c: In function 'main':
main.c:4:22: error: 'd' undeclared (first use in this function)
4 | while(scanf("%d", &d) != EOF){
| ^
main.c:4:22: note: each undeclared identifier is reported only once for each function it appears in
|
s763200809
|
p00031
|
C
|
#include<stdio.h>
int n;int i;bool f;int main(){while(scanf("%d",&n)!=EOF){f=true;for(i=0;i<10;i++)if(n>>i&1){if(f){printf("%d",1<<i);f=false;}else printf(" %d",1<<i);}printf("\n");}}
|
main.c:2:13: error: unknown type name 'bool'
2 | int n;int i;bool f;int main(){while(scanf("%d",&n)!=EOF){f=true;for(i=0;i<10;i++)if(n>>i&1){if(f){printf("%d",1<<i);f=false;}else printf(" %d",1<<i);}printf("\n");}}
| ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
1 | #include<stdio.h>
+++ |+#include <stdbool.h>
2 | int n;int i;bool f;int main(){while(scanf("%d",&n)!=EOF){f=true;for(i=0;i<10;i++)if(n>>i&1){if(f){printf("%d",1<<i);f=false;}else printf(" %d",1<<i);}printf("\n");}}
main.c: In function 'main':
main.c:2:60: error: 'true' undeclared (first use in this function)
2 | int n;int i;bool f;int main(){while(scanf("%d",&n)!=EOF){f=true;for(i=0;i<10;i++)if(n>>i&1){if(f){printf("%d",1<<i);f=false;}else printf(" %d",1<<i);}printf("\n");}}
| ^~~~
main.c:2:60: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:2:60: note: each undeclared identifier is reported only once for each function it appears in
main.c:2:119: error: 'false' undeclared (first use in this function)
2 | int n;int i;bool f;int main(){while(scanf("%d",&n)!=EOF){f=true;for(i=0;i<10;i++)if(n>>i&1){if(f){printf("%d",1<<i);f=false;}else printf(" %d",1<<i);}printf("\n");}}
| ^~~~~
main.c:2:119: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
s070894674
|
p00031
|
C
|
#include<stdio.h>
int main(void)
{
int x;
int i;
int cnt = 0;
int a[10]={1,2,4,8,16,32,64,128,256,512},check[10]={0};
while(scanf("%d",&x)!=EOF){
for(i = 9;i >= 0; i--){
if(x >= a[i] && check[i] == 0){
check[i] = 1;
x -= a[i];
if(cnt == 0)cnt = a[i];
}
for(i = 0;i < 10; i++){
if(check[i] == 1){
printf("%d",a[i]);
if(a[i] == cnt)printf("\n");
else printf(" ");
}
}
cnt = 0;
for(i = 0;i < 10; i++)check[i] = 0;
}
return 0;
}
|
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
27 | }
| ^
|
s430648828
|
p00031
|
C
|
#include <cstdio>
#include <cmath>
#include <vector>
#define pb push_back
using namespace std;
int main(void)
{
int n,b;
vector<int> vec;
while(scanf("%d",&n)!=EOF)
{
b=n;
vec.clear();
while(b>0)
{
vec.pb(b%2);
b/=2;
}
int size = vec.size();
for(int i=0;i<size;i++)
{
if(vec[i])
{
printf("%d",(int)(pow(2,i)));
(i==size-1) ? printf("\n") : printf(" ");
}
else
{
if(i==size-1)printf("\n");
}
}
}
return 0;
}
|
main.c:1:10: fatal error: cstdio: No such file or directory
1 | #include <cstdio>
| ^~~~~~~~
compilation terminated.
|
s836472865
|
p00031
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int w;
int i;
while (scanf("%d", &w) != EOF){
int weight[10] = {0};
int n;
for (i = 9; i >= 0; i--){
if (w - (int)pow(2, i) >= 0){
weight[i] = 1;
w -= (int)pow(2, i);
}
}
for (i = 0; i < 10; i++){
if (!i && weight[i]){
printf("%d", (int)pow(2, i);
else if (weight[i]){
printf(" %d", (int)pow(2, i);
}
}
puts("");
}
return (0);
}
|
main.c: In function 'main':
main.c:21:60: error: expected ')' before ';' token
21 | printf("%d", (int)pow(2, i);
| ~ ^
| )
main.c:26:26: error: expected ';' before '}' token
26 | puts("");
| ^
| ;
27 | }
| ~
main.c:30:1: error: expected declaration or statement at end of input
30 | }
| ^
main.c:30:1: error: expected declaration or statement at end of input
|
s025633818
|
p00031
|
C
|
#include <stdio.h>
#include <math.h>
int main(void)
{
int w;
int i;
while (scanf("%d", &w) != EOF){
int weight[10] = {0};
int n;
for (i = 9; i >= 0; i--){
if (w - (int)pow(2, i) >= 0){
weight[i] = 1;
w -= (int)pow(2, i);
}
}
for (i = 0; i < 10; i++){
if (!i && weight[i]){
printf("%d", (int)pow(2, i);
else if (weight[i]){
printf(" %d", (int)pow(2, i));
}
}
puts("");
}
return (0);
}
|
main.c: In function 'main':
main.c:21:60: error: expected ')' before ';' token
21 | printf("%d", (int)pow(2, i);
| ~ ^
| )
main.c:24:26: error: expected ';' before '}' token
24 | }
| ^
| ;
25 | }
| ~
main.c:30:1: error: expected declaration or statement at end of input
30 | }
| ^
|
s803005796
|
p00031
|
C++
|
5
7
127
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 5
| ^
|
s677042096
|
p00031
|
C++
|
while gets
g=$_.chomp.to_i
h=Array.new
loop do
break if(g==0)
h<<g%2
g=g/2
end
ans=[]
h.each_with_index{|item,num| ans<<item*2**num if(item*2**num!=0)}
puts ans.join(" ")
end
|
a.cc:1:1: error: expected unqualified-id before 'while'
1 | while gets
| ^~~~~
a.cc:11:5: error: 'puts' does not name a type
11 | puts ans.join(" ")
| ^~~~
|
s535117724
|
p00031
|
C++
|
while gets
g=$_.chomp.to_i
h=Array.new
loop do
break if(g==0)
h<<g%2
g=g/2
end
ans=[]
h.each_with_index{|item,num| ans<<item*2**num if(item*2**num!=0)}
puts ans.join(" ")
end
|
a.cc:1:1: error: expected unqualified-id before 'while'
1 | while gets
| ^~~~~
a.cc:11:5: error: 'puts' does not name a type
11 | puts ans.join(" ")
| ^~~~
|
s360453915
|
p00031
|
C++
|
while g=gets
g=g.chomp.to_i
h=Array.new
loop do
break if(g==0)
h<<g%2
g=g/2
end
ans=[]
h.each_with_index{|item,num| ans<<item*2**num if(item*2**num!=0)}
puts ans.join(" ")
end
|
a.cc:1:1: error: expected unqualified-id before 'while'
1 | while g=gets
| ^~~~~
a.cc:11:5: error: 'puts' does not name a type
11 | puts ans.join(" ")
| ^~~~
|
s623392664
|
p00031
|
C++
|
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <climits>
#include <utility>
#define PRINT(STR) cout << STR << endl;
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define SPACE " "
typedef long long ll;
using namespace std;
int nextInt() { int n = -1; cin >> n; return n; }
double nextDouble() { double d = -1; cin >> d; return d; }
ll nextll() { ll n = -1; cin >> n; return n; }
string nextString() { string str; cin >> str; return str; }
int INF = 1LL << 25;
double EPS = 1e-9;
int numofbits(int bits)
{
bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}
// BEGIN //////////////////////////////////////////////////////////////
int main() {
int n;
while (scanf("%d", &n) != EOF) {
if (n == 0) {
cout << 0 << endl;
continue;
}
vector<int> ans;
if (n % 2 == 1) {
n -= 1;
ans.push_back(1);
}
int t = 2;
while (n) {
if (numofbits(n) == 1) {
ans.push_back(n);
break;
}
n -= t;
ans.push_back(t);
t *= 2;
}
REP(i, ans.size() - 1) {
cout << ans[i] << SPACE;
}
cout << ans[ans.size() - 1]endl;
}
return 0;
}
// END //////////////////////////////////////////////////////////////
|
a.cc: In function 'int main()':
a.cc:69:32: error: expected ';' before 'endl'
69 | cout << ans[ans.size() - 1]endl;
| ^~~~
| ;
|
s803461502
|
p00031
|
C++
|
#include<iostream>
using namespace std;
bool a[10];
int main(){
int N;
int i=0;
while(!cin.eof())
{
cin>>N;
for(j=0;j<10;j++)
{
a[j]=0;
}
i=0;
if(i+512 <= N){
i += 512;
a[9] = 1;
}
if(i+256 <= N){
i += 256;
a[8] = 1;
}
if(i+128 <= N){
i += 128;
a[7] = 1;
}
if(i+64 <= N){
i += 64;
a[6] = 1;
}
if(i+32 <= N){
i += 32;
a[5] = 1;
}
if(i+16 <= N){
i += 16;
a[4] = 1;
}
if(i+8 <= N){
i += 8;
a[3] = 1;
}
if(i+4 <= N){
i += 4;
a[2] = 1;
}
if(i+2 <= N){
i += 2;
a[1] = 1;
}
if(i+1 <= N){
i += 1;
a[0] = 1;
}
cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[4]<<" "<<a[5]
<<" "<<a[6]<<" "<<a[7]<<" "<<a[8]<<" "<<a[9]<<" "<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:16:13: error: 'j' was not declared in this scope
16 | for(j=0;j<10;j++)
| ^
|
s260494379
|
p00031
|
C++
|
import std.stdio;
import std.array;
import std.conv;
import std.algorithm;
import std.math;
void main() {
string s;
while( (s=readln()).length != 0 ){
string[] input = split(s);
int a = to!int(input[0]);
for(int i=0;i<10;i++){
if(a%2==1) write(pow(2,i)," ");
a/=2;
}
writeln();
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import std.stdio;
| ^~~~~~
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 std.array;
| ^~~~~~
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 std.conv;
| ^~~~~~
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 std.algorithm;
| ^~~~~~
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 std.math;
| ^~~~~~
a.cc:5:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:6:1: error: '::main' must return 'int'
6 | void main() {
| ^~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'string' was not declared in this scope
7 | string s;
| ^~~~~~
a.cc:8:17: error: 's' was not declared in this scope
8 | while( (s=readln()).length != 0 ){
| ^
a.cc:8:19: error: 'readln' was not declared in this scope
8 | while( (s=readln()).length != 0 ){
| ^~~~~~
a.cc:9:24: error: expected primary-expression before ']' token
9 | string[] input = split(s);
| ^
a.cc:10:25: error: 'to' was not declared in this scope
10 | int a = to!int(input[0]);
| ^~
a.cc:12:42: error: 'pow' was not declared in this scope
12 | if(a%2==1) write(pow(2,i)," ");
| ^~~
a.cc:12:36: error: 'write' was not declared in this scope
12 | if(a%2==1) write(pow(2,i)," ");
| ^~~~~
a.cc:15:25: error: 'writeln' was not declared in this scope
15 | writeln();
| ^~~~~~~
|
s394345476
|
p00031
|
C++
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
int w = scan.nextInt();
int i = 1;
StringBuffer sb = new StringBuffer();
sb.setLength(0);
while(w / 2 > 1){
if(w % 2 == 1){
sb.append(i).append(' ');
}
w /= 2;
i = i << 1;
}
sb.append(i);
String s = sb.toString().trim();
System.out.printf("%s\n", s);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.*;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
3 | public class Main{
| ^~~~~~
|
s316516554
|
p00031
|
C++
|
#include<iostream>
#include<stdio.h>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<string.h>
#include<cctype>
#include<map>
#include<set>
#include<vector>
#include<sstream>
#include<stack>
#include<queue>
using namespace std;
int arr[10]={1,2,4,8,16,32,64,128,256,512};
int num[10]={0};
int main()
{
int N;
while(cin>>N)
{
int count=0;
while(N)
{
num[count++]=N%2;
N/=2;
}
for(int i=0;i<count-1;i++) cout<<num[i]<<" "
cout<<num[count-1]<<endl;
}
//while(1);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:33:50: error: expected ';' before 'cout'
33 | for(int i=0;i<count-1;i++) cout<<num[i]<<" "
| ^
| ;
34 | cout<<num[count-1]<<endl;
| ~~~~
|
s598954287
|
p00031
|
C++
|
#include<iostream>
#include<stdio.h>
#include<string>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<string.h>
#include<cctype>
#include<map>
#include<set>
#include<vector>
#include<sstream>
#include<stack>
#include<queue>
using namespace std;
int arr[10]={1,2,4,8,16,32,64,128,256,512};
int main()
{
int N;
while(cin>>N)
{
int count=0;
int num[10]={0};
while(N)
{
num[count++]=N%2;
N/=2;
}
for(int i=0;i<count-1;i++)
{
if(num[i]) cout<<arr[i]<<" ";
}
if(num[count-1]) cout<<arr[i]<<endl;
else cout<<endl;
}
//while(1);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:37:33: error: 'i' was not declared in this scope
37 | if(num[count-1]) cout<<arr[i]<<endl;
| ^
|
s603866006
|
p00031
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n,b;
int a[10],i;
while(cin >> n){
fill_n(a,10,1024);
b = 512;
i=0;
while(n != 0){
if(n >= b){
a[i] = b;
i++;
n -= b;
}
b /= 2;
}
sort(a,a+10);
for(int j = 0;j < i;j++){
if(j == i-1) cout << a[j] << endl;
else cout << a[j] << ' ';
}
}
return (0);
}
|
a.cc: In function 'int main()':
a.cc:20:5: error: 'sort' was not declared in this scope; did you mean 'short'?
20 | sort(a,a+10);
| ^~~~
| short
|
s615916227
|
p00031
|
C++
|
#include<iostream>
using namespace std;
int main(){
int n,b;
int a[10],i;
while(cin >> n){
fill_n(a,10,1024);
b = 512;
i=0;
while(n != 0){
if(n >= b){
a[i] = b;
i++;
n -= b;
}
if(b == 1) b--;
else b /= 2;
}
sort(a,a+10);
for(int j = 0;j < i;j++){
if(j == i-1) cout << a[j] << endl;
else cout << a[j] << ' ';
}
}
return (0);
}
|
a.cc: In function 'int main()':
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
21 | sort(a,a+10);
| ^~~~
| short
|
s974922391
|
p00031
|
C++
|
#include<stdio.h>
int main(){
int a,x[12],k,i;
while(scanf("%d",&a)!=EOF){
k=0;
if(a>=512){
x[k++]=512;
a-=512;
if(a>=256){
x[k++]=256;
a-=256;
}
if(a>=128){
x[k++]=128;
a-=128;
}
if(a>=64){
x[k++]=64;
a-=64;
}
if(a>=32){
x[k++]=32;
a-=32;
}
if(a>=16){
x[k++]=16;
a-=16;
}
if(a>=8){
x[k++]=8;
a-=8;
}
if(a>=4){
x[k++]=4;
a-=4;
}
if(a>=2){
x[k++]=2;
a-=2;
}
if(a>=1){
x[k++]=1;
a-=1;
}
if(a==0)
for(i=k-1;i>=0;i--)
printf("%d ",x[i]);
printf("\n");
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:51:2: error: expected '}' at end of input
51 | }
| ^
a.cc:2:11: note: to match this '{'
2 | int main(){
| ^
|
s813013047
|
p00031
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int x;
while (scanf("%d ", &x) == 1) {
int omori = 512;
while (x != 0)
if (x % omori == 0) {
x -= omori;
cout << omori << " ";
omori /= 2;
}
}
}
return 0;
}
|
a.cc:19:3: error: expected unqualified-id before 'return'
19 | return 0;
| ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
20 | }
| ^
|
s626365877
|
p00031
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
while (true) {
int omori = 512, x;
scanf("%d", &x);
do {
if (x % omori == 0) {
x -= omori;
cout << omori << " ";
omori /= 2;
}
} while (x != 0);
}
return 0;
}
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
while (scanf("%d ", &x) == 1) {
int omori = 512;
while (x != 0) {
if (x >= omori) {
x -= omori;
cout << omori << " ";
omori /= 2;
}
}
cout << endl;
}
return 0;
}
|
a.cc:26:5: error: redefinition of 'int main()'
26 | int main()
| ^~~~
a.cc:6:5: note: 'int main()' previously defined here
6 | int main()
| ^~~~
a.cc: In function 'int main()':
a.cc:28:24: error: 'x' was not declared in this scope
28 | while (scanf("%d ", &x) == 1) {
| ^
|
s438981288
|
p00031
|
C++
|
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
while (scanf("%d ", &x) == 1) {
int omori = 512;
while (x != 0) {
if (x >= omori) {
x -= omori;
cout << omori << " ";
omori /= 2;
}
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:24: error: 'x' was not declared in this scope
8 | while (scanf("%d ", &x) == 1) {
| ^
|
s594256980
|
p00031
|
C++
|
#include <iostream>
using namespace std;
int weight[10];
weight[1]=1;
for(int i = 2;i<=9;i++)weight[i]=2*weight[i-1];
int main(){
while(true)
{
int object;
cin >> object;
if (cin.eof())break;
for(int i =1;int <=9;i++){
if(object%2==1)
{
cout << weight[i] ;
if( i != 9 ) cout << " ";
}
}
cout << endl;
}
return 0;
}
|
a.cc:5:1: error: 'weight' does not name a type
5 | weight[1]=1;
| ^~~~~~
a.cc:6:1: error: expected unqualified-id before 'for'
6 | for(int i = 2;i<=9;i++)weight[i]=2*weight[i-1];
| ^~~
a.cc:6:15: error: 'i' does not name a type
6 | for(int i = 2;i<=9;i++)weight[i]=2*weight[i-1];
| ^
a.cc:6:20: error: 'i' does not name a type
6 | for(int i = 2;i<=9;i++)weight[i]=2*weight[i-1];
| ^
a.cc: In function 'int main()':
a.cc:15:26: error: expected unqualified-id before '<=' token
15 | for(int i =1;int <=9;i++){
| ^~
|
s708763489
|
p00031
|
C++
|
#include <iostream>
#include <cstdlib>
#define TRUE 1
#define FALSE 0
int use_num[10];
int get_input(void) {
int i;
std::cin >> i;
if (std::cin.fail())
exit(0);
return i;
}
int power(int m, int n) {
int acc = 1;
for (int i = 0; i < n; i++) {
acc *= m;
}
return acc;
}
void solve(int weight) {
for (int i = 9; i >= 0; i--) {
if (power(2, i) > weight) {
use_num[i] = FALSE;
} else {
use_num[i] = TRUE;
weight -= power(2, i);
}
}
}
void output(void) {
for (int i = 0; i <= 8; i++) {
if (use_num[i] != FALSE) {
std::cout << power(2, i) << ' ';
}
}
if (use_num[9] != FALSE) {
std::cout << power(2, i);
}
std::cout << std::endl;
}
int main(void) {
int weight;
while (weight = get_input()) {
solve(weight);
output();
}
return 0;
}
|
a.cc: In function 'void output()':
a.cc:43:31: error: 'i' was not declared in this scope
43 | std::cout << power(2, i);
| ^
|
s260852147
|
p00031
|
C++
|
#include <iostream>
using namespace std;
int weight[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
void solve()
{
int a;
while(cin >> a)
{
bool flag[10];
memset(flag, 0, sizeof(bool) * 10);
for(int i = 9; i >= 0; --i)
{
if(a / weight[i])
{
flag[i] = true;
}
a %= weight[i];
}
for(int i = 0; i < 9; ++i)
{
if(flag[i])
{
cout << weight[i] << " ";
}
}
if(flag[9])
{
cout << weight[9];
}
cout << endl;
}
}
int main()
{
solve();
return(0);
}
|
a.cc: In function 'void solve()':
a.cc:11:17: error: 'memset' was not declared in this scope
11 | memset(flag, 0, sizeof(bool) * 10);
| ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
1 | #include <iostream>
+++ |+#include <cstring>
2 |
|
s840546713
|
p00031
|
C++
|
n,k;main(a){for(;~scanf("%d",&n);puts())for(k=1;n;n^=a)k=!printf(k+" %d",a=n&-n);}
|
a.cc:1:1: error: 'n' does not name a type
1 | n,k;main(a){for(;~scanf("%d",&n);puts())for(k=1;n;n^=a)k=!printf(k+" %d",a=n&-n);}
| ^
a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token
1 | n,k;main(a){for(;~scanf("%d",&n);puts())for(k=1;n;n^=a)k=!printf(k+" %d",a=n&-n);}
| ^
|
s006102331
|
p00031
|
C++
|
#include<iostream>
#include<algorithm>
using namespace std;
#define INF 100000
int main(){
int w;
bool ans[10];
for(int i=0;i<9;i++){
ans[i]=0;
}
while(cin>>w){
for(int i=10;i--;){
if(w>=pow(2,i)){
ans[i]=1;
w=w-pow(2,i);
}
}
if(ans[0]){
cout<<1;
}
for(int i=1;i<11;i++){
if(ans[i]){
cout<<" "<<pow(2,i);
}
}cout<<endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:31: error: 'pow' was not declared in this scope
16 | if(w>=pow(2,i)){
| ^~~
a.cc:27:44: error: 'pow' was not declared in this scope
27 | cout<<" "<<pow(2,i);
| ^~~
|
s970818786
|
p00031
|
C++
|
#include <iostream>
using namespace std;
int main(){
int n;
int g;
while(cin >>n){
g=1;
while(g<1000){
if(n%(2*g)==g&&n!=0;){cout <<g<<" "; n=n-g;}
else if(n%(2*g)==g&&n==g){cout <<g<<endl; n=n-g;}
g=g*2;}
}
}
|
a.cc: In function 'int main()':
a.cc:9:21: error: expected primary-expression before ')' token
9 | if(n%(2*g)==g&&n!=0;){cout <<g<<" "; n=n-g;}
| ^
|
s520837071
|
p00031
|
C++
|
#include <iostream>
using namespace std;
int factorial(int n){
if(n==0) return 1 ; else return(2*factorial(n-1)) ;
}
int main(){
int x;
while(cin>>x){
int ans[10]={0};int ptr=0;int sum=0;
for(int i=9;i>=0;i--){
if(x==sum) break;
int temp=factorial(i);
if(x>=sum+temp) {ans[ptr++]=temp;sum+=temp;};
};
for(int i=ptr-1;i>=0;i--){
if(i!=ptr-1) cout << ' ' ; cout << ans[i] ;
};
cout << '\n' ;
};
|
a.cc: In function 'int main()':
a.cc:19:11: error: expected '}' at end of input
19 | };
| ^
a.cc:6:11: note: to match this '{'
6 | int main(){
| ^
|
s891843632
|
p00031
|
C++
|
#include <stdio.h>
int main(void)
{
int n;
while (scanf("%d", &n) != EOF){
int i;
if ((n & 1) != 0) {
printf("1");
}
for (i = 1; i < 20; i++)
{
if (((n >> i) & 1) != 0
printf(" %d", 2 << i);
}
}
puts("");
}
|
a.cc: In function 'int main()':
a.cc:13:24: error: expected ';' before 'printf'
13 | if (((n >> i) & 1) != 0
| ^
| ;
14 | printf(" %d", 2 << i);
| ~~~~~~
a.cc:15:1: error: expected primary-expression before '}' token
15 | }
| ^
a.cc:14:23: error: expected ')' before '}' token
14 | printf(" %d", 2 << i);
| ^
| )
15 | }
| ~
a.cc:13:4: note: to match this '('
13 | if (((n >> i) & 1) != 0
| ^
a.cc:15:1: error: expected primary-expression before '}' token
15 | }
| ^
|
s327390563
|
p00031
|
C++
|
#include <stdio.h>
int main(void)
{
int n;
while (scanf("%d", &n) != EOF){
int i;
if ((n & 1) != 0) {
printf("1");
}
for (i = 1; i < 20; i++)
{
if (((n >> i) & 1) != 0){
printf(" %d", 2 << i);
}
}
puts("");
}
|
a.cc: In function 'int main()':
a.cc:18:2: error: expected '}' at end of input
18 | }
| ^
a.cc:4:1: note: to match this '{'
4 | {
| ^
|
s585119470
|
p00031
|
C++
|
#include <iostream>
#include <math.h>
using namespace std;
int main(){
int n;
while(cin >> n;){
int weight[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
for(int i = 9; i >= 0; i--){
if(n >= pow(2, i)){
n -= pow(2, i);
weight[i] = 1;
}
}
cout << "1";
for(int i = 1; i < 10; i++){
if(weight[i]){
cout << " " << pow(2, i);
}
}
cout << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:23: error: expected ')' before ';' token
7 | while(cin >> n;){
| ~ ^
| )
a.cc:7:24: error: expected primary-expression before ')' token
7 | while(cin >> n;){
| ^
|
s705163637
|
p00031
|
C++
|
#include<iostream>
using namesapce std;
int main(){
int n,bell,heavy[1000]={0};
while(cin >> n){
bell=0;
if(n>=512){
n-=512;
heavy[512]++;
}
if(n>=256){
n-=256;
heavy[256]++;
}
if(n>=128){
n-=128;
heavy[128]++;
}
if(n>=64){
n-=64;
heavy[64]++;
}
if(n>=32){
n-=32;
heavy[32]++;
}
if(n>=16){
n-=16;
heavy[16]++;
}
if(n>=8){
n-=8;
heavy[8]++;
}
if(n>=4){
n-=4;
heavy[4]++;
}
if(n>=2){
n-=2;
heavy[2]++;
}
if(n>=1){
n-=1;
heavy[1]++;
}
for(int i=512;i!=0;i/=2){
if(heavy[i]!=0){
if(bell==0){
cout << i << endl;
}
else{
cout << " " << i;
}
}
}
cout << endl;
}
return (0);
}
|
a.cc:2:7: error: expected nested-name-specifier before 'namesapce'
2 | using namesapce std;
| ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | while(cin >> n){
| ^~~
| 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:50:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
50 | cout << 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:50:24: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
50 | cout << 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)
| ^~~~
a.cc:53:11: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
53 | cout << " " << i;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:57:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
57 | cout << 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:57:13: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
57 | cout << endl;
| ^~~~
| std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s608563658
|
p00031
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
int main()
{
const int weight[] = {1,2,4,8,16,32,64,128,256,512};
std::vector<int> answer;
int n;
while(std::cin >> n)
{
for(size_t i=0; i<10; ++i)
{
if(n/weight[9-i])
{
answer.push_back(weight[9-i]);
n = n%weight[9-i];
}
}
for(size_t i=0; i<answer.size()-1; ++i)
{
std::cout << answer[answer.size()-1-i] << ' ';
}
std::cout << answer[0] << '\n';
answer.clear();
}
}
Compile Error Logs:
Status
Judge: 1/1 C++ CPU: 00.00 sec Memory: 1212 [KB] Length: 476 [B] 2012-08-29 02:02 2012-08-29 02:02
Results for testcases
Case #1: : Accepted - - - NA - NA
< | 1 / 1 | > : Accepted - -
Input #1 ( ) Output #1 ( )
Not available.
Not available.
Comments
Under Construction.
Categories
Free Tags
|
a.cc:40:94: error: invalid digit "8" in octal constant
40 | Judge: 1/1 C++ CPU: 00.00 sec Memory: 1212 [KB] Length: 476 [B] 2012-08-29 02:02 2012-08-29 02:02
| ^~
a.cc:40:118: error: invalid digit "8" in octal constant
40 | Judge: 1/1 C++ CPU: 00.00 sec Memory: 1212 [KB] Length: 476 [B] 2012-08-29 02:02 2012-08-29 02:02
| ^~
a.cc:43:6: error: stray '#' in program
43 | Case #1: : Accepted - - - NA - NA
| ^
a.cc:46:7: error: stray '#' in program
46 | Input #1 ( ) Output #1 ( )
| ^
a.cc:46:32: error: stray '#' in program
46 | Input #1 ( ) Output #1 ( )
| ^
a.cc:37:1: error: 'Compile' does not name a type
37 | Compile Error Logs:
| ^~~~~~~
|
s962875302
|
p00031
|
C++
|
#include<iostream>
using namespace std;
int main(void)
{
int x;
while(cin>>x)
{
int a[10]={1,2,4,8,16,32,64,128,256,512};
int b[10]={0};
int j=0;
for(int i=9;i>=0;i--)
{
if(x>=a[i])
{
x-=a[i];
b[j]=a[i];
j++;
if(x==0)break;
}
}
for(int i=9;i>=0;i--)
{
(b[i]!=0)cout<<b[i]<<(i==0?"\n":" ");
}
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:24:10: error: expected ';' before 'cout'
24 | (b[i]!=0)cout<<b[i]<<(i==0?"\n":" ");
| ^~~~
| ;
|
s957871486
|
p00032
|
Java
|
import java.util.*;
public class AOJ0032 {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
String s="";
String[] a=new String[3];
int[] b=new int[3];
int ch=0,hi=0;
while(true){
s=sc.nextLine();
if(s==null){
break;
}
a=s.split(",");
for(int i=0;i<3;i++){
b[i]=Integer.parseInt(a[i]);
}
if(b[0]*b[0]-b[1]*b[1]-b[2]*b[2]==0){
ch++;
}else if(b[0]==b[1]){
hi++;
}
}
System.out.println(ch+" "+hi);
}
}
|
Main.java:3: error: class AOJ0032 is public, should be declared in a file named AOJ0032.java
public class AOJ0032 {
^
1 error
|
s021749651
|
p00032
|
Java
|
import java.io.*;
class Main{
public static void main(String[] args) throws IOExceptiion{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int rec=0;
int loz=0;
String line;
while((line=br.readLine())!=null){
String[] value=line.split(",");
int s1=Integer.parseInt(value[0]);
int s2=Integer.parseInt(value[1]);
int d=Integer.parseInt(value[2]);
if(d==(int)Math.hypot(s1,s2)){
rec++;
}
if(s1==s2){
loz++;
}
}
System.out.println(rec);
System.out.println(loz);
}
}
|
Main.java:4: error: cannot find symbol
public static void main(String[] args) throws IOExceptiion{
^
symbol: class IOExceptiion
location: class Main
1 error
|
s446147365
|
p00032
|
Java
|
import java.util.Scanner;
public class Exercises1 {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
int Rhombus = 0;
int Rectangle = 0;
while(scan.hasNext()){
String text = scan.next();
String[] num = text.split(",", 0);
int a = Integer.parseInt(num[0]);
int b = Integer.parseInt(num[1]);
int c = Integer.parseInt(num[2]);
if(a*a + b*b == c*c){
Rectangle++;
}else if(a == b){
Rhombus++;
}
}
System.out.println(Rectangle);
System.out.println(Rhombus);
}
}
|
Main.java:2: error: class Exercises1 is public, should be declared in a file named Exercises1.java
public class Exercises1 {
^
1 error
|
s795399288
|
p00032
|
Java
|
import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args){
while(scan.hasNext()){
int r = 0;
int d = 0;
int a = scan.nextInt();
int b = scan.nextInt();
int c = scan.nextInt();
if(Math.pow(c, 2) == Math.hypot((double) a, (double) b)){
r++;
}
if(a == b && Math.pow(a, 2) == Math.hypot((double) c / 2, (double) c / 2)){
d++;
}
}
System.out.printf("%d\n", r);
System.out.printf("%d\n", d);
}
}
|
Main.java:22: error: cannot find symbol
System.out.printf("%d\n", r);
^
symbol: variable r
location: class Main
Main.java:23: error: cannot find symbol
System.out.printf("%d\n", d);
^
symbol: variable d
location: class Main
2 errors
|
s631561865
|
p00032
|
Java
|
import java.util.Scanner;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int rectangular = 0;
int dimond = 0;
while(sc.hasNext()) {
String[] numbers = sc.nextLine().split(",");
int a = Integer.parseInt(numbers[0]);
int b = Integer.parseInt(numbers[1]);
int c = Integer.parseInt(numbers[2]);
if(a * a + b * b == c * c) {
rectangular++;
} else if(a == b) {
dimond++;
}
}
System.out.println(rectangular);
System.out.println(dimond);
}
|
Main.java:27: error: reached end of file while parsing
}
^
1 error
|
s403504082
|
p00032
|
Java
|
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class AOJ_0032
{
public static void main(String[] args) throws IOException
{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
int rectanglesCount = 0;
int lozengesCount = 0;
while (input.ready())
{
String[] INPUT_STR = input.readLine().split(",");
int a = Integer.valueOf(INPUT_STR[0]);
int b = Integer.valueOf(INPUT_STR[1]);
int c = Integer.valueOf(INPUT_STR[2]);
if (isLozenges(a, b, c))
{
lozengesCount++;
}
else if (isRectangle(a, b, c))
{
rectanglesCount++;
}
}
System.out.println(rectanglesCount);
System.out.println(lozengesCount);
}
private static boolean isRectangle(int a, int b, int c)
{
if (a != b && Math.pow(a, 2) + Math.pow(b, 2) == Math.pow(c, 2))
{
return true;
}
return false;
}
private static boolean isLozenges(int a, int b, int c)
{
if (a == b)
{
return true;
}
return false;
}
}
|
Main.java:5: error: class AOJ_0032 is public, should be declared in a file named AOJ_0032.java
public class AOJ_0032
^
1 error
|
s657281518
|
p00032
|
Java
|
import java.io.*;import java.util.*;class Main{public static void main(String[]a)throws Exception{int i,h,x=0,y=0,t[]=new int[3];Set<Integer> H=new HashSet<Integer>();BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;(s=B.readLine())!=null;){a=s.split(",");for(i=0;i<3;)t[i]=Integer.valueOf(_[i++]);Arrays.sort(t);h=Arrays.hashCode(t);if(!H.contains(h)&&t[0]==t[1])y++;if(!H.contains(h)&&t[0]*t[0]+t[1]*t[1]==t[2]*t[2])x++;if(!H.add(h))H.remove(h);}System.out.println(x+"\n"+y);}}
|
Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier
import java.io.*;import java.util.*;class Main{public static void main(String[]a)throws Exception{int i,h,x=0,y=0,t[]=new int[3];Set<Integer> H=new HashSet<Integer>();BufferedReader B=new BufferedReader(new InputStreamReader(System.in));for(String s;(s=B.readLine())!=null;){a=s.split(",");for(i=0;i<3;)t[i]=Integer.valueOf(_[i++]);Arrays.sort(t);h=Arrays.hashCode(t);if(!H.contains(h)&&t[0]==t[1])y++;if(!H.contains(h)&&t[0]*t[0]+t[1]*t[1]==t[2]*t[2])x++;if(!H.add(h))H.remove(h);}System.out.println(x+"\n"+y);}}
^
1 error
|
s227433681
|
p00032
|
Java
|
import java.util.Scanner;
public class main{
public static void main(String[] args) {
// TODO 自動生成されたメソッド・ス
Scanner sc = new Scanner(System.in);
int tyou=0;
int hishi=0;
int c1 = 0;
int c2 = 0;
while(sc.hasNext()){
String[] s=sc.nextLine().split(",");
int a=Integer.parseInt(s[0]);
int b=Integer.parseInt(s[1]);
int c=Integer.parseInt(s[2]);
c1=a*a+b*b;
c2=c*c;
if(c1==c2){
tyou++;
}else if(a==b){
hishi++;
}
}
System.out.println(tyou);
System.out.println(hishi);
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main{
^
1 error
|
s284849317
|
p00032
|
Java
|
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
judgeSquare();
}
private static void judgeSquare() {
int lect = 0;
int diamond = 0;
while (sc.hasNext()) {
String[] str = sc.nextLine().split(",");
int a = Integer.parseInt(str[0]);
int b = Integer.parseInt(str[1]);
int c = Integer.parseInt(str[2]);
if ( c * c == a * a + b * b ) {
lect++;
} else if ( a == b ) {
diamond++;
}
}
System.out.println(lect);
System.out.println(diamond);
}
}
|
Main.java:3: error: cannot find symbol
static Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
Main.java:3: error: cannot find symbol
static Scanner sc = new Scanner(System.in);
^
symbol: class Scanner
location: class Main
2 errors
|
s885887209
|
p00032
|
Java
|
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int rec=0,rho=0;
int a,b,d;
String str;
try{
while((str=br.readLine())!=null){
str=br.readLine();
String[] s=str.split(",");
a=Integer.parseInt(s[0]);
b=Integer.parseInt(s[1]);
d=Integer.parseInt(s[2]);
if(a*a+b*b==d*d) rec++;
else if(a==b) rho++;
}
System.out.println(rec+"\n"+rho);
}catch(Exception e){
}
}
|
Main.java:21: error: reached end of file while parsing
}
^
1 error
|
s594222231
|
p00032
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
static int N, D, money;
static int[] prices;
private static int solve(){
int answer = 0;
if (prices[0] * 2 > money) return 0;
if (prices[prices.length - 1] + prices[prices.length - 2] <= money) return prices[prices.length - 1] + prices[prices.length - 2];
for (int i = 0; i < N - 1; i++)
{
int index = Arrays.binarySearch(prices, i + 1, prices.length - i - 1, money - prices[i]);
if (index > i) return prices[i] + prices[index];
index = ~index - 1;
if (index == i) continue;
answer = Math.max(prices[i] + prices[index], answer);
}
return answer;
}
public static void main(String args[]){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strs = br.readLine().split(",");
N = Integer.parseInt(strs[0]); D = Integer.parseInt(strs[1]);
prices = new int[N];
for (int i = 0; i < N; i++)
prices[i] = Integer.parseInt(br.readLine());
Arrays.sort(prices);
for (int i = 0; i < D; i++)
{
money = Integer.parseInt(br.readLine());
System.out.println(solve());
}
}
}
|
Main.java:24: error: unreported exception IOException; must be caught or declared to be thrown
String[] strs = br.readLine().split(",");
^
Main.java:28: error: unreported exception IOException; must be caught or declared to be thrown
prices[i] = Integer.parseInt(br.readLine());
^
Main.java:32: error: unreported exception IOException; must be caught or declared to be thrown
money = Integer.parseInt(br.readLine());
^
3 errors
|
s700687282
|
p00032
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
static int N, D, money;
static int[] prices;
private static int solve(){
int answer = 0;
if (prices[0] * 2 > money) return 0;
if (prices[prices.length - 1] + prices[prices.length - 2] <= money) return prices[prices.length - 1] + prices[prices.length - 2];
for (int i = 0; i < N - 1; i++)
{
int index = Arrays.binarySearch(prices, i + 1, prices.length - i - 1, money - prices[i]);
if (index > i) return prices[i] + prices[index];
index = ~index - 1;
if (index == i) continue;
answer = Math.max(prices[i] + prices[index], answer);
}
return answer;
}
public static void main(String args[]){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strs = br.readLine().split(",");
N = Integer.parseInt(strs[0]); D = Integer.parseInt(strs[1]);
prices = new int[N];
for (int i = 0; i < N; i++)
prices[i] = Integer.parseInt(br.readLine());
Arrays.sort(prices);
for (int i = 0; i < D; i++)
{
money = Integer.parseInt(br.readLine());
System.out.println(solve());
}
} catch{}
}
}
|
Main.java:36: error: '(' expected
} catch{}
^
1 error
|
s319127689
|
p00032
|
Java
|
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
public class Main{
static int N, D, money;
static int[] prices;
private static int solve(){
int answer = 0;
if (prices[0] * 2 > money) return 0;
if (prices[prices.length - 1] + prices[prices.length - 2] <= money) return prices[prices.length - 1] + prices[prices.length - 2];
for (int i = 0; i < N - 1; i++)
{
int index = Arrays.binarySearch(prices, i + 1, prices.length - i - 1, money - prices[i]);
if (index > i) return prices[i] + prices[index];
index = ~index - 1;
if (index == i) continue;
answer = Math.max(prices[i] + prices[index], answer);
}
return answer;
}
public static void main(String args[]){
try{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] strs = br.readLine().split(",");
N = Integer.parseInt(strs[0]); D = Integer.parseInt(strs[1]);
prices = new int[N];
for (int i = 0; i < N; i++)
prices[i] = Integer.parseInt(br.readLine());
Arrays.sort(prices);
for (int i = 0; i < D; i++)
{
money = Integer.parseInt(br.readLine());
System.out.println(solve());
}
} catch(){}
}
}
|
Main.java:36: error: illegal start of type
} catch(){}
^
1 error
|
s219691552
|
p00032
|
C
|
#include<stdio.h>
#include<conio.h>
int main (void ){
int a,b,c,p=0,q=0;
while(scanf("%d,",&a)!=EOF){
scanf("%d,%d",&b,&c);
if(a+b+c == 12){
p++;
}
else if(a == b){
q++;
}
}
printf("%d\n%d\n",p,q);
return 0;
}
|
main.c:2:9: fatal error: conio.h: No such file or directory
2 | #include<conio.h>
| ^~~~~~~~~
compilation terminated.
|
s484117753
|
p00032
|
C
|
#include<stdio.h>
int main(void)
{
int hen1 = 0, hen2 = 0, x = 0;
int ccount = 0 , hcount = 0;
while(scanf("%d,%d,%d",&hen1, &hen2, &x) != EOF)
{
if(x >= hen1 && x >= hen2)
{
else if(hen1 == hen2)
{
hcount++;
}
else
{
ccount++;
}
}
}
printf("%d\n",ccount);
printf("%d\n",hcount);
return 0;
}
|
main.c: In function 'main':
main.c:14:25: error: expected '}' before 'else'
14 | else if(hen1 == hen2)
| ^~~~
main.c: At top level:
main.c:24:16: error: expected declaration specifiers or '...' before string constant
24 | printf("%d\n",ccount);
| ^~~~~~
main.c:24:23: error: unknown type name 'ccount'
24 | printf("%d\n",ccount);
| ^~~~~~
main.c:25:16: error: expected declaration specifiers or '...' before string constant
25 | printf("%d\n",hcount);
| ^~~~~~
main.c:25:23: error: unknown type name 'hcount'
25 | printf("%d\n",hcount);
| ^~~~~~
main.c:26:9: error: expected identifier or '(' before 'return'
26 | return 0;
| ^~~~~~
main.c:27:1: error: expected identifier or '(' before '}' token
27 | }
| ^
|
s142453838
|
p00032
|
C
|
#include<stdio.h>
int main(){
int h1,h2,tai,tcnt,hcnt;
tcnt =0;
hcnt=0;
while(scanf("%d,%d,%d",&h1,&h2,&tai)!=EOF){
if(hi*hi+h2*h2=tai){tcnt=tcnt+1;}
else if(h1==h2){hcnt=hcnt+1;}
printf("%d\n%d\n ",tcnt,hcnt);
}
return 0;
}
|
main.c: In function 'main':
main.c:11:6: error: 'hi' undeclared (first use in this function); did you mean 'h2'?
11 | if(hi*hi+h2*h2=tai){tcnt=tcnt+1;}
| ^~
| h2
main.c:11:6: note: each undeclared identifier is reported only once for each function it appears in
|
s570590677
|
p00032
|
C
|
#include<stdio.h>
int main(){
int h1,h2,tai,tcnt,hcnt;
tcnt =0;
hcnt=0;
while(scanf("%d,%d,%d",&h1,&h2,&tai)!=EOF){
if(h1*h1+h2*h2=tai){tcnt=tcnt+1;}
else if(h1==h2){hcnt=hcnt+1;}
printf("%d\n%d\n ",tcnt,hcnt);
}
return 0;
}
|
main.c: In function 'main':
main.c:11:17: error: lvalue required as left operand of assignment
11 | if(h1*h1+h2*h2=tai){tcnt=tcnt+1;}
| ^
|
s465614103
|
p00032
|
C
|
#include<stdio.h>
int main(){
int a,b,c,m=0,n=0;
while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
if(a-b==0)
m++;
if(a*a+b*b-c*c==0)
n++;
}
printf("%d\n%d\n",n.m);
return 0;
}
|
main.c: In function 'main':
main.c:10:20: error: request for member 'm' in something not a structure or union
10 | printf("%d\n%d\n",n.m);
| ^
|
s571005249
|
p00032
|
C
|
#include<stdio.h>
main(){
int a[3],tyo=0,hi=0,i,j,temp;
while(scanf("%d,%d,%d",&a[0],&a[1],&a[2])!=EOF){
*/
if(a[0]!=a[1] && a[0]*a[0]+a[1]*a[1]==a[2]*a[2])
tyo++;
if(a[0]==a[1])
hi++;
printf("%d ",tyo);
}
printf("%d\n%d\n",tyo,hi);
return 0;
}
|
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:6: error: expected expression before '/' token
6 | */
| ^
|
s911238955
|
p00032
|
C
|
int main(void){
int hen1,hen2,taikaku,tyouhou=0,hisigata=0;
while(scanf("%d,%d,%d",&hen1,&hen2,&taikaku) != EOF){
if(sqrt(hen1*hen1 + hen2*hen2) == taikaku && hen1 == hen2){
// 正方形
}else if(sqrt(hen1*hen1 + hen2*hen2) == taikaku){
// 長方形
tyouhou++;
}else if(hen1 == hen2){
hisigata++;
}
}
printf("%d\n%d\n",tyouhou,hisigata);
}
|
main.c: In function 'main':
main.c:4:15: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
4 | while(scanf("%d,%d,%d",&hen1,&hen2,&taikaku) != EOF){
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | int main(void){
main.c:4:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
4 | while(scanf("%d,%d,%d",&hen1,&hen2,&taikaku) != EOF){
| ^~~~~
main.c:4:15: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:4:57: error: 'EOF' undeclared (first use in this function)
4 | while(scanf("%d,%d,%d",&hen1,&hen2,&taikaku) != EOF){
| ^~~
main.c:4:57: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>'
main.c:4:57: note: each undeclared identifier is reported only once for each function it appears in
main.c:5:20: error: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
5 | if(sqrt(hen1*hen1 + hen2*hen2) == taikaku && hen1 == hen2){
| ^~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt'
+++ |+#include <math.h>
1 | int main(void){
main.c:5:20: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch]
5 | if(sqrt(hen1*hen1 + hen2*hen2) == taikaku && hen1 == hen2){
| ^~~~
main.c:5:20: note: include '<math.h>' or provide a declaration of 'sqrt'
main.c:14:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
14 | printf("%d\n%d\n",tyouhou,hisigata);
| ^~~~~~
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:9: note: include '<stdio.h>' or provide a declaration of 'printf'
|
s388024616
|
p00032
|
C
|
#include <stdio.h>
int main(){
int a,b,c,n1,n2;
n1=0;
n2=0;
while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
if(c*c=a*a+b*b)
n1++;
if(a==b)
n2++;
}
printf("%d\n%d\n",n1,n2);
}
return 0;
}
|
main.c: In function 'main':
main.c:9:13: error: lvalue required as left operand of assignment
9 | if(c*c=a*a+b*b)
| ^
main.c: At top level:
main.c:16:4: error: expected identifier or '(' before 'return'
16 | return 0;
| ^~~~~~
main.c:17:1: error: expected identifier or '(' before '}' token
17 | }
| ^
|
s324525074
|
p00032
|
C
|
#include <stdio.h>
int main(){
int a,b,c,n1,n2;
n1=0;
n2=0;
while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
if(c*c=a*a+b*b)
n1++;
if(a==b)
n2++;
}
printf("%d\n%d\n",n1,n2);
return 0;
}
|
main.c: In function 'main':
main.c:9:13: error: lvalue required as left operand of assignment
9 | if(c*c=a*a+b*b)
| ^
|
s432192086
|
p00032
|
C
|
#include <stdio.h>
#include <math.h>
#define SQ(x) ((x) * (x))
int main(void)
{
int x[3];
int rect, dia;
rect = 0;
dia = 0;
while (scanf("%d,%d,%d", &x[0], &x[1], &x[2]) != EOF){
if (SQ(x[0]) == SQ(x[1]) + SQ(x[2])){
rect++;
}
else if (SQ[1] == SQ2[2]){
dia++;
}
}
printf("%d\n%d\n", rect, dia);
return (0);
}
|
main.c: In function 'main':
main.c:19:26: error: 'SQ' undeclared (first use in this function)
19 | else if (SQ[1] == SQ2[2]){
| ^~
main.c:19:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:35: error: 'SQ2' undeclared (first use in this function); did you mean 'SQ'?
19 | else if (SQ[1] == SQ2[2]){
| ^~~
| SQ
|
s537585696
|
p00032
|
C++
|
#include <iostream>
using namespace std;
int main(void){
// Your code here!
int a, b; //隣り合う辺の長さ
int c; //対角線の長さ
int rectangular = 0, rhombus = 0; //長方形と菱形の個数
while(cin.fail()){
cin >> a >> b >> c;
if(a != b && a + b >= c && a * a + b * b == c * c) rectangular++;
else if(a == b && a + b >= c) rhombus++;
}
cout << rectangular << endl;
cout << rhombus << endl;
}
|
a.cc:6:11: error: extended character is not valid in an identifier
6 | int c; //対角線の長さ
| ^
a.cc:6:11: error: extended character is not valid in an identifier
a.cc: In function 'int main()':
a.cc:6:11: error: '\U00003000\U00003000' was not declared in this scope
6 | int c; //対角線の長さ
| ^~~~
a.cc:11:60: error: 'rectangular' was not declared in this scope
11 | if(a != b && a + b >= c && a * a + b * b == c * c) rectangular++;
| ^~~~~~~~~~~
a.cc:12:39: error: 'rhombus' was not declared in this scope
12 | else if(a == b && a + b >= c) rhombus++;
| ^~~~~~~
a.cc:14:13: error: 'rectangular' was not declared in this scope
14 | cout << rectangular << endl;
| ^~~~~~~~~~~
a.cc:15:13: error: 'rhombus' was not declared in this scope
15 | cout << rhombus << endl;
| ^~~~~~~
|
s181019752
|
p00032
|
C++
|
p (r=$<.map{|l|a,b,c=l.split/,/.map{|i|i.to_i**2};a+b!=c&&a-b}).count(!0),r.count(0)
|
a.cc:1:3: error: expected constructor, destructor, or type conversion before '(' token
1 | p (r=$<.map{|l|a,b,c=l.split/,/.map{|i|i.to_i**2};a+b!=c&&a-b}).count(!0),r.count(0)
| ^
a.cc:1:63: error: expected unqualified-id before ')' token
1 | p (r=$<.map{|l|a,b,c=l.split/,/.map{|i|i.to_i**2};a+b!=c&&a-b}).count(!0),r.count(0)
| ^
|
s900471753
|
p00032
|
C++
|
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
using namespace std;
#define TYO 0
#define HIS 1
int main(){
int in1, in2, in3;
int ans[2] = {};
while (scanf("%d,%d,%d", &in1, &in2, &in3) != EOF){
// 長方形check
if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
ans[TYO]++;
}
else if (in1 == in2){
ans[HIS]++;
}
}
for (int i = 0; i < 2; i++){
cout << ans[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:21: error: 'pow' was not declared in this scope
19 | if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
| ^~~
|
s837449558
|
p00032
|
C++
|
// #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <string>
using namespace std;
#define TYO 0
#define HIS 1
int main(){
int in1, in2, in3;
int ans[2] = {};
while (scanf("%d,%d,%d", &in1, &in2, &in3) != EOF){
// 長方形check
if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
ans[TYO]++;
}
else if (in1 == in2){
ans[HIS]++;
}
}
for (int i = 0; i < 2; i++){
cout << ans[i] << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:19:21: error: 'pow' was not declared in this scope
19 | if (pow(in1, 2) + pow(in2, 2) == pow(in3, 2)){
| ^~~
|
s861176526
|
p00032
|
C++
|
#include <iostream>
using namespace std;
  
int main(){
    int c = 0, h = 0;
    int s1, s2, t;
    char a, b;
    while(cin >> s1 >> a >> s2 >> b >> t)
   {
        if(((s1 * s1) + (s2 * s2)) == t * t) c++;
        if(s1 == s2) h++;
    }
    cout << c << endl;
    cout << h << endl;
    return 0;
}
|
a.cc:3:2: error: stray '#' in program
3 |   
| ^
a.cc:3:8: error: stray '#' in program
3 |   
| ^
a.cc:5:2: error: stray '#' in program
5 |     int c = 0, h = 0;
| ^
a.cc:5:8: error: stray '#' in program
5 |     int c = 0, h = 0;
| ^
a.cc:5:14: error: stray '#' in program
5 |     int c = 0, h = 0;
| ^
a.cc:5:20: error: stray '#' in program
5 |     int c = 0, h = 0;
| ^
a.cc:6:2: error: stray '#' in program
6 |     int s1, s2, t;
| ^
a.cc:6:8: error: stray '#' in program
6 |     int s1, s2, t;
| ^
a.cc:6:14: error: stray '#' in program
6 |     int s1, s2, t;
| ^
a.cc:6:20: error: stray '#' in program
6 |     int s1, s2, t;
| ^
a.cc:7:2: error: stray '#' in program
7 |     char a, b;
| ^
a.cc:7:8: error: stray '#' in program
7 |     char a, b;
| ^
a.cc:7:14: error: stray '#' in program
7 |     char a, b;
| ^
a.cc:7:20: error: stray '#' in program
7 |     char a, b;
| ^
a.cc:8:2: error: stray '#' in program
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^
a.cc:8:8: error: stray '#' in program
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^
a.cc:8:14: error: stray '#' in program
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^
a.cc:8:20: error: stray '#' in program
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^
a.cc:9:2: error: stray '#' in program
9 |    {
| ^
a.cc:9:8: error: stray '#' in program
9 |    {
| ^
a.cc:9:14: error: stray '#' in program
9 |    {
| ^
a.cc:10:2: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:8: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:14: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:20: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:26: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:32: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:38: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:10:44: error: stray '#' in program
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^
a.cc:11:2: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:8: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:14: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:20: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:26: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:32: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:38: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:11:44: error: stray '#' in program
11 |         if(s1 == s2) h++;
| ^
a.cc:12:2: error: stray '#' in program
12 |     }
| ^
a.cc:12:8: error: stray '#' in program
12 |     }
| ^
a.cc:12:14: error: stray '#' in program
12 |     }
| ^
a.cc:12:20: error: stray '#' in program
12 |     }
| ^
a.cc:13:2: error: stray '#' in program
13 |     cout << c << endl;
| ^
a.cc:13:8: error: stray '#' in program
13 |     cout << c << endl;
| ^
a.cc:13:14: error: stray '#' in program
13 |     cout << c << endl;
| ^
a.cc:13:20: error: stray '#' in program
13 |     cout << c << endl;
| ^
a.cc:14:2: error: stray '#' in program
14 |     cout << h << endl;
| ^
a.cc:14:8: error: stray '#' in program
14 |     cout << h << endl;
| ^
a.cc:14:14: error: stray '#' in program
14 |     cout << h << endl;
| ^
a.cc:14:20: error: stray '#' in program
14 |     cout << h << endl;
| ^
a.cc:15:2: error: stray '#' in program
15 |     return 0;
| ^
a.cc:15:8: error: stray '#' in program
15 |     return 0;
| ^
a.cc:15:14: error: stray '#' in program
15 |     return 0;
| ^
a.cc:15:20: error: stray '#' in program
15 |     return 0;
| ^
a.cc:3:3: error: expected unqualified-id before numeric constant
3 |   
| ^~~
a.cc:3:9: error: expected unqualified-id before numeric constant
3 |   
| ^~~
a.cc: In function 'int main()':
a.cc:5:3: error: lvalue required as unary '&' operand
5 |     int c = 0, h = 0;
| ^~~
a.cc:5:9: error: lvalue required as unary '&' operand
5 |     int c = 0, h = 0;
| ^~~
a.cc:5:15: error: lvalue required as unary '&' operand
5 |     int c = 0, h = 0;
| ^~~
a.cc:5:21: error: lvalue required as unary '&' operand
5 |     int c = 0, h = 0;
| ^~~
a.cc:6:3: error: lvalue required as unary '&' operand
6 |     int s1, s2, t;
| ^~~
a.cc:6:9: error: lvalue required as unary '&' operand
6 |     int s1, s2, t;
| ^~~
a.cc:6:15: error: lvalue required as unary '&' operand
6 |     int s1, s2, t;
| ^~~
a.cc:6:21: error: lvalue required as unary '&' operand
6 |     int s1, s2, t;
| ^~~
a.cc:7:3: error: lvalue required as unary '&' operand
7 |     char a, b;
| ^~~
a.cc:7:9: error: lvalue required as unary '&' operand
7 |     char a, b;
| ^~~
a.cc:7:15: error: lvalue required as unary '&' operand
7 |     char a, b;
| ^~~
a.cc:7:21: error: lvalue required as unary '&' operand
7 |     char a, b;
| ^~~
a.cc:8:3: error: lvalue required as unary '&' operand
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^~~
a.cc:8:9: error: lvalue required as unary '&' operand
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^~~
a.cc:8:15: error: lvalue required as unary '&' operand
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^~~
a.cc:8:21: error: lvalue required as unary '&' operand
8 |     while(cin >> s1 >> a >> s2 >> b >> t)
| ^~~
a.cc:9:3: error: lvalue required as unary '&' operand
9 |    {
| ^~~
a.cc:9:9: error: lvalue required as unary '&' operand
9 |    {
| ^~~
a.cc:9:15: error: lvalue required as unary '&' operand
9 |    {
| ^~~
a.cc:10:3: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:9: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:15: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:21: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:27: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:33: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
| ^~~
a.cc:10:39: error: lvalue required as unary '&' operand
10 |         if(((s1 * s1) + (s2 * s2)) == t * t) c++;
|
s945420690
|
p00032
|
C++
|
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main(void) {
string s;
int rect = 0, rhom = 0;
while (cin >> s) {
replace(s.begin(), s.end(), ',', ' ');
stringstream ss(s);
int x, y, z;
ss >> x >> y >> z;
if (x == y || y == z || z == x) rhom++;
else if (x*x + y*y == z*z) rect++;
}
cout << rect << endl;
cout << rhom << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: 'replace' was not declared in this scope
10 | replace(s.begin(), s.end(), ',', ' ');
| ^~~~~~~
|
s259269893
|
p00032
|
C++
|
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main(void) {
string s;
int rect = 0, rhom = 0;
while (cin >> s) {
replace(s.begin(), s.end(), ',', ' ');
stringstream ss(s);
int x, y, z;
ss >> x >> y >> z;
if (x == y || y == z || z == x) rhom++;
else if (x*x + y*y == z*z) rect++;
}
cout << rect << endl;
cout << rhom << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:9: error: 'replace' was not declared in this scope
10 | replace(s.begin(), s.end(), ',', ' ');
| ^~~~~~~
|
s255236959
|
p00032
|
C++
|
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
int a[3],ans[2];
char com;
ans[0]=0;ans[1]=0;
while(cin>>a[0]>>com>>a[1]>>com>>a[2]){
if(a[2]*a[2]==a[0]*a[0]+a[1]*a[1])ans[0]++;
if(a[0]==a[1])ans[1]++;
}
cout<<ans[0]<<endl<<ans[1]<<endl;
return 0;
|
a.cc: In function 'int main()':
a.cc:13:18: error: expected '}' at end of input
13 | return 0;
| ^
a.cc:4:15: note: to match this '{'
4 | int main(void){
| ^
|
s417597535
|
p00032
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int N=0,W=0;
while(scanf("%d %d %d",&x,&y,&z)!=EOF){
if(x==y)N++;
else if(x!=y)W++;
}
printf("%d\n,N);printf("%d\n,W);
return 0;
}
|
a.cc:11:27: error: stray '\' in program
11 | printf("%d\n,N);printf("%d\n,W);
| ^
a.cc: In function 'int main()':
a.cc:11:26: error: 'd' was not declared in this scope
11 | printf("%d\n,N);printf("%d\n,W);
| ^
|
s889416729
|
p00032
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int N=0,W=0;
while(scanf("%d,%d,%d,&x,&y,&z)!=EOF){
if(x!=y)N++;
else if(x==y)W++;
}
printf("%d\n%d\n,N,W);
return 0;
}
|
a.cc:6:13: warning: missing terminating " character
6 | while(scanf("%d,%d,%d,&x,&y,&z)!=EOF){
| ^
a.cc:6:13: error: missing terminating " character
6 | while(scanf("%d,%d,%d,&x,&y,&z)!=EOF){
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:10:8: warning: missing terminating " character
10 | printf("%d\n%d\n,N,W);
| ^
a.cc:10:8: error: missing terminating " character
10 | printf("%d\n%d\n,N,W);
| ^~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:7:1: error: expected primary-expression before 'if'
7 | if(x!=y)N++;
| ^~
a.cc:7:12: error: expected ')' before ';' token
7 | if(x!=y)N++;
| ^
| )
a.cc:6:6: note: to match this '('
6 | while(scanf("%d,%d,%d,&x,&y,&z)!=EOF){
| ^
a.cc:8:1: error: 'else' without a previous 'if'
8 | else if(x==y)W++;
| ^~~~
a.cc: At global scope:
a.cc:10:7: error: expected constructor, destructor, or type conversion before '(' token
10 | printf("%d\n%d\n,N,W);
| ^
a.cc:12:1: error: expected declaration before '}' token
12 | }
| ^
|
s398675861
|
p00032
|
C++
|
#include<stdio.h>
int main(){
int x,y,z;
int N=0,W=0;
while(scanf("%d,%d,%d",&x,&y,&z)!=EOF){
if(z*z=x*x+y*y)N++;
else if(x==y)W++;
}
printf("%d\n%d\n",N,W);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:7:5: error: lvalue required as left operand of assignment
7 | if(z*z=x*x+y*y)N++;
| ~^~
|
s902937090
|
p00032
|
C++
|
3,4,5
5,5,8
4,4,4
5,4,3
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3,4,5
| ^
|
s749245314
|
p00032
|
C++
|
include <cstdio>
using namespace std;
int main(){
int a, b, c, ans1=0, ans2=0;
while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
if( a*a + b*b == c*c ) ans1++;
else if( a == b ) ans2++;
}
printf("%d\n%d\n", ans1, ans2);
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <cstdio>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:16: error: 'scanf' was not declared in this scope
7 | while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
| ^~~~~
a.cc:7:47: error: 'EOF' was not declared in this scope
7 | while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include <cstdio>
a.cc:11:9: error: 'printf' was not declared in this scope
11 | printf("%d\n%d\n", ans1, ans2);
| ^~~~~~
a.cc:11:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s319090979
|
p00032
|
C++
|
include <cstdio>
using namespace std;
int main(){
int a, b, c, ans1=0, ans2=0;
while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
if( a*a + b*b == c*c ) ans1++;
else if( a == b ) ans2++;
}
printf("%d\n%d\n", ans1, ans2);
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include <cstdio>
| ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:16: error: 'scanf' was not declared in this scope
7 | while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
| ^~~~~
a.cc:7:47: error: 'EOF' was not declared in this scope
7 | while( scanf("%d,%d,%d", &a,&b,&c) != EOF ){
| ^~~
a.cc:1:1: note: 'EOF' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
+++ |+#include <cstdio>
1 | include <cstdio>
a.cc:11:9: error: 'printf' was not declared in this scope
11 | printf("%d\n%d\n", ans1, ans2);
| ^~~~~~
a.cc:11:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
|
s491641162
|
p00032
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a, b, c;
int cho=0;
int hi=0;
while(cin >> a >> " " >> b >> " " >> c){
if(a*a + b*b = c*c){
cho = cho + 1;
}
if(a==b){
hi = hi + 1;
}
}
cout << cho << endl;
cout << hi << endl;
}
|
a.cc: In function 'int main()':
a.cc:10:24: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and 'const char [2]')
10 | while(cin >> a >> " " >> b >> " " >> c){
| ~~~~~~~~ ^~ ~~~
| | |
| | const char [2]
| std::basic_istream<char>::__istream_type {aka std::basic_istream<char>}
In file included from /usr/include/c++/14/iostream:42,
from a.cc:1:
/usr/include/c++/14/istream:170:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(bool&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
170 | operator>>(bool& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:170:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: cannot bind non-const lvalue reference of type 'bool&' to a value of type 'const char*'
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
/usr/include/c++/14/istream:174:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(short int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
174 | operator>>(short& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:174:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'short int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(short int)((const char*)" ")' to 'short int&'
/usr/include/c++/14/istream:177:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(short unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
177 | operator>>(unsigned short& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:177:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'short unsigned int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(short unsigned int)((const char*)" ")' to 'short unsigned int&'
/usr/include/c++/14/istream:181:7: note: candidate: 'std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::operator>>(int&) [with _CharT = char; _Traits = std::char_traits<char>]' (near match)
181 | operator>>(int& __n);
| ^~~~~~~~
/usr/include/c++/14/istream:181:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(int)((const char*)" ")' to 'int&'
/usr/include/c++/14/istream:184:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
184 | operator>>(unsigned int& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:184:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(unsigned int)((const char*)" ")' to 'unsigned int&'
/usr/include/c++/14/istream:188:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
188 | operator>>(long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:188:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'long int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(long int)((const char*)" ")' to 'long int&'
/usr/include/c++/14/istream:192:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
192 | operator>>(unsigned long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:192:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(long unsigned int)((const char*)" ")' to 'long unsigned int&'
/usr/include/c++/14/istream:199:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
199 | operator>>(long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:199:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'long long int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(long long int)((const char*)" ")' to 'long long int&'
/usr/include/c++/14/istream:203:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long long unsigned int&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
203 | operator>>(unsigned long long& __n)
| ^~~~~~~~
/usr/include/c++/14/istream:203:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const char*' to 'long long unsigned int' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const char*
a.cc:10:27: error: cannot bind rvalue '(long long unsigned int)((const char*)" ")' to 'long long unsigned int&'
/usr/include/c++/14/istream:328:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(void*&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]' (near match)
328 | operator>>(void*& __p)
| ^~~~~~~~
/usr/include/c++/14/istream:328:7: note: conversion of argument 1 would be ill-formed:
a.cc:10:27: error: invalid conversion from 'const void*' to 'void*' [-fpermissive]
10 | while(cin >> a >> " " >> b >> " " >> c){
| ^~~
| |
| const void*
a.cc:10:27: error: cannot bind rvalue '(void*)((const void*)((const char*)" "))' to 'void*&'
/usr/include/c++/14/istream:219:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(float&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
219 | operator>>(float& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:219:25: note: no known conversion for argument 1 from 'const char [2]' to 'float&'
219 | operator>>(float& __f)
| ~~~~~~~^~~
/usr/include/c++/14/istream:223:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
223 | operator>>(double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:223:26: note: no known conversion for argument 1 from 'const char [2]' to 'double&'
223 | operator>>(double& __f)
| ~~~~~~~~^~~
/usr/include/c++/14/istream:227:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(long double&) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
227 | operator>>(long double& __f)
| ^~~~~~~~
/usr/include/c++/14/istream:227:31: note: no known conversion for argument 1 from 'const char [2]' to 'long double&'
227 | operator>>(long double& __f)
| ~~~~~~~~~~~~~^~~
/usr/include/c++/14/istream:122:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(__istream_type& (*)(__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; __istream_type = std::basic_istream<char>]'
122 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/include/c++/14/istream:122:36: note: no known conversion for argument 1 from 'const
|
s186851574
|
p00032
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a, b, c;
int cho=0;
int hi=0;
while(cin >> a >> b >> c){
if(a*a + b*b = c*c){
cho = cho + 1;
}
if(a==b){
hi = hi + 1;
}
}
cout << cho << endl;
cout << hi << endl;
}
|
a.cc: In function 'int main()':
a.cc:13:24: error: lvalue required as left operand of assignment
13 | if(a*a + b*b = c*c){
| ~~~~^~~~~
|
s507609575
|
p00032
|
C++
|
#include <iostream>
using namespace std;
int main(){
int a, b, c;
int cho=0;
int hi=0;
while(cin >> a >> b >> c){
if(a*a + b*b = c*c){
cho = cho + 1;
}
if(a==b){
hi = hi + 1;
}
}
cout << cho << endl;
cout << hi << endl;
}
|
a.cc: In function 'int main()':
a.cc:13:24: error: lvalue required as left operand of assignment
13 | if(a*a + b*b = c*c){
| ~~~~^~~~~
|
s804832197
|
p00032
|
C++
|
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
int a, b, c;
int r = 0;
int l = 0;
while (scanf_s("%d,%d,%d", &a, &b, &c) != EOF ) {
if (a*a + b*b == c*c) {//??´?§?????§???¢
r++;
}
else if (a == b) {//?????????????§???¢
l++;
}
}
cout << r << endl;
cout << l << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
10 | while (scanf_s("%d,%d,%d", &a, &b, &c) != EOF ) {
| ^~~~~~~
| scanf
|
s804684627
|
p00032
|
C++
|
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int a, b, c;
while(cin >> a >> b >>c){
int rect,rhom;
if(a * a + b * b == c * c) rect++;
else if(a == b) rhom++;
}
cout << rect << "?\n" << rhom << endl;
}
|
a.cc: In function 'int main()':
a.cc:11:17: error: 'rect' was not declared in this scope
11 | cout << rect << "?\n" << rhom << endl;
| ^~~~
a.cc:11:34: error: 'rhom' was not declared in this scope
11 | cout << rect << "?\n" << rhom << endl;
| ^~~~
|
s519533209
|
p00032
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a, b, c, rect, = 0, rhom = 0;
while(cin >> a >> b >> c){
if( a * a + b * b == c * c ) rect++;
else if( a == b ) rhom++;
}
cout << rect << "?\n" << rhom << endl;
}
|
a.cc: In function 'int main()':
a.cc:4:28: error: expected unqualified-id before '=' token
4 | int a, b, c, rect, = 0, rhom = 0;
| ^
a.cc:7:35: error: 'rhom' was not declared in this scope
7 | else if( a == b ) rhom++;
| ^~~~
a.cc:9:34: error: 'rhom' was not declared in this scope
9 | cout << rect << "?\n" << rhom << endl;
| ^~~~
|
s056018001
|
p00032
|
C++
|
#include<iostream>
using namespace std;
int main(){
int a, b, c, rect = 0, rhom = 0;
char d
while(cin >> a >> d >> b >> d >> c){
if( a * a + b * b == c * c ) rect++;
else if( a == b ) rhom++;
}
cout << rect << endl << rhom << endl;
}
|
a.cc: In function 'int main()':
a.cc:6:9: error: expected initializer before 'while'
6 | while(cin >> a >> d >> b >> d >> c){
| ^~~~~
|
s421651630
|
p00032
|
C++
|
#include <bits/stdc++.h>
using namespace std;
/*-------------------------------*/
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (b) - 1; i >= (a); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n) - 1; i >= 0; i--)
#define all(i) (i).begin(),(i).end()
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pint;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef vector<long long> llv;
typedef vector<pint> vpint;
/*-------------------------------*/
int main(void)
{
int a[3];
char b[2];
int rect = 0, rhom = 0;
while (cin >> a[0] >> b[0] >> a[1] >> b[1] >> a[2]){
if (x[0] == x[1]) rhom++;
else if(a[0] * a[0] + a[1] * a[1] == a[2] * a[2]) rect++;
}
cout << rect << "\n" << rhom << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:29:9: error: 'x' was not declared in this scope
29 | if (x[0] == x[1]) rhom++;
| ^
|
s415312325
|
p00032
|
C++
|
#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
int a, b, c;
int co = 0, cp = 0;
while (scanf_s("%d,%d,%d", &a, &b, &c) + 1) {
if ((a*a) + (b*b) == c*c) {
co++;
}
if (a + b > c) {
cp++;
}
}
cout << co << "\n" << cp << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
8 | while (scanf_s("%d,%d,%d", &a, &b, &c) + 1) {
| ^~~~~~~
| scanf
|
s021154628
|
p00032
|
C++
|
import sys
rec=rho=0
for line in sys.stdin:
#while True:
# line=raw_input()
if line=="a":
break
a,b,c=map(int,line.split(","))
if a==b:
rho+=1
elif a*a+b*b==c*c:
rec+=1
print rec
print rho
|
a.cc:4:2: error: invalid preprocessing directive #while
4 | #while True:
| ^~~~~
a.cc:5:13: error: "=" after #line is not a positive integer
5 | # line=raw_input()
| ^
a.cc:1:1: error: 'import' does not name a type
1 | import sys
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
|
s733696030
|
p00032
|
C++
|
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main(){
int a, b, c;
int tyou = 0;
int hishi = 0;
while(scanf("%d %d %d", &a, &b, &c)!=EOF){
if(a==b || a==c || b==c){
if(a+b>c && b+c>a && c+a>b){
hishi++;
}else{
if(a>b){
if(a>c){
if(a*a==b*b+c*c) tyou++;
}else{
if(c*c==a*a+b*b) tyou++;
}
}else{
if(b>c){
if(b*b==a*a+c*c) tyou++;
}else{
if(c*c==a*a+b*b) tyou++;
}
}
}
}
std::cout << tyou << std::endl << hishi << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:34:2: error: expected '}' at end of input
34 | }
| ^
a.cc:5:11: note: to match this '{'
5 | int main(){
| ^
|
s056344716
|
p00032
|
C++
|
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
int main(){
int a, b, c;
int tyou = 0;
int hishi = 0;
while(scanf("%d,%d,%d\n", &a, &b, &c)!=EOF){
if(a==b || a==c || b==c){
if(a+b>c && b+c>a && c+a>b){
hishi++;
}
}
if{
if(a>b){
if(a>c){
if(a*a==b*b+c*c) tyou++;
}else{
if(c*c==a*a+b*b) tyou++;
}
}else{
if(b>c){
if(b*b==a*a+c*c) tyou++;
}else{
if(c*c==a*a+b*b) tyou++;
}
}
}
}
std::cout << tyou << std::endl << hishi << std::endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:16:7: error: expected '(' before '{' token
16 | if{
| ^
| (
|
s108151830
|
p00032
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<vector<int>> n;
int ch = 0;
int hisi = 0;
int i, j,k,l = 0;
while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
vector<int>v;
v.push_back(i);
v.push_back(j);
v.push_back(k);
sort(&v[0], &v[2]);
n.push_back(v);
l++;
}
for (int a = 0; a < l; a++) {
if ((n[a][0] ^ 2 )== ((n[a][1] ^ 2 )+ (n[a][2] ^2))) {
if (!(n[a][0] == n[a][1] == n[a][2])) {
ch++;
}
}
else if ((n[a][0] == (n[a][1] || n[a][2])) || (n[a][1] == n[a][2])) {
if (!(n[a][0] == n[a][1] == n[a][2])) {
hisi++;
}
}
}
cout << ch << "\n" << hisi << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
| ^~~~~~~
| scanf
|
s920775652
|
p00032
|
C++
|
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main()
{
vector<vector<int> > n;
int ch = 0;
int hisi = 0;
int i, j,k,l = 0;
while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
vector<int>v;
v.push_back(i);
v.push_back(j);
v.push_back(k);
sort(&v[0], &v[2]);
n.push_back(v);
l++;
}
for (int a = 0; a < l; a++) {
if ((n[a][0] ^ 2 )== ((n[a][1] ^ 2 )+ (n[a][2] ^2))) {
if (!(n[a][0] == n[a][1] == n[a][2])) {
ch++;
}
}
else if ((n[a][0] == (n[a][1] || n[a][2])) || (n[a][1] == n[a][2])) {
if (!(n[a][0] == n[a][1] == n[a][2])) {
hisi++;
}
}
}
cout << ch << "\n" << hisi << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:12:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
12 | while (scanf_s("%d,%d,%d",&i,&j,&k) != EOF) {
| ^~~~~~~
| scanf
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.