submission_id
stringlengths 10
10
| problem_id
stringlengths 6
6
| language
stringclasses 3
values | code
stringlengths 1
522k
| compiler_output
stringlengths 43
10.2k
|
|---|---|---|---|---|
s063321596
|
p03962
|
C
|
#include<stdio.h>
int main()
{
int n,k,fac1=1,fac2=1,fac3=1,t;
scanf("%d%d",&n,&k);
if(n==k)
printf("%d",n);
else
{
while(k>=1)
{
fac1=fac1*k;
--k;
}
while(n>=1)
{
fac2=fac2*n;
--n;
}
while(k-n>=1)
{
fac3=fac3*(k-n);
--(k-n);
}
printf("%d",fac1/(fac2*fac3));
}
return 0;
}
|
main.c: In function 'main':
main.c:24:9: error: lvalue required as decrement operand
24 | --(k-n);
| ^~
|
s986721073
|
p03962
|
C
|
#include<stdio.h>
int main()
{
int n,k,fac1=1,fac2=1,fac3=1;
scanf("%d%d",&n,&k);
if(n==k)
printf("%d",n);
else
{
while(k>=1)
{
fac1=fac1*k;
--k;
}
while(n>=1)
{
fac2=fac2*n;
--n;
}
while(k-n>=1)
{
fac3=fac3*(k-n);
--(k-n-1);
}
printf("%d",fac1/(fac2*fac3));
}
return 0;
}
|
main.c: In function 'main':
main.c:23:9: error: lvalue required as decrement operand
23 | --(k-n-1);
| ^~
|
s566522931
|
p03962
|
Java
|
import java.util.*;
public class Solution{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int a =in.nextInt(), b = in.nextInt(), c = in.nextInt();
int count = 0;
if(a!=b) {
count++;
}
if(b!=c) {
count++;
}
if(a!=c) {
count++;
}
if(count == 3) {
System.out.println("3");
// System.out.print("Three different colors: \n"+a+", "+b+" and "+c+".");
}
if(count == 2) {
if(a==c) c = b;
System.out.println("2");
// System.out.print("Two different colors: "+a+" and "+c+".");
}
if(count == 0) {
System.out.println("1");
// System.out.print("One different color: \r\n"+a+".");
}
in.close();
}
}
|
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
^
1 error
|
s789403097
|
p03962
|
Java
|
import java.util.*;
public class Solution{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int a =in.nextInt(), b = in.nextInt(), c = in.nextInt();
int count = 0;
if(a!=b) {
count++;
}
if(b!=c) {
count++;
}
if(a!=c) {
count++;
}
if(count == 3) {
System.out.print("Three different colors: "+a+", "+b+" and "+c+".");
}
if(count == 2) {
if(a==c) c = b;
System.out.print("Two different colors: "+a+" and "+c+".");
}
if(count == 0) {
System.out.print("One different color: "+a+".");
}
in.close();
}
}
|
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
^
1 error
|
s208375653
|
p03962
|
C++
|
#include <bits/stdc++.h>
int main()
{
int a,b,c,i,t;
cin>>a>>b>>c;
if((a==b)||(b==c)||(c==a))
{
cout<<2;
}
else
if(a==b==c)
{
cout<<1;
}
else
cout<<3;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b>>c;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
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:8:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
8 | cout<<2;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
13 | cout<<1;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
a.cc:16:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
16 | cout<<3;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s651849663
|
p03962
|
Java
|
import java.util.*;
public class Solution{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
int a =in.nextInt(), b = in.nextInt(), c = in.nextInt();
int count = 0;
if(a!=b) {
count++;
}
if(b!=c) {
count++;
}
if(a!=c) {
count++;
}
if(count == 3) {
System.out.print("Three different colors: "+a+", "+b+" and "+c+".");
}
if(count == 2) {
if(a==c) c = b;
System.out.print("Two different colors: "+a+" and "+c+".");
}
if(count == 1) {
System.out.print("One different color: "+a+".");
}
in.close();
}
}
|
Main.java:3: error: class Solution is public, should be declared in a file named Solution.java
public class Solution{
^
1 error
|
s656109881
|
p03962
|
C++
|
#include<iostream>
int main()
{
int a[5],i,c=0,b[i],j;
for(i=0;i<3;i++)
{
cin>>a[i];
}
for(i=0;i<2;i++)
{
for(j=(i+1);j<3;j++)
{
if(a[i]!=a[j])
c++;
}
}
cout<<c;
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a[i];
| ^~~
| 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:17:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout<<c;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s505587464
|
p03962
|
C++
|
#include<bits/stdc++.h>
int main()
{
int a[5],i,c=0,b[i],j;
for(i=0;i<3;i++)
{
cin>>a[i];
}
for(i=0;i<2;i++)
{
for(j=(i+1);j<3;j++)
{
if(a[i]!=a[j])
c++;
}
}
cout<<c;
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
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:17:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
17 | cout<<c;
| ^~~~
| std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
|
s192389745
|
p03962
|
C++
|
#include<bits/stdc++.h>
int main()
{
int a[5],i,c=0,b[i];
for(i=0;i<3;i++)
{
cin>>a[i];
}
for(i=0;i<2;i++)
{
for(j=(i+1);j<3;j++)
{
if(a[i]!=a[j])
c++;
}
}
}
|
a.cc: In function 'int main()':
a.cc:7:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
7 | cin>>a[i];
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
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:11:5: error: 'j' was not declared in this scope
11 | for(j=(i+1);j<3;j++)
| ^
|
s213138569
|
p03962
|
C
|
#include<stdio.h>
void main()
{
int a[3],b[100];
int ct=0;
for(int i=0;i<3;i++)
scanf("%d",&a[i]);
for(int i=0;i<100;i++)
{
b[i]=0;
}
for(int i=0;i;<3;i++)
{
if(b[a[i]]==0)
{
ct++;
b[a[i]]=1;
}
}
printf("%d\n",ct);
}
|
main.c: In function 'main':
main.c:13:23: error: expected expression before '<' token
13 | for(int i=0;i;<3;i++)
| ^
|
s256226082
|
p03962
|
C
|
#include<stdio.h>
int main(void){
int color[3];
int count=0;
int i,j;
for(i=0;i<3;i++){
scanf("%d",&color[i]);
if(i!=0){
for(j=0;j<i;j++){
if(color[i]==color[j]){
count++;
break;
}
}
}
int a=3-count;
printf("%d",a);
return 0;
}
|
main.c: In function 'main':
main.c:19:3: error: expected declaration or statement at end of input
19 | }
| ^
|
s076438336
|
p03962
|
C
|
#include<stdio.h>
int main(void){
int color[3];
int count=0;
int i,j;
for(i=0;i<3;i++){
scanf("%d",&color[i]);
if(i!=0){
for(j=0;j<i;J++){
if(color[i]==color[j]){
count++;
break;
}
}
}
int a=3-count;
printf("%d",a);
return 0;
}
|
main.c: In function 'main':
main.c:9:19: error: 'J' undeclared (first use in this function)
9 | for(j=0;j<i;J++){
| ^
main.c:9:19: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:3: error: expected declaration or statement at end of input
19 | }
| ^
|
s373403821
|
p03962
|
C
|
#include<stdio.h>
int main(void){
int color[3];
int count=0;
int i;
for(i=0;i<3;i++){
scanf("%d",&color[i]);
if(i!=0){
for(j=0;j<i;J++){
if(color[i]==color[j]){
count++;
break;
}
}
}
int a=3-count;
printf("%d",a);
return 0;
}
|
main.c: In function 'main':
main.c:9:11: error: 'j' undeclared (first use in this function)
9 | for(j=0;j<i;J++){
| ^
main.c:9:11: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:19: error: 'J' undeclared (first use in this function)
9 | for(j=0;j<i;J++){
| ^
main.c:19:3: error: expected declaration or statement at end of input
19 | }
| ^
|
s819177706
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a=0, b=0, c=0;
cin >> a >> b >> c;
if(a==b && a==c) {
cout << "1" << endl;
} else if(a!=b && a!=c && b!=c) {
cout << "3" << endl;
} else if {
cout << "2" << endl;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:13: error: expected '(' before '{' token
17 | } else if {
| ^
| (
|
s725803548
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin >> a >> b >> c;
if(a==b==c){
cout << 1;
}
else if(a==b||b==c||c==a){
cout << 2;
}
int e=3;
else{
cout << e;
}
}
|
a.cc: In function 'int main()':
a.cc:13:3: error: 'else' without a previous 'if'
13 | else{
| ^~~~
|
s001586100
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ll long long
#define ld long double
#define all(a) (a).begin(),(a).end()
#define mk make_pair
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
int main() {
set<int> s;
int n,ans=0;
cin >> n;
rep(i,n){
int f;
cin >> f;
if (s.find()==s.end()) s.insert(f);
else ans++;
}
cout << ans << endl;
}
|
a.cc: In function 'int main()':
a.cc:22:15: error: no matching function for call to 'std::set<int>::find()'
22 | if (s.find()==s.end()) s.insert(f);
| ~~~~~~^~
In file included from /usr/include/c++/14/set:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:158,
from a.cc:1:
/usr/include/c++/14/bits/stl_set.h:806:9: note: candidate: 'template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::iterator{((std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
806 | find(const _Kt& __x)
| ^~~~
/usr/include/c++/14/bits/stl_set.h:806:9: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_set.h:812:9: note: candidate: 'template<class _Kt> decltype (std::set<_Key, _Compare, _Alloc>::const_iterator{((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_find_tr(__x)}) std::set<_Key, _Compare, _Alloc>::find(const _Kt&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
812 | find(const _Kt& __x) const
| ^~~~
/usr/include/c++/14/bits/stl_set.h:812:9: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_set.h:796:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; key_type = int]'
796 | find(const key_type& __x)
| ^~~~
/usr/include/c++/14/bits/stl_set.h:796:7: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_set.h:800:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::const_iterator std::set<_Key, _Compare, _Alloc>::find(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; const_iterator = std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>, std::allocator<int> >::const_iterator; key_type = int]'
800 | find(const key_type& __x) const
| ^~~~
/usr/include/c++/14/bits/stl_set.h:800:7: note: candidate expects 1 argument, 0 provided
|
s087211815
|
p03962
|
C++
|
#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
using namespace std;
//////全探索したいときに開けよ////////
vector<vector<int>> fspattern;
vector<int> fspattern_draft;
int fspcnt = 0;
void setfspattern_core(int floor,int number,int degree){
if(floor==degree){
fspattern.at(fspcnt) = fspattern_draft;
fspcnt++;
}else{
rep(i,number){
fspattern_draft.at(floor) = i;
setfspattern_core(floor+1,number,degree);
}
}
}
void setfspattern(int number,int degree){
int64_t array_num = 1;
rep(i,degree){
array_num *= number;
}
fspattern = vector<vector<int>>(array_num,vector<int>(degree));
fspattern_draft = vector<int>(degree);
setfspattern_core(0,number,degree);
}
//////nCrのmodを求めたいときに開けよ/////////
//int64_t univMod = 1000000007;
//int64_t factnum = 100000
//vector<int64_t> modfact(factnum);
//vector<int64_t> modinvfact(factnum);
/*void setmodfact(){
for(int i=0;i<factnum;i++){
if(i == 0){
modfact.at(i) = 1;
}else{
modfact.at(i) = (modfact.at(i-1)*i)%univMod;
}
}
}
int64_t calcmodpower(int64_t a,int64_t n){
int64_t res = 1;
while(n != 0){
if(n & 1){
res = (res * a) % univMod;
}
a = (a*a) % univMod;
n = n >> 1;
}
return res;
}
int64_t calcinverse(int64_t n){
return calcmodpower(n,univMod-2);
}
void setmodinvfact(){
for(int i=0;i<factnum;i++){
if(i==0){
modinvfact.at(i) = 1;
}else{
modinvfact.at(i) = calcmodpower(modfact.at(i),univMod-2);
}
}
}
int64_t calcmodcomb(int64_t n,int64_t r){
return (((modfact.at(n)*modinvfact.at(r))%univMod)*modinvfact.at(n-r))%univMod;
}
int64_t calcmodpositive(int64_t n){
return (n + ((abs(n)+univMod-1)/univMod)*univMod)%univMod;
}
*/
int64_t calcGCD(int64_t a,int64_t b){
int64_t p = a;
int64_t q = b;
int64_t c = a%b;
while(c != 0){
p = q;
q = c;
c = p%q;
}
return q;
}
int main(){
set<int> s;
rep(i,3){
int h;
cin >> h;
s.insert(h);
}
cout << s.size() << endl;
}
}
|
a.cc:110:1: error: expected declaration before '}' token
110 | }
| ^
|
s891699376
|
p03962
|
C++
|
#include<iostream>
int a[4],ans[105],ak;
main()
{
for(int i=1;i<=3;i++){
cin>>a[i];
ans[a[i]]++;
}
for(int i=1;i<=103;i++){
if(ans[i]>0) ak++;
}
cout<<ak<<endl;
return 0;
}
|
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | main()
| ^~~~
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
6 | cin>>a[i];
| ^~~
| 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:12:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
12 | cout<<ak<<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:12:15: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
12 | cout<<ak<<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)
| ^~~~
|
s150017060
|
p03962
|
Java
|
import java.util.Scanner;
public class main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b =sc.nextInt();
int c = sc.nextInt();
int ans = 0;
if(a == b) {
if(b == c) ans = 1;
else ans = 2;
}else if(b == c) {
ans = 2;
}else if(a == c){
ans = 2;
}else {
ans = 3;
}
System.out.println(ans);
sc.close();
}
}
|
Main.java:3: error: class main is public, should be declared in a file named main.java
public class main {
^
1 error
|
s299599641
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin >> a >> b >> c ;
int ans =3;
if(a==c)
ans--;
if(a==b)
ans--;
if(c== b)
ans--;
if((a == b) && (b == c))
ans ++
cout << ans ;
}
|
a.cc: In function 'int main()':
a.cc:15:11: error: expected ';' before 'cout'
15 | ans ++
| ^
| ;
16 | cout << ans ;
| ~~~~
|
s555613411
|
p03962
|
C++
|
#include <iostream>
using namespace std;
int main(){
cin>>a>>b>>c;
cout<<1+(a!=b)+(b!=c&&a!=c);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:6:8: error: 'a' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
a.cc:6:11: error: 'b' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
a.cc:6:14: error: 'c' was not declared in this scope
6 | cin>>a>>b>>c;
| ^
|
s447704134
|
p03962
|
Java
|
import java.util.*;
public class Main{
public static void main(String[] args) {
Set colorSet = new Set();
Scanner sc = new Scanner(System.in);
int color1 = sc.nextInt();
int color2 = sc.nextInt();
int color3 = sc.nextInt();
colorSet.add(color1);
color.add(color2);
colorSet.add(color3);
int[] colorList = colorSet.toArray();
System.out.println(colorList.length);
}
}
|
Main.java:5: error: Set is abstract; cannot be instantiated
Set colorSet = new Set();
^
Main.java:12: error: cannot find symbol
color.add(color2);
^
symbol: variable color
location: class Main
Main.java:15: error: incompatible types: Object[] cannot be converted to int[]
int[] colorList = colorSet.toArray();
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors
|
s675588988
|
p03962
|
Java
|
import java.util.*;
public class Main{
public static void main(String[] args) {
Set colorSet = new Set();
Scanner sc = new Scanner(System.in);
int color1 = sc.nextInt();
int color2 = sc.nextInt();
int color3 = sc.nextInt();
colorSet.add(color1);
color.add(color2);
colorSet.add(color3);
colorSet.toArray().length;
}
}
|
Main.java:15: error: not a statement
colorSet.toArray().length;
^
1 error
|
s263454799
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll
#define int ll
int32_t main(){
int i = 3;
set<int> myset;
while(i--){
int temp;
cin>>temp;
myset.insert(temp);
}
cout<<myset.size()<<endl;
}
|
a.cc:5:1: error: expected initializer before 'int32_t'
5 | int32_t main(){
| ^~~~~~~
|
s459702333
|
p03962
|
Java
|
import java.util.*;
class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a,b,c ;
a = sc.nextInt();
b = sc.nextInt();
c = sc.nextInt();
if(a != b && b!= c && c!=a){
System.out.println(3)
}else if( a==b && b==c && c==a){
System.out.println(1);
}else{
System.out.println(2);
}
}
}
|
Main.java:11: error: ';' expected
System.out.println(3)
^
1 error
|
s993307053
|
p03962
|
C++
|
#include <iostream>
using namespace std;
int main(void){
string str;
vector<string> v;
while (getline(cin, str, ' ')) {
v.push_back(str);
}
sort(v.begin(), v.end());
v.erase(unique(v.begin(), v.end()), v.end());
cout << v.size() << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: 'vector' was not declared in this scope
5 | vector<string> v;
| ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
1 | #include <iostream>
+++ |+#include <vector>
2 | using namespace std;
a.cc:5:22: error: expected primary-expression before '>' token
5 | vector<string> v;
| ^
a.cc:5:24: error: 'v' was not declared in this scope
5 | vector<string> v;
| ^
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'short'?
9 | sort(v.begin(), v.end());
| ^~~~
| short
a.cc:10:17: error: 'unique' was not declared in this scope
10 | v.erase(unique(v.begin(), v.end()), v.end());
| ^~~~~~
|
s226410617
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
if(A!=B&&B!=C&&C!=A) cout<<3<<endl;
else if(A==B&&B==C&&C==A) cout<<1<<endl;
else cout<<2<<endl;
}
|
a.cc: In function 'int main()':
a.cc:6:6: error: 'A' was not declared in this scope
6 | if(A!=B&&B!=C&&C!=A) cout<<3<<endl;
| ^
a.cc:6:9: error: 'B' was not declared in this scope
6 | if(A!=B&&B!=C&&C!=A) cout<<3<<endl;
| ^
a.cc:6:15: error: 'C' was not declared in this scope
6 | if(A!=B&&B!=C&&C!=A) cout<<3<<endl;
| ^
|
s067775811
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,cnt = 0;
cin >> a >> b >> c;
if(a != b)
cnt++;
else if(a != c)
cnt++;
else if(b != c)
cnt++;
cout << cnt << endl;
}
}
|
a.cc:15:1: error: expected declaration before '}' token
15 | }
| ^
|
s561187129
|
p03962
|
Java
|
import java.util.*;
import java.util.ArrayList;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<Integer> list = new ArrayList<Integer>();
int a =sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
number = 3;
if(a == b){
number--;
}
if(a == c){
number --;
}
if(b == c){
number --;
}
if(number ==0){
number=1;
}
System.out.println(number);
}
}
|
Main.java:10: error: cannot find symbol
number = 3;
^
symbol: variable number
location: class Main
Main.java:12: error: cannot find symbol
number--;
^
symbol: variable number
location: class Main
Main.java:15: error: cannot find symbol
number --;
^
symbol: variable number
location: class Main
Main.java:18: error: cannot find symbol
number --;
^
symbol: variable number
location: class Main
Main.java:20: error: cannot find symbol
if(number ==0){
^
symbol: variable number
location: class Main
Main.java:21: error: cannot find symbol
number=1;
^
symbol: variable number
location: class Main
Main.java:23: error: cannot find symbol
System.out.println(number);
^
symbol: variable number
location: class Main
7 errors
|
s373997841
|
p03962
|
Java
|
import java.util.*;
import java.util.ArrayList;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
ArrayList<Integer> list = new ArrayList<Integer>();
int a =sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
number = 3;
if(a == b){
number--;
}
if(a == c){
number --;
}
if(b == c){
number --;
}
if(number ==0){
number=1;
}
System.out.println(number);
}
|
Main.java:24: error: reached end of file while parsing
}
^
1 error
|
s700479858
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb push_back
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
#define Q queue
#define pri priority_queue
#define Pri priority_queue<int,vector<int>,greater<int>>
#define PriP priority_queue<P<int,int>,vector<P<int,int>>,greater<P<int,int>>>
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define all(a) (a).begin(),(a).end()
#define Pi P<int,int>
#define elif else if
int low(V<int> a,int b){
decltype(a)::iterator c=lower_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
int upp(V<int> a,int b){
decltype(a)::iterator c=upper_bound(a.begin(),a.end(),b);
int d=c-a.bgn;
return d;
}
template<class T>
void cou(vector<vector<T>> a){
int b=a.size();
int c=a[0].size();
fo(i,b){
fo(j,c){
cout<<a[i][j];
if(j==c-1)
cout<<endl;
else
cout<<' ';
}
}
}
int wari(int a,int b) {
if(a%b==0)
return a/b;
else
return a/b+1;
}
int keta(int a){
double b=a;
b=log10(b);
int c=b;
return c+1;
}
int souwa(int a){
return a*(a+1)/2;
}
int gcm(int a,int b){
if(a%b==0)
return b;
return gcm(b,a%b);
}
bool prime(int a){
if(a<2)
return false;
else if(a==2)
return true;
else if(a%2==0)
return false;
double b=sqrt(a);
for(int i=3;i<=b;i+=2){
if(a%i==0){
return false;
}
}
return true;
}
struct Union{
vector<int> par;
Union(int a){
par=vector<int>(a,-1);
}
int find(int a){
if(par[a]<0)
return a;
else
return par[a]=find(par[a]);
}
bool same(int a,int b){
return find(a)==find(b);
}
int Size(int a){
return -par[find(a)];
}
void unite(int a,int b){
a=find(a);
b=find(b);
if(a==b)
return;
if(Size(b)>Size(a))
swap<int>(a,b);
par[a]+=par[b];
par[b]=a;
}
};
int ketas(int a){
string b=to_string(a);
int c=0;
fo(i,keta(a)){
c+=b[i]-'0';
}
return c;
}
int lcm(int a,int b){
return a/gcm(a,b)*b;
}
bool fe(int a,int b){
a%=10;
b%=10;
if(a==0)
a=10;
if(b==0)
b=10;
if(a>b)
return true;
else
return false;
}
int INF=1000000007;
struct edge{int s,t,d; };
V<int> mojisyu(string a){
V<int> b(26,0);
fo(i,a.sz){
b[a[i]-'a']++;
}
return b;
}
int wa2(int a){
if(a%2==1)
return a/2;
return a/2-1;
}
/*signed main(){
int a,b,c;
cin>>a>>b>>c;
V<V<edge>> d(a);
fo(i,b){
edge e;
cin>>e.s>>e.t>>e.d;
d[e.s].pb(e);
}
V<int> e(a,INF);
e[c]=0;
priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f;
f.push({0,c});
int h=INF;
while(!f.empty()){
P<int,int> g;
g=f.top();
f.pop();
int v = g.second, i = g.first;
for(edge l : d[v]){
if(e[l.t] > i + l.d){
e[l.t] = i + l.d;
f.push({i+l.d , l.t});
}
}
}
fo(i,a){
if(e[i]==INF)
cout<<"INF"<<endl;
else
cout<<e[i]<<endl;
}
}
?*/
int nCr(int n,int r){
int a=1;
r=min(r,n-r);
for(int i=n;i>n-r;i--){
a*=i;
a/=n-i+1;
}
return a;
}
/*void sea(int x,int y){
if(x<0||a<=x||y<0||b<=y||c[x][y]=='#')
return;
if(d[x][y])
return;
d[x][y]++;
sea(x+1,y);
sea(x-1,y);
sea(x,y+1);
sea(x,y-1);
}*/
int kaijou(int a){
int b=1;
fo(i,a)
b*=i+1;
return b;
}
int nPr(int a,int b){
int c=1;
for(int i=a;i>=b;i--)
c*=i;
return c;
}
int MOD=INF;
int fac[1000010], finv[1000010], inv[1000010];
// テーブルを作る前処理
//先にCOMinit()で前処理をする
//ABC145D
void COMinit() {
fac[0]=fac[1]=1;
finv[0]=finv[1]=1;
inv[1]=1;
for(int i=2;i<1000010;i++){
fac[i]=fac[i-1]*i%MOD;
inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
finv[i]=finv[i-1]*inv[i]%MOD;
}
}
// 二項係数計算
int COM(int n,int k){
if(n<k)
return 0;
if(n<0||k<0)
return 0;
return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
bool naka(int a,int b,V<V<char>> c){
return (a>=0&&b>=0&&a<c.sz&&b<c[0].sz);
}
V<P<int,int>> mawari4={{0,-1},{0,1},{1,0},{-1,0}};
V<P<int,int>> mawari8={{0,-1},{0,1},{1,0},{-1,0},{-1,-1},{1,1},{1,-1},{-1,-1}};
// 最短距離の表:c
// スタート:sx,sy
// ゴール:gx,gy
/*int bfs(V<V<char>> a){
Q<P<int,int>> b;
fo(i,a.sz){
fo(j,a[0].sz){
c[i][j]==INF;
}
}
b.push({sx,sy});
c[sx][sy]=0;
while(b.sz){
P d=b.front();
b.pop();
if(d=={gx,gy})
break;
fo(i,4){
int e=d.fi+mawari4[i],f=d.se+mawari4[i];
if(naka(e,f,a)&&a[e][f]=='.'&&c[e][f]==INF){
b.push({e,f});
c[e][f]==c[d.fi][d.se]+1;
}
}
}
return c[gx][gy];
}*/
int inf=1000000000000000007;
/*
signed main(){
int a,b,c;
cin>>a>>b>>c;
V<V<edge>> d(a);
fo(i,b){
edge e;
cin>>e.s>>e.t>>e.d;
d[e.s].pb(e);
}
V<int> e(a,INF);
e[c]=0;
priority_queue<P<int,int>,V<P<int,int>>,greater<P<int,int>>> f;
f.push({0,c});
int h=INF;
while(!f.empty()){
P<int,int> g;
g=f.top();
f.pop();
int v = g.second, i = g.first;
for(edge l : d[v]){
if(e[l.t] > i + l.d){
e[l.t] = i + l.d;
f.push({i+l.d , l.t});
}
}
}
fo(i,a){
if(e[i]==INF)
cout<<"INF"<<endl;
else
cout<<e[i]<<endl;
}
}*/
signed main(){
int a,b,c;
cin>>a>>b>>c;
if(a!=b&&b!=c&&c!=a)
cout<3<<endl;
else if(a==b||b==c||c==a)
cout<<2<<endl;
else
cout<<1<<endl;
}
|
a.cc: In function 'int main()':
a.cc:319:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
319 | cout<3<<endl;
| ~^~~~~~
|
s701004395
|
p03962
|
C
|
#include <stdio.h>
int main(void){
int a,b,c,sum;
scanf("%d%d%d",&a,&b,&c);
if(a!=b){
sum++;
}
if(b!=c){
sum++;
}
if(c!=a){
sum++;
}
if(a==B||a==c){
sum=1;
}
printf("%d",sum);
return 0;
}
|
main.c: In function 'main':
main.c:14:15: error: 'B' undeclared (first use in this function)
14 | if(a==B||a==c){
| ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
|
s344324460
|
p03962
|
C++
|
#include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
int main(){
int a[4];
cin>>a[0]>>a[1]>>a[2];
int cnt=3;
if(a[i]==a[(i+1)%3]&&a[(i+2)%3]==a[(i+1)%3]){
cout<<1<<endl;
return 0;
}
for(int i=0;i<3;i++){
if(a[i]==a[(i+1)%3])cnt--;
}
cout<<cnt<<endl;
}
|
a.cc: In function 'int main()':
a.cc:9:8: error: 'i' was not declared in this scope
9 | if(a[i]==a[(i+1)%3]&&a[(i+2)%3]==a[(i+1)%3]){
| ^
|
s917370541
|
p03962
|
C
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(){
int a,b,c;
scanf("%d %d %d",&a,&b,&c);
if(a == b && a==c){
printf("1");
}
else if((a==b && a!=c) || (a != b && a==c))
{
printf("2");
}
else{
printf("3");
return 0;
}
|
main.c: In function 'main':
main.c:20:1: error: expected declaration or statement at end of input
20 | }
| ^
|
s532344742
|
p03962
|
Java
|
import java.util.*;
public class A {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int a = Integer.parseInt(sc.next());
int b = Integer.parseInt(sc.next());
int c = Integer.parseInt(sc.next());
int ans = 3;
if(a == b) {
ans--;
}else if(a == c){
ans--;
}else if(b == c){
ans--;
}
if(ans == 0) {
System.out.println(1);
}else {
System.out.println(ans);
}
}
}
|
Main.java:2: error: class A is public, should be declared in a file named A.java
public class A {
^
1 error
|
s363839487
|
p03962
|
C++
|
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
using namespace std;
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
//container util
//------------------------------------------
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
//debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
int main(){
int a,b,c;
cin >> a >> b >> c;
int A[3];
A[0]=a;
A[1]=b;
A[2]=c;
sort(A,A+3);
ing num=0;
int min.max;
min = A[0];
max = A[2];
if(min!=max){
num=num+2;
}
if(min!=A[1] && max!=A[1]){
++num;
}
cout << num;
}
|
a.cc: In function 'int main()':
a.cc:80:5: error: 'ing' was not declared in this scope; did you mean 'int'?
80 | ing num=0;
| ^~~
| int
a.cc:81:12: error: expected initializer before '.' token
81 | int min.max;
| ^
a.cc:82:14: error: overloaded function with no contextual type information
82 | min = A[0];
| ^
a.cc:83:14: error: overloaded function with no contextual type information
83 | max = A[2];
| ^
a.cc:84:11: error: invalid operands of types '<unresolved overloaded function type>' and '<unresolved overloaded function type>' to binary 'operator!='
84 | if(min!=max){
| ~~~^~~~~
a.cc:85:9: error: 'num' was not declared in this scope; did you mean 'enum'?
85 | num=num+2;
| ^~~
| enum
a.cc:87:11: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
87 | if(min!=A[1] && max!=A[1]){
| ~~~^~~~~~
a.cc:87:24: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator!='
87 | if(min!=A[1] && max!=A[1]){
| ~~~^~~~~~
a.cc:88:11: error: 'num' was not declared in this scope; did you mean 'enum'?
88 | ++num;
| ^~~
| enum
a.cc:90:13: error: 'num' was not declared in this scope; did you mean 'enum'?
90 | cout << num;
| ^~~
| enum
|
s630519744
|
p03962
|
C++
|
#include<bit/stdc++.h>
using namespace std;
int main()
{
int a, b, c;
cin>>a>>b>>c;
map<int, int> m;
m[a]++;m[b]++;m[c]++;
int count = 0;
for(auto i = m.begin(); i != m.end(); i++)
{
if(i -> second != 0)
count++;
}
cout<<count<<"\n";
return 0;
}
|
a.cc:1:9: fatal error: bit/stdc++.h: No such file or directory
1 | #include<bit/stdc++.h>
| ^~~~~~~~~~~~~~
compilation terminated.
|
s536331338
|
p03962
|
C++
|
#include <iostream>
using namespace std;
int a,b,c,sum=3;
int main(){
cin>>a>>b>>c;
if(a==b){
sum--;
}
if(b==c){
sum--;
}
if(c==a){
sum--;
}
if(a==b&&b==c){
cout<<1;
break;
}
cout<<sum;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:17:17: error: break statement not within loop or switch
17 | break;
| ^~~~~
|
s897812820
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int A, B, C;
cin >> A >> B >> C;
cout << (max({A, B, C})==min({A, B, C)}?"1":((A!=B&&B!=C)?"3":"2")) << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:40: error: expected '}' before ')' token
7 | cout << (max({A, B, C})==min({A, B, C)}?"1":((A!=B&&B!=C)?"3":"2")) << endl;
| ~ ^
a.cc:7:41: error: expected ')' before '}' token
7 | cout << (max({A, B, C})==min({A, B, C)}?"1":((A!=B&&B!=C)?"3":"2")) << endl;
| ~ ^
| )
a.cc:7:41: error: expected ';' before '}' token
7 | cout << (max({A, B, C})==min({A, B, C)}?"1":((A!=B&&B!=C)?"3":"2")) << endl;
| ^
| ;
a.cc: At global scope:
a.cc:7:42: error: expected unqualified-id before '?' token
7 | cout << (max({A, B, C})==min({A, B, C)}?"1":((A!=B&&B!=C)?"3":"2")) << endl;
| ^
a.cc:9:1: error: expected declaration before '}' token
9 | }
| ^
|
s745460394
|
p03962
|
C++
|
const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
const main = ()=>{
let [a,b,c]=nrin(3)
out(a==b&&b==c?1:a==b||b==c?2:3)
}
main()
|
a.cc:1:21: warning: multi-character character constant [-Wmultichar]
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
| ^~~~
a.cc:1:40: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
| ^~~~~~~~~~~~
a.cc:1:54: warning: multi-character character constant [-Wmultichar]
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
| ^~~~~~
a.cc:1:70: error: stray '\' in program
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
| ^
a.cc:1:872: warning: multi-character character constant [-Wmultichar]
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
| ^~~~
a.cc:1:881: warning: multi-character character constant [-Wmultichar]
1 | const input=require('fs').readFileSync('/dev/stdin', 'utf8').split(/[\s]/);const nin=()=>{const r = input[0];input.shift();return Number(r)};const nrin=(n)=>{const a:number[]=[];rep(n,()=>a.push(nin()));return a};const sin=()=>{const r = input[0];input.shift();return String(r)};const out=(...a)=>{console.log(...a)};const floor=(a)=>{return Math.floor(a)};const abs=(a)=>{return Math.abs(a)};const min=(...a)=>{return Math.min(...a)};const max=(...a)=>{return Math.max(...a)};const rep=(n, callback)=>{for(let i = 0;i < n; i++){callback()}};const strrep=(s, i, v)=>{return s.slice(0, i)+v+s.slice(i+1);};const permutation=({result=[],pre=[],post,n=post.length})=>{if(n>0){post.forEach((_,i)=>{const rest=[...post];const elem=rest.splice(i, 1);permutation({result, pre: [...pre,...elem],post:rest,n:n-1})})}else{result.push(pre)}return result};const sw=(s,a:any[],op:'='|'>='|'>'|'<='|'<'='=')=>{for(let i=0;i<a.length;i+=2){if(op==='='){if(s==a[i])return a[i+1]}else if(op==='>='){if(s>=a[i])return a[i+1]}else if(op==='<='){if(s<=a[i])return a[i+1]}else if(op==='>'){if(s>a[i])return a[i+1]}else if(op==='<'){if(s<a[i])return a[i+1]}}return a[a.length-1];};const or=(a,...b)=>{for(let i=0;i<b.length;i++)if(a==b[i])return true;return false};const maxindex=(...a)=>{return a.indexOf(Math.max.apply(null,a))};const asc=(ar:number[])=>{return ar.sort((a,b)=>{return a-b})};const desc=(ar:number[])=>{return ar.sort((a,b)=>{return b-a})};
|
|
s006885472
|
p03962
|
C++
|
// C++ implementation of the approach
#include <bits/stdc++.h>
using namespace std;
// Function to generate and print the required string
void generateString(int A, int B)
{
string rt;
while (0 < A || 0 < B) {
// More 'b', append "bba"
if (A < B) {
if (0 < B--)
rt.push_back('b');
if (0 < B--)
rt.push_back('b');
if (0 < A--)
rt.push_back('a');
}
// More 'a', append "aab"
else if (B < A) {
if (0 < A--)
rt.push_back('a');
if (0 < A--)
rt.push_back('a');
if (0 < B--)
rt.push_back('b');
}
// Equal number of 'a' and 'b'
// append "ab"
else {
if (0 < A--)
rt.push_back('a');
if (0 < B--)
rt.push_back('b');
}
}
cout << rt;
}
// Driver code
int main()
{
int A = 2, B = 6;
generateString(A, B);
return 0;
}
return 0;}
|
a.cc:60:1: error: expected unqualified-id before 'return'
60 | return 0;}
| ^~~~~~
a.cc:60:10: error: expected declaration before '}' token
60 | return 0;}
| ^
|
s529936779
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c:
cin >> a >> b >> c;
if(a == b && b == c){
cout << "1" << endl;
}else if(a == b){
cout << "2" << endl;
}else if(b == c){
cout << "2" << endl;
}else if(a == c){
cout << "2" << endl;
}else{
cout << "3" << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:4:12: error: found ':' in nested-name-specifier, expected '::'
4 | int a,b,c:
| ^
| ::
a.cc:4:11: error: 'c' has not been declared
4 | int a,b,c:
| ^
a.cc:5:7: error: qualified-id in declaration before '>>' token
5 | cin >> a >> b >> c;
| ^~
a.cc:6:21: error: 'c' was not declared in this scope
6 | if(a == b && b == c){
| ^
|
s937370902
|
p03962
|
C++
|
#include <iostream>
using namespace std;
int main()
{
int r,m,d;
cin>>r>>m>>d;
if(r==m && r==d){
cout<<1;
}
else if ( (r==m && r!=d)||(r!=m && d==m)||(a==d && a!=m ))
{
cout<<2;
}
else if (r!=m && m!=d && r!=d)
{
cout<<3;
}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:15:46: error: 'a' was not declared in this scope
15 | else if ( (r==m && r!=d)||(r!=m && d==m)||(a==d && a!=m ))
| ^
|
s209593971
|
p03962
|
C++
|
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int a, b, c;
set<int> s;
cin >> a >> b >> c;
s.insert(a);
s.insert(b);
s.insert(c);
cout << s.count();
return 0;
}
|
a.cc: In function 'int main()':
a.cc:33:24: error: no matching function for call to 'std::set<int>::count()'
33 | cout << s.count();
| ~~~~~~~^~
In file included from /usr/include/c++/14/set:63,
from a.cc:12:
/usr/include/c++/14/bits/stl_set.h:756:9: note: candidate: 'template<class _Kt> decltype (((const std::set<_Key, _Compare, _Alloc>*)this)->std::set<_Key, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::set<_Key, _Compare, _Alloc>::count(const _Kt&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>]'
756 | count(const _Kt& __x) const
| ^~~~~
/usr/include/c++/14/bits/stl_set.h:756:9: note: candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/stl_set.h:750:7: note: candidate: 'std::set<_Key, _Compare, _Alloc>::size_type std::set<_Key, _Compare, _Alloc>::count(const key_type&) const [with _Key = int; _Compare = std::less<int>; _Alloc = std::allocator<int>; size_type = long unsigned int; key_type = int]'
750 | count(const key_type& __x) const
| ^~~~~
/usr/include/c++/14/bits/stl_set.h:750:7: note: candidate expects 1 argument, 0 provided
|
s723134696
|
p03962
|
C++
|
#include<iostraem>
using namespace std;
int main(){
int a, b, c;
cin >> a >> b >> c;
if ((a == b) && (b == c) && (c ==a))
cout << 1 << endl;
else if ((a == b) || (b == c) || (c == a))
cout << 2 << endl;
else
cout << 3 << endl;
return 0;
}
|
a.cc:1:9: fatal error: iostraem: No such file or directory
1 | #include<iostraem>
| ^~~~~~~~~~
compilation terminated.
|
s870834717
|
p03962
|
C++
|
#include <vector>
#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <limits.h>
#include <cmath>
#include <queue>
#include <map>
#include <iomanip>
#include <random>
#include <fstream>
#define rep(i, n) for (int i = 0; i < n; i++)
#define PI 3.14159265358979323846
#define MOD 1000000007
using namespace std;
using ll = long long;
const int MAX = 1000000;
ll fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
// 二項係数計算
long long COM(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
ll gcd(ll a, ll b)
{
ll r;
while ((r = a % b))
{
a = b;
b = r;
}
return b;
}
template <class T> struct cord{
T x,y;
};
template <class T> double dist(cord<T> a, cord<T> b){
T dx=a.x-b.x;
T dy=a.y-b.y;
return sqrt(dx*dx+dy*dy);
}
int main()
{
//cout << fixed << setprecision(10);
vector<int> color(3);
rep(i,3){cin>>color[i];}
sort(color.begin(),color.end());
if (a==b && b==c){cout << 1;}
else if (a==b || b==c){cout << 2;}
else {cout << 3;}
return 0;
}
|
a.cc: In function 'int main()':
a.cc:71:7: error: 'a' was not declared in this scope
71 | if (a==b && b==c){cout << 1;}
| ^
a.cc:71:10: error: 'b' was not declared in this scope
71 | if (a==b && b==c){cout << 1;}
| ^
a.cc:71:18: error: 'c' was not declared in this scope
71 | if (a==b && b==c){cout << 1;}
| ^
|
s911094662
|
p03962
|
C++
|
#include<stdio.h>
int main()
{
int a[3]={0};
int i,j,x,;
int k=1;
for(i=0;i<3;i++){
scanf("%d",&x);
a[i]=x;}
for(i=0;i<2;i++)
{
for(j=i+1;j<3;j++)
{
if(a[i]!=a[j])
k++;
}
}
printf("%d\n",k);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:19: error: expected unqualified-id before ';' token
5 | int i,j,x,;
| ^
|
s506498408
|
p03962
|
C++
|
#include<stdio.h>
int main()
{
int a[3]={0};
int i,j,x,;
int k=0;
for(i=0;i<3;i++){
scanf("%d",&x);
a[i]=x;}
for(i=0;i<3;i++)
{
for(j=i+1;j<3;j++)
{
if(a[i]!=a[j])
k++;
}
}
printf("%d\n",k);
return 0;
}
|
a.cc: In function 'int main()':
a.cc:5:19: error: expected unqualified-id before ';' token
5 | int i,j,x,;
| ^
|
s195772823
|
p03962
|
C
|
#include <stdio.h>
int main1()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b||a==c||b==c)
{
printf("2");
}
else if(a==b&&b==c)
{
printf("1");
}
else
{
printf("1");
}
return 0;
}
|
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s038980382
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int a;
set<int> s;
int main(){
for(int i = 0; i < n; i++){ cin >> a; s.insert(a); }
cout << s.size();
}
|
a.cc: In function 'int main()':
a.cc:7:25: error: 'n' was not declared in this scope
7 | for(int i = 0; i < n; i++){ cin >> a; s.insert(a); }
| ^
|
s017175598
|
p03962
|
C++
|
#include<bits/stdc++>
using namespace std;
int main(){
int a,b,c;
int answer;
cin >> a >> b >> c;
if(a==b && b==c)
answer = 1;
else if(a!=b && b!=c)
answer = 3;
else
answer = 2;
cout << answer << endl;
}
|
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
1 | #include<bits/stdc++>
| ^~~~~~~~~~~~~
compilation terminated.
|
s846071060
|
p03962
|
C++
|
3 1 4
|
a.cc:1:1: error: expected unqualified-id before numeric constant
1 | 3 1 4
| ^
|
s581411340
|
p03962
|
Java
|
#include<iostream>
#include <algorithm>
#define syso(s) std::cout<<s<<endl;
#define sc(i) std::cin>>i;
using namespace std;
int main() {
int a, b, c;
int count = 0;
sc(a)
sc(b)
sc(c)
if (a == b) {
count++;
}
if (b == c) {
count++;
}
if (c == a) {
count++;
}
if (count == 3) {
count--;
}
syso(3-count)
return 0;
}
|
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include <algorithm>
^
Main.java:3: error: illegal character: '#'
#define syso(s) std::cout<<s<<endl;
^
Main.java:4: error: illegal character: '#'
#define sc(i) std::cin>>i;
^
Main.java:4: error: class, interface, enum, or record expected
#define sc(i) std::cin>>i;
^
Main.java:5: error: class, interface, enum, or record expected
using namespace std;
^
Main.java:6: error: unnamed classes are a preview feature and are disabled by default.
int main() {
^
(use --enable-preview to enable unnamed classes)
Main.java:9: error: ';' expected
sc(a)
^
Main.java:10: error: ';' expected
sc(b)
^
Main.java:11: error: ';' expected
sc(c)
^
Main.java:24: error: ';' expected
syso(3-count)
^
11 errors
|
s635079737
|
p03962
|
C++
|
import java.util.Scanner;
public class Main {
static Scanner scan=new Scanner(System.in);
static int gcd (int a, int b) {return b>0?gcd(b,a%b):a;}
static long lcm (int a, int b) {return a*b/gcd(a,b);}
static int max(int a,int b) {return a>b?a:b;}
static int min(int a,int b) {return a<b?a:b;}
static long factorial(int i) {return i==1?1:i*factorial(i-1);}
static int lower_bound(int a[],int key) {
int low=0,high=a.length;
while(low<high) {
int mid=((high-low)/2)+low;
if(a[mid]<=key)low=mid+1;
else high=mid;
}
return high;
}
static int upper_bound(int a[],int key) {
int low=0,high=a.length;
while(low<high) {
int mid=((high-low)/2)+low;
if(a[mid]<key)low=mid+1;
else high=mid;
}
return high;
}
static boolean isPrime (int n) {
if (n==2) return true;
if (n<2 || n%2==0) return false;
double d = Math.sqrt(n);
for (int i=3; i<=d; i+=2)if(n%i==0){return false;}
return true;
}
static int upper_division(int a,int b) {
if(a%b==0) {
return a/b;
}
else {
return a/b+1;
}
}
static long lupper_division(long a,long b) {
if(a%b==0) {
return a/b;
}
else {
return a/b+1;
}
}
static long lmax(long a,long b) {return Math.max(a, b);}
static long lmin(long a,long b) {return Math.min(a, b);}
static int[] setArray(int a) {
int b[]=new int[a];
for(int i=0;i<a;i++) {
b[i]=scan.nextInt();
}
return b;
}
static String reverce(String str) {
String strr="";
for(int i=str.length()-1;i>=0;i--) {
strr+=str.charAt(i);
}
return strr;
}
public static void main(String[] args) {
int a=scan.nextInt();
int b=scan.nextInt();
int c=scan.nextInt();
if(a==b&&b==c) {
System.out.println(1);
}
else if(a==b||a==b||c==b) {
System.out.println(2);
}
else {
System.out.println(3);
}
}
}
|
a.cc:1:1: error: 'import' does not name a type
1 | import java.util.Scanner;
| ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
2 | public class Main {
| ^~~~~~
|
s149549589
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb emplace_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define F first
#define S second
#define fast ios:: sync_with_stdio(false),cin.tie(0);
int32_t main(){
fast;
map<int,int<m;
int a,b,c;
cin >> a >> b >> c;
m[a]++ , m[b]++ , m[c]++;
cout << m.size();
}
|
a.cc: In function 'int32_t main()':
a.cc:4:18: error: 'long int' is not a template
4 | #define int long long
| ^~~~
a.cc:14:17: note: in expansion of macro 'int'
14 | map<int,int<m;
| ^~~
a.cc:14:21: error: 'm' was not declared in this scope; did you mean 'tm'?
14 | map<int,int<m;
| ^
| tm
a.cc:4:18: error: template argument 2 is invalid
4 | #define int long long
| ^~~~
a.cc:14:17: note: in expansion of macro 'int'
14 | map<int,int<m;
| ^~~
a.cc:4:18: error: template argument 4 is invalid
4 | #define int long long
| ^~~~
a.cc:14:17: note: in expansion of macro 'int'
14 | map<int,int<m;
| ^~~
|
s600709437
|
p03962
|
C++
|
#include <iostream>
int main(){int a,b,c;std::cin>>a>>b>>c;std::cout<<max(1,(a!=b)+(b!=c)+(c!=a));}
|
a.cc: In function 'int main()':
a.cc:2:51: error: 'max' was not declared in this scope; did you mean 'std::max'?
2 | int main(){int a,b,c;std::cin>>a>>b>>c;std::cout<<max(1,(a!=b)+(b!=c)+(c!=a));}
| ^~~
| std::max
In file included from /usr/include/c++/14/string:51,
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_algobase.h:303:5: note: 'std::max' declared here
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
|
s225341107
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,count;
count = 0;
if(a != b){
count ++;
}
if(a != c){
count ++;
}
if(c != b){
count ++;
}
if (count == 0){
count ++
}
cout << count << endl;
}
|
a.cc: In function 'int main()':
a.cc:16:13: error: expected ';' before '}' token
16 | count ++
| ^
| ;
17 | }
| ~
|
s128149862
|
p03962
|
C
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b&&b==c)
{
printf("1\n");
}
if(a==b&&a!=c)
{
printf("2\n");
}
if(a!=b&&b==c)
{
printf("2\n");
}
if(a!=b&&a==c)
{
printf("2\n");
}
if(a!=b&&b!=c&&a!=c)
{
printf("3\n")
}
return 0;
}
|
main.c: In function 'main':
main.c:24:18: error: expected ';' before '}' token
24 | printf("3\n")
| ^
| ;
25 | }
| ~
|
s778464732
|
p03962
|
C
|
#include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b&&b==c)
{
printf("1\n");
}
if(a==b&&a!=c)
{
printf("2\n");
}
if(a!=b&&b==c)
{
printf("2\n");
}
if(a!=b&&a==c)
{
printf("2\n");
}
if(a!=b&&b!=c&&a!=c)
{
printf("3\n")
}
return 0;
}
|
main.c: In function 'main':
main.c:24:18: error: expected ';' before '}' token
24 | printf("3\n")
| ^
| ;
25 | }
| ~
|
s011559810
|
p03962
|
C++
|
include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b==c)
printf("%d\n",a);
if(a==b&&a!=c)
printf("%d %d\n",a,c);
if(a==c&&a!=b)
printf("%d %d\n",a,b);
if(b==c&&a!=b)
printf("%d %d\n",a,b);
if(a!=b&&a!=c&&b!=c)
printf("%d %d %d\n",a,b,c);
return 0;
}
|
a.cc:1:1: error: 'include' does not name a type
1 | include<stdio.h>
| ^~~~~~~
|
s016311019
|
p03962
|
C
|
include<stdio.h>
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b==c)
printf("%d\n",a);
if(a==b&&a!=c)
printf("%d %d\n",a,c);
if(a==c&&a!=b)
printf("%d %d\n",a,b);
if(b==c&&a!=b)
printf("%d %d\n",a,b);
if(a!=b&&a!=c&&b!=c)
printf("%d %d %d\n",a,b,c);
return 0;
}
|
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
|
s118283058
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector<int>color(3);
int ans;
ans=0;
for(int i=0;i<3;i++){
cin>>color.at(i);
}
if(color.at(0)!=color.at(1)){
ans++;
}
if(color.at(1)!=color.at(2)){
ans++;
}
if(color.at(1)!=color.at(2)){
ans++;
}
if(color.at(0)==color.at(1)){
if(color.at(1)==color.at(2)){
ans++;
}
}
|
a.cc: In function 'int main()':
a.cc:24:4: error: expected '}' at end of input
24 | }
| ^
a.cc:4:12: note: to match this '{'
4 | int main() {
| ^
|
s707072227
|
p03962
|
C++
|
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
int a,b,c; cin>>a>>b>>c;
int ans=3;
if(a==b) ans-=;
if(a==c) ans-=;
if(b==c) ans-=;
if(a==b && b==c) ans+=;
cout<<ans;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:10:17: error: expected primary-expression before ';' token
10 | if(a==b) ans-=;
| ^
a.cc:11:17: error: expected primary-expression before ';' token
11 | if(a==c) ans-=;
| ^
a.cc:12:17: error: expected primary-expression before ';' token
12 | if(b==c) ans-=;
| ^
a.cc:13:25: error: expected primary-expression before ';' token
13 | if(a==b && b==c) ans+=;
| ^
|
s268381584
|
p03962
|
C++
|
// RAM RAM
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define ppb pop_back
#define vi vector<int>
#define mp make_pair
#define arrayin(a,n) for(int i=0;i<n;i++){cin>>a[i];}
#define N 55
using namespace std;
int32_t main()
{
ios_base::sync_with_stdio(false);cin.tie(0);
set<int> s;
int a,b,c;cin>>a>>b>>c;
s.insert(a);
s.insert(b);
s.insert(c);
cout<<s,szie()<<endl;
return 0;
}
|
a.cc: In function 'int32_t main()':
a.cc:24:9: error: no match for 'operator<<' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'std::set<long long int>')
24 | cout<<s,szie()<<endl;
| ~~~~^~~
| | |
| | std::set<long long int>
| std::ostream {aka std::basic_ostream<char>}
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:3:
/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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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 'std::set<long long int>' 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; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>]'
301 | operator<<(const void* __p)
| ^~~~~~~~
/usr/include/c++/14/ostream:301:30: note: no known conversion for argument 1 from 'std::set<long long int>' to 'const void*'
301 | operator<<(const void* __p)
| ~~~~~~~~~~~~^~~
/usr/include/c++/14/ostream:306:7: note: candidate: 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::nullptr_t) [with _CharT = char; _Traits = std::char_traits<char>; __ostream_type = std::basic_ostream<char>; std::nullptr_t = std::nullptr_t]'
306 | operator<<(nullptr_t)
| ^~~~~~~~
/usr/include/c++/14/ostream:306:18: note: no known conve
|
s450758284
|
p03962
|
Java
|
046A'
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Set<Integer> hs = new HashSet<>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:1: error: class, interface, enum, or record expected
046A'
^
Main.java:1: error: illegal line end in character literal
046A'
^
2 errors
|
s658797975
|
p03962
|
Java
|
046A'
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Set<> hs = new HashSet<>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:1: error: class, interface, enum, or record expected
046A'
^
Main.java:1: error: illegal line end in character literal
046A'
^
Main.java:12: error: illegal start of type
Set<> hs = new HashSet<>();
^
3 errors
|
s687623691
|
p03962
|
Java
|
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Set<int> hs = new HashSet<>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:11: error: unexpected type
Set<int> hs = new HashSet<>();
^
required: reference
found: int
1 error
|
s331025459
|
p03962
|
Java
|
046A'
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
HashSet<int> hs = new HashSet<>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:1: error: class, interface, enum, or record expected
046A'
^
Main.java:1: error: illegal line end in character literal
046A'
^
2 errors
|
s837803529
|
p03962
|
Java
|
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
Set<int> hs = new HashSet<int>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
p
|
Main.java:20: error: reached end of file while parsing
p
^
1 error
|
s177176037
|
p03962
|
Java
|
046A'
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
HashSet<int> hs = new HashSet<int>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:1: error: class, interface, enum, or record expected
046A'
^
Main.java:1: error: illegal line end in character literal
046A'
^
2 errors
|
s819727196
|
p03962
|
Java
|
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
HashSet< int > hs = new HashSet<int>();
hs.add(a);
hs.add(b);
hs.add(c);
System.out.println(hs.size());
}
}
|
Main.java:10: error: unexpected type
HashSet< int > hs = new HashSet<int>();
^
required: reference
found: int
Main.java:10: error: unexpected type
HashSet< int > hs = new HashSet<int>();
^
required: reference
found: int
2 errors
|
s454713509
|
p03962
|
Java
|
046A
import java.util.*;
class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
int c = sc.nextInt();
int total = 3;
if(a == b || a == c || b == c){
total = 2;
}
if(a == b && a == c && b == c){
total = 1;
}
System.out.println(total);
}
}
|
Main.java:1: error: class, interface, enum, or record expected
046A
^
1 error
|
s390493630
|
p03962
|
C++
|
#include<bits/stdc++.h>
using namespace std;
int x;
map<int> a;
int main(){
cin>>x;a[x]++;
cin>>x;a[x]++;
cin>>x;a[x]++;
cout<<a.size()<<endl;
}
|
a.cc:4:8: error: wrong number of template arguments (1, should be at least 2)
4 | map<int> a;
| ^
In file included from /usr/include/c++/14/map:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
102 | class map
| ^~~
a.cc: In function 'int main()':
a.cc:6:11: error: invalid types 'int[int]' for array subscript
6 | cin>>x;a[x]++;
| ^
a.cc:7:11: error: invalid types 'int[int]' for array subscript
7 | cin>>x;a[x]++;
| ^
a.cc:8:11: error: invalid types 'int[int]' for array subscript
8 | cin>>x;a[x]++;
| ^
a.cc:9:11: error: request for member 'size' in 'a', which is of non-class type 'int'
9 | cout<<a.size()<<endl;
| ^~~~
|
s696095731
|
p03962
|
C++
|
#include<iostream>
using namespace std;
int x;
map<int> a;
int main(){
cin>>x;a[x]++;
cin>>x;a[x]++;
cin>>x;a[x]++;
cout<<a.size()<<endl;
}
|
a.cc:4:1: error: 'map' does not name a type
4 | map<int> a;
| ^~~
a.cc: In function 'int main()':
a.cc:6:10: error: 'a' was not declared in this scope
6 | cin>>x;a[x]++;
| ^
|
s013607164
|
p03962
|
C++
|
#include <iostream>
using namespace std;
typedef long long ll;
int main(){
set<ll>S;
for(ll i = 0; i < 3; i++){
ll x;
cin >> x;
S.insert(x);
}
cout << S.size() << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:8:5: error: 'set' was not declared in this scope
8 | set<ll>S;
| ^~~
a.cc:2:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
1 | #include <iostream>
+++ |+#include <set>
2 | using namespace std;
a.cc:8:11: error: expected primary-expression before '>' token
8 | set<ll>S;
| ^
a.cc:8:12: error: 'S' was not declared in this scope
8 | set<ll>S;
| ^
|
s714712066
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b,c;
cin>>a>>b>>c;
if(a!==b && a!==c && b!==c){
cout<<"3"<<endl;
}
if(a==b && b==c){
cout<<"1"<<endl;
}
else{
cout<<"2"<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:9: error: expected primary-expression before '=' token
7 | if(a!==b && a!==c && b!==c){
| ^
a.cc:7:18: error: expected primary-expression before '=' token
7 | if(a!==b && a!==c && b!==c){
| ^
a.cc:7:27: error: expected primary-expression before '=' token
7 | if(a!==b && a!==c && b!==c){
| ^
|
s323031999
|
p03962
|
Java
|
import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int[] data=new int[3];
for(int i=0;i<3;i++){
data[i]=sc.nextInt();
}
Arrays.sort(data);
if(data[0]==data[1]){
if(data[1]==data[2]){
System.out.println(1);
}else{
System.out.println(2);
}
}else{
if(data[1]==data[2]){
System.out.println(2)
}else{
System.out.println(3);
}
}
}
}
|
Main.java:19: error: ';' expected
System.out.println(2)
^
1 error
|
s794416410
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a,b;
cin >> a >>b ;
cout << b*((b-1)^(a-1)) << endl;
}
|
a.cc:14:2: error: '\U0000200b' does not name a type
14 | }
|
|
s492777044
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c, cnt=0;
cin >> a >> b >> c;
if (a==b && b==c) {
cout << 1;
return 0;
}
if (a!=b) cnt++;
if (a!=c) cnt++;
if (b!=c) cnt++;
cout << << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:14:12: error: expected primary-expression before '<<' token
14 | cout << << endl;
| ^~
|
s937631909
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin >>a>>b>>c;
if(a==b&&a==c)cout << 1 <<endl;
if(a =! b && a =! c) cout << 3 << endl;
else cout << 2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:15: error: lvalue required as left operand of assignment
7 | if(a =! b && a =! c) cout << 3 << endl;
| ~~~~^~~~
|
s498135667
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin >>a>>b>>c;
if(a==b&&a==c)cout << 1 <<endl;
if(a =! b && a =! c && c =! b) cout << 3 << endl;
else cout << 2 << endl;
}
|
a.cc: In function 'int main()':
a.cc:7:25: error: lvalue required as left operand of assignment
7 | if(a =! b && a =! c && c =! b) cout << 3 << endl;
| ~~~~^~~~
|
s168791484
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
int color = 3;
if(a==b || a==c) color--;
ir(b==c) color--;
cout << color << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:3: error: 'ir' was not declared in this scope
9 | ir(b==c) color--;
| ^~
|
s912752966
|
p03962
|
C
|
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d\n%d\n%d",&a,&b,&c);
if(a=b&&a=c){
printf("1");
}else if(a=b&&a!=c){
printf("2");
}else if(a=c&&a!=b){
printf("2");
}else if(c=b&&a!=c){
printf("2");
}else{
printf("3");
}
return 0;
}
|
main.c: In function 'main':
main.c:5:12: error: lvalue required as left operand of assignment
5 | if(a=b&&a=c){
| ^
|
s341177435
|
p03962
|
C
|
#include<stdio.h>
int main(){
int a,b,c;
scanf("%d\n%d\n%d",&a,&b,&c);
if(a=b&&a=c){
printf("1");
}else if(a=b&&a!=c){
printf("2");
}else if(a=c&&a!=b){
printf("2");
}else if(c=b&&a!=c){
printf("2");
}else if(a!=b!=c){
printf("3");
}
return 0;
}
|
main.c: In function 'main':
main.c:5:12: error: lvalue required as left operand of assignment
5 | if(a=b&&a=c){
| ^
|
s254276769
|
p03962
|
C++
|
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i < (n); ++i)
using namespace std;
int main(){
map<int,int> num;
rep(i,3){
int tmp = 0;
cin >> tmp;
map[tmp]++;
}
cout << map.size();
return 0;
}
|
a.cc: In function 'int main()':
a.cc:13:9: error: conflicting declaration 'auto tmp'
13 | map[tmp]++;
| ^~~
a.cc:10:9: note: previous declaration as 'int tmp'
10 | int tmp = 0;
| ^~~
a.cc:13:13: error: expected initializer before '++' token
13 | map[tmp]++;
| ^~
a.cc:16:14: error: missing template arguments before '.' token
16 | cout << map.size();
| ^
|
s758153026
|
p03962
|
C++
|
#include<bits/stdc++.h>
int main(){
map<int,int> m;
int a,b,c;
cin>>a>>b>>c;
m[a]++;
m[b]++;
m[c]++;
cout<<m.size()<<endl;
}
|
a.cc: In function 'int main()':
a.cc:3:5: error: 'map' was not declared in this scope
3 | map<int,int> m;
| ^~~
a.cc:3:5: note: suggested alternatives:
In file included from /usr/include/c++/14/map:63,
from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:102:11: note: 'std::map'
102 | class map
| ^~~
/usr/include/c++/14/map:89:13: note: 'std::pmr::map'
89 | using map
| ^~~
a.cc:3:9: error: expected primary-expression before 'int'
3 | map<int,int> m;
| ^~~
a.cc:5:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
5 | cin>>a>>b>>c;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
a.cc:6:5: error: 'm' was not declared in this scope
6 | m[a]++;
| ^
a.cc:9:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<m.size()<<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:9:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<m.size()<<endl;
| ^~~~
| std::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:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
744 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~
|
s857898492
|
p03962
|
C++
|
#include<stdc.h++>
int main(){
map<int,int> m;
int a,b,c;
cin>>a>>b>>c;
m[a]++;
m[b]++;
m[c]++;
cout<<m.size()<<endl;
}
|
a.cc:1:9: fatal error: stdc.h++: No such file or directory
1 | #include<stdc.h++>
| ^~~~~~~~~~
compilation terminated.
|
s758527886
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
set<int> colors;
colors.push(a);
colors.push(b);
colors.push(c);
cout << colors.size() << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:10: error: 'class std::set<int>' has no member named 'push'
9 | colors.push(a);
| ^~~~
a.cc:10:10: error: 'class std::set<int>' has no member named 'push'
10 | colors.push(b);
| ^~~~
a.cc:11:10: error: 'class std::set<int>' has no member named 'push'
11 | colors.push(c);
| ^~~~
|
s647939126
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, b, c;
cin >> a >> b >> c;
set<int> colors;
set.push(a);
set.push(b);
set.push(c);
cout << set.size() << endl;
return 0;
}
|
a.cc: In function 'int main()':
a.cc:9:6: error: expected unqualified-id before '.' token
9 | set.push(a);
| ^
a.cc:10:6: error: expected unqualified-id before '.' token
10 | set.push(b);
| ^
a.cc:11:6: error: expected unqualified-id before '.' token
11 | set.push(c);
| ^
a.cc:13:14: error: missing template arguments before '.' token
13 | cout << set.size() << endl;
| ^
|
s023932295
|
p03962
|
C++
|
#include<iostream>
using namespace std;
int main() {
int a,b,c ; cin >> a >> b >> c ;
if ( a==b and b==c ) cout << 1 ;
else if (a!=b and b!=c and a!c) cout << 3 ;
else cout << 2 ;
}
|
a.cc: In function 'int main()':
a.cc:10:31: error: expected ')' before '!' token
10 | else if (a!=b and b!=c and a!c) cout << 3 ;
| ~ ^
| )
|
s884999924
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main () {
int a, b, c;
cin >> a >> b >> c;
if ((a == b) && (a == c)){
cout << 1 << endl;
else if ((a != b) && (a != c) && (b != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:3: error: expected '}' before 'else'
11 | else if ((a != b) && (a != c) && (b != c)) {
| ^~~~
a.cc:8:28: note: to match this '{'
8 | if ((a == b) && (a == c)){
| ^
|
s073200907
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main () {
int a, b, c;
cin >> a >> b >> c;
if ((a == b) && (a == c)){
cout << 1 << endl;
}
if else ((a != b) && (a != c) && (b != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:6: error: expected '(' before 'else'
11 | if else ((a != b) && (a != c) && (b != c)) {
| ^~~~
| (
a.cc:14:3: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s756482513
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main () {
int a, b, c;
cin >> a >> b >> c
if ((a == b) && (a == c)){
cout << 1 << endl;
}
if else ((a != b) && (a != c) && (b != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:7:21: error: expected ';' before 'if'
7 | cin >> a >> b >> c
| ^
| ;
8 |
9 | if ((a == b) && (a == c)){
| ~~
a.cc:12:6: error: expected '(' before 'else'
12 | if else ((a != b) && (a != c) && (b != c)) {
| ^~~~
| (
a.cc:15:3: error: 'else' without a previous 'if'
15 | else {
| ^~~~
|
s536903517
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main () {
cin >> a;
cin >> b;
cin >> c;
if ((a == b) && (a == c)){
cout << 1 << endl;
}
if else ((a != b) && (a != c) && (b != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:14:6: error: expected '(' before 'else'
14 | if else ((a != b) && (a != c) && (b != c)) {
| ^~~~
| (
a.cc:17:3: error: 'else' without a previous 'if'
17 | else {
| ^~~~
|
s426216804
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main () {
cin >> a >> b >> c;
if ((a == b) && (a == c)){
cout << 1 << endl;
}
if else ((a != b) && (a != c) && (b != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:6: error: expected '(' before 'else'
11 | if else ((a != b) && (a != c) && (b != c)) {
| ^~~~
| (
a.cc:14:3: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s273468474
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main () {
cin >> a >> b >> c;
if ((a == b) && (a == c)){
cout << 1 << endl;
}
if else ((a != b) && (a != c)) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:6: error: expected '(' before 'else'
11 | if else ((a != b) && (a != c)) {
| ^~~~
| (
a.cc:14:3: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s558410149
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int a, b, c;
int main () {
cin >> a >> b >> c;
if (a == b && a == c){
cout << 1 << endl;
}
if else (a != b && a != c) {
cout << 3 << endl;
}
else {
cout << 2 << endl;
}
}
|
a.cc: In function 'int main()':
a.cc:11:6: error: expected '(' before 'else'
11 | if else (a != b && a != c) {
| ^~~~
| (
a.cc:14:3: error: 'else' without a previous 'if'
14 | else {
| ^~~~
|
s557745717
|
p03962
|
C
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
scanf("&d\n",a);
scanf("&d\n", b);
scanf("&d\n", c);
if (a == b == c) {
printf("1\n");
}
else if(a!=b && a!=c){
printf("3\n");
}
else {
printf("2\n");
}
}
|
main.c: In function 'main':
main.c:7:22: error: 'a' undeclared (first use in this function)
7 | scanf("&d\n",a);
| ^
main.c:7:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:31: error: 'b' undeclared (first use in this function)
8 | scanf("&d\n", b);
| ^
main.c:9:31: error: 'c' undeclared (first use in this function)
9 | scanf("&d\n", c);
| ^
|
s630630808
|
p03962
|
C
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
scanf("&d\n",a)
scanf("&d\n", b)
scanf("&d\n", c)
if (a == b == c) {
printf("1\n");
}
else if(a!=b && a!=c){
printf("3\n");
}
else {
printf("2\n");
}
}
|
main.c: In function 'main':
main.c:7:22: error: 'a' undeclared (first use in this function)
7 | scanf("&d\n",a)
| ^
main.c:7:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:24: error: expected ';' before 'scanf'
7 | scanf("&d\n",a)
| ^
| ;
8 | scanf("&d\n", b)
| ~~~~~
|
s328180309
|
p03962
|
C++
|
#include <bits/stdc++.h>
using namespace std;
int main() {
vector(int) x(3);
cin>>x.at(0)>>x.at(1)>>x.at(2);
sort(x.begin(), x.end());
if(x.at(0)!=x.at(1)){
cout<<3<<endl;
}
if(x.at(0)==x.at(1) && x.at(0)!=x.at(2)){
cout<<2<<endl;
}
if(x.at(0)==x.at(1) && x.at(0)==x.at(2)){
cout<<1<<endl;
}
}
|
a.cc: In function 'int main()':
a.cc:5:9: error: missing template arguments before '(' token
5 | vector(int) x(3);
| ^
a.cc:5:10: error: expected primary-expression before 'int'
5 | vector(int) x(3);
| ^~~
a.cc:6:8: error: 'x' was not declared in this scope
6 | cin>>x.at(0)>>x.at(1)>>x.at(2);
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.