Search is not available for this dataset
name
stringlengths
2
112
description
stringlengths
29
13k
source
int64
1
7
difficulty
int64
0
25
solution
stringlengths
7
983k
language
stringclasses
4 values
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<cstdio> using namespace std; int main(){ int a,b,c,cnt=1; scanf("%d %d %d",&a,&b,&c); if(a!=b) cnt++; if(a!=c&&b!=c) cnt++; printf("%d\n",cnt); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
w = set(map(int, input().split())) print(len(w))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
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 = 3; if(a == b){ ans--; } if(a == c){ ans--; } if(b == c){ ans--; } if(a == b && b == c && a == c){ ans = 1; } System.out.println(ans); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
from collections import Counter S = raw_input().strip().split() print len(Counter(S))
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a==b&&b==c)printf("1\n"); else if(a==b||b==c||c==a)printf("2\n"); else printf("3\n"); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a, b, c = map(int, raw_input().split()) ans = 0 if a == b == c: ans = 1 elif a == b or b == c or c == a: ans = 2 else: ans = 3 print ans
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Set<Integer> set = new HashSet<>(); int cnt = 0; int n = 3; for (int i = 0; i < n; i++) { if (!set.add(sc.nextInt())) continue; cnt++; } System.out.println(cnt); sc.close(); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
p = input().split() print(len(set(p)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; set<int> s; int main(){ for (int i=0;i<3;i++){ int t;cin>>t; s.insert(t); }cout<<s.size()<<endl; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner in=new Scanner (System.in); int []a=new int[3]; int c=3; for (int i = 0; i < a.length; i++) { a[i]=in.nextInt(); } Arrays.sort(a); for (int i = 1; i < a.length; i++) { if(a[i]==a[i-1]) { c--; } } System.out.println(c); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
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(); if (a == b && b == c) { System.out.println(1); } else if (a == b || b == c || c == a) { System.out.println(2); } else { System.out.println(3); } sc.close(); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <stdio.h> int main(){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a!=b && a!=c && b!=c) printf("3"); else if(a==b && a==c) printf("1"); else printf("2"); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; 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(); if(a == b && b == c) { System.out.println(1); return; } if(a == b || b == c || a == c) { System.out.println(2); return; } System.out.println(3); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
x = {i for i in input().split()} print(len(x))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; set<int>st; int main() { int a , b ,c ; cin>>a>>b>>c; st.insert(a);st.insert(b);st.insert(c); cout<<st.size(); return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner scanner =new Scanner(System.in); Set<Integer> color = new HashSet<Integer>(); color.add(scanner.nextInt()); color.add(scanner.nextInt()); color.add(scanner.nextInt()); System.out.println(color.size()); scanner.close(); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main(){ int ans = 1, a, b, c; cin >> a >> b >> c; ans += a != b; ans += c != a && c != b; cout << ans << endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
xs = map(int, raw_input().split()) print len(set(xs))
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
paints = raw_input().split() paints_uniq = list(set(paints)) print(len(paints_uniq))
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a = list(input().split()) ans = len(set(a)) print(ans)
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
lists = input().split() print(len(set(lists)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<stdio.h> #include<iostream> using namespace std; int a,b,c; int main (){ cin >> a >> b >> c; cout << (a!=b) + (b!=c) + (a!=c) + (a==b&&b==c)<< endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
s = input().split() s = set(s) print(len(s))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.stream.*; import java.util.*; public class Main { static Scanner scanner = new Scanner(System.in); public static void main(String[]$) { System.out.println(IntStream.range(0, 3).map(i -> scanner.nextInt()).distinct().count()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a,b,c = map(int, raw_input().split()) if a == b and b == c: print 1 elif a == b or b == c or a == c: print 2 else: print 3
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a=list(set(map(int,input().split()))) print(len(a))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; 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 num = 3; if(a == b && b == c){ num = 1; }else if(a == b || b == c || c == a){ num = 2; } System.out.println(num); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main(){ set<int> a; for(int i=0; i<3; i++){ int b; cin >> b; a.insert(b); } cout << a.size() << endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner scan = new Scanner(System.in); int[] n = new int[101]; int[] c = new int[3]; for(int i = 0; i < 3; i++){ c[i] = scan.nextInt(); n[c[i]]++; } int count = 0; for(int i = 1; i < 101; i++){ if(n[i] != 0){ count++; } } System.out.println(count); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <cstdio> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); int res = 1; if (b != a) ++res; if (c != a && c != b) ++res; printf("%d\n", res); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
try: color = map(int, raw_input().split(" ")) count_col=list(set(color)) print len(count_col) except EOFError: pass
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a = raw_input().split() print len(set(a))
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <iostream> #include <set> using namespace std; int a,b,c; int main(){ cin >> a >> b >> c; set<int> s; s.insert(a); s.insert(b); s.insert(c); cout << s.size() << endl; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
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(); 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); } } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); 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 || b == c || c == a) { System.out.println("2"); }else { System.out.println("3"); } } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a[] = new int[3]; a[0] = sc.nextInt(); a[1] = sc.nextInt(); a[2] = sc.nextInt(); Arrays.sort(a); int result = 1; if(a[0] != a[1]){ result++; } if(a[1] != a[2]){ result++; } System.out.println(result); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a=input().split() b=list(set(a)) print(len(b))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
N = map(int,input().split()) print(len(set(N)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; int main() { unordered_set<int> k; for(int i=0; i<3; i++) { int x; cin >> x; k.insert(x); } cout << k.size(); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
def ans(): l = list(map(int, raw_input().split())) if l[0] == l[1] and l[1] == l[2]: print 1 return 1 elif l[0] == l[1] or l[1] == l[2] or l[2] == l[0]: print 2 return 2 else: print 3 return 3 if __name__ == '__main__': ans = ans()
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
# -*- coding: utf-8 -*- a, b, c = map(int, raw_input().split()) if a == b and b == c: print 1 elif a != b and b != c and a != c: print 3 else: print 2
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; cout << (a!=b)+(a!=c)+(b!=c)+(a==b&&b==c&&c==a) << endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean[] map = new boolean[101]; for (int i = 0; i < 3; i++) { map[sc.nextInt()] = true; } int ans = 0; for (boolean b : map) { ans +=b?1:0; } System.out.println(ans); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { 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()); Set<Integer>s=new HashSet(); s.add(a); s.add(b); s.add(c); System.out.println(s.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
*k, = map(int, input().split()) print(len(set(k)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
l = input().split() print(len(set(l)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int ans=3; int a=sc.nextInt(); int b=sc.nextInt(); int c=sc.nextInt(); if(a==b) { if(b!=c) { ans=2; }else { ans=1; } }else if(b==c) { if(c!=a) { ans=2; } }else if(c==a) { if(a!=b) { ans=2; } } System.out.println(ans); sc.close(); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c; cin >> a >> b >> c; int ans = 1; if(a != b) ans++; if(a != c && b != c) ans++; cout << ans << endl; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
ls = set(map(int, input().split())) print(len(ls))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); Set<Integer> set = new HashSet<Integer>(); set.add(scan.nextInt()); set.add(scan.nextInt()); set.add(scan.nextInt()); System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
p = list(map(int,input().split())) print (len(set(p)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
x = [i for i in input().split()] print(len(set(x)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
s = {x for x in input().split()} print(len(s))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a,b,c=map(int,raw_input().split()) if a==b and a!=c or b==c and b!=a or c==a and c!=b: print "2" elif a==b and b==c: print "1" else: print "3"
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; 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(); sc.close(); Set<Integer> set = new HashSet<>(); set.add(a); set.add(b); set.add(c); System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
a={int(i) for i in input().split()} print(len(a))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#2019/09/25 N = input().split() print(len(set(N)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
l = map(int, input().split()) print(len(set(l)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <iostream> using namespace std; int main() { int a,b,c,ans=1; cin >> a >> b >> c; if(a!=b){ ans++; } if(b!=c && c!=a){ ans++; } cout << ans; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; 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(); if(a==b&&b==c)System.out.println(1); else if(a!=b&&b!=c&&c!=a) System.out.println(3); else System.out.println(2); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); if (a == b && a == c && b == c) { System.out.println(1); } else if (a == b && a != c || a == c && a != b || b == c && c != a) { System.out.println(2); } else { System.out.println(3); } } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { 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()); Set<Integer> ans = new HashSet<Integer>(); ans.add(a); ans.add(b); ans.add(c); System.out.println(ans.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; import java.util.stream.IntStream; public class Main { private static final int NUM = 3; public static void main(String[] args) { try (Scanner scanner = new Scanner(System.in)) { Set<Integer> set = new HashSet<>(); IntStream.range(0, NUM).forEach(i -> set.add(scanner.nextInt())); System.out.println(set.size()); } } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
print(len(set(list(map(int, input().split())))));
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
print len(set(map(int, raw_input().split())))
PYTHON
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
lst = input().split() print(len(list(set(lst))))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); Set<Integer> s = new HashSet<Integer>(); s.add(a); s.add(b); s.add(c); System.out.println(s.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <iostream> #include <set> int main() { std::set<int> s; for (int i = 0; i < 3; ++i) { int a; std::cin >> a; s.insert(a); } std::cout << s.size() << std::endl; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
s = input().split() print(len(set(s)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <stdio.h> #include <math.h> int main(){ int a,b,c; scanf("%d %d %d",&a,&b,&c); int count=1; if(a!=b){count++;} if(a!=c && b!=c){count++;} printf("%d\n",count); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
s = input().split() ans = len(list(set(s))) print(ans)
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; 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 count = 0; if (a == b && b == c) { count ++; } if (a != b) { count ++; } if (b != c) { count ++; } if (c != a) { count ++; } System.out.println(count); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Set<Integer> set = new HashSet<>(); while(sc.hasNext()) { set.add(sc.nextInt()); } System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; cout << (a != b) + (a != c) + (b != c) + (a == b && b == c); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; import java.util.Set; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long A = sc.nextLong(); long B = sc.nextLong(); long C = sc.nextLong(); Set<Long> set = new HashSet<>(); set.add(A); set.add(B); set.add(C); System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Scanner; 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 = 3; if(a == b){ ans--; } if( b == c){ ans--; } if(c == a){ ans--; } if( a == b&& b == c){ ans++; } System.out.println(ans); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main() { int x[3]; cin >> x[0] >> x[1] >> x[2]; set<int> set{{x[0]}, {x[1]}, {x[2]}}; cout << set.size() << endl; getchar(); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
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(); if (a==b && b==c && c==a) System.out.println("1"); else if (a==b || b==c || c==a) System.out.println("2"); else System.out.println("3"); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
colors = input().split() print(len(set(colors)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); HashSet<Integer> res = new HashSet<>(); res.add(sc.nextInt()); res.add(sc.nextInt()); res.add(sc.nextInt()); System.out.println(res.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); boolean bucket[] = new boolean[105]; for(int i = 0; i < 3; i ++) { bucket[sc.nextInt()] = true; } long count = 0; for(int i = 0; i < bucket.length; i ++) { if(bucket[i]) { count ++; } } System.out.println(count); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc= new Scanner(System.in); HashSet set = new HashSet(); set.add(sc.nextInt()); set.add(sc.nextInt()); set.add(sc.nextInt()); System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<iostream> using namespace std; int main(){ int a,b,c,p=3; cin>>a>>b>>c; if(a == b){ p--; } if(a == c || b == c){ p--; } cout<<p<<endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
abc=set(map(int,input().split())) print(len(abc))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; int main() { int a[3]; cin >> a[0] >> a[1] >> a[2]; sort(a, a+3); printf("%d\n", unique(a,a+3)-a); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <iostream> int main(){int a,b,c;std::cin>>a>>b>>c;std::cout<<((a!=b)+(b!=c)+(c!=a)+1)/2+1;}
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main() { int a,b,c;cin>>a>>b>>c; int count=1; if (a!=b) count++; if (a!=c && b!=c) count++; cout<<count<<endl; return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { boolean[] b = new boolean[101]; for (int i = 0;i < 3;i++) { b[sc.nextInt()] = true; } int ret = 0; for (int i = 1;i <= 100;i++) { if (b[i]) ret++; } System.out.println(ret); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; int n=1; if (a!=b) n+=1; if (a!=c && b!=c) n+=1; cout << n << "\n"; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <iostream> int main(){ int A,B,C; std::cin>>A>>B>>C; int v=1; if(A!=B){++v;} if(C!=A&&C!=B){++v;} std::cout<<v; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
print(len(set(input().split(" "))))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; 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(); if((a==b) && (b==c)){ System.out.println("1"); }else if((a==b && b!=c) || (b==c && b!=a) ||(a==c && b!=a)){ System.out.println("2"); }else{ System.out.println("3"); } } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<bits/stdc++.h> using namespace std; int main(void) { set<int> Set; int a,b,c; cin>>a>>b>>c; Set.insert(a); Set.insert(b); Set.insert(c); cout<<Set.size(); }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include<stdio.h> int a,b,c; int main() { scanf("%d%d%d",&a,&b,&c); printf("%d",a==b&&a==c&&b==c?1:(a==b||a==c||b==c?2:3)); return 0; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
ary = map(int, input().split()) print(len(set(ary)))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.*; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner s=new Scanner(System.in); int a=s.nextInt(); int b=s.nextInt(); int c=s.nextInt(); int kind=3; if(a==b)kind--; if(b==c)kind--; if(a==c)kind--; if(kind==0)kind++; System.out.print(kind); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet<Integer> set = new HashSet<>(); for (int i = 0; i < 3; i++) { set.add(sc.nextInt()); } System.out.println(set.size()); } }
JAVA
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
p=input().rstrip().split(' ') print(len(list(set(p))))
PYTHON3
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
#include <bits/stdc++.h> using namespace std; int main(){ set<int> color; for(int i=0;i<3;i++){ int x; cin>>x; color.insert(x); } cout<<color.size()<<endl; }
CPP
p03962 AtCoder Beginner Contest 046 - AtCoDeer and Paint Cans
AtCoDeer the deer recently bought three paint cans. The color of the one he bought two days ago is a, the color of the one he bought yesterday is b, and the color of the one he bought today is c. Here, the color of each paint can is represented by an integer between 1 and 100, inclusive. Since he is forgetful, he might have bought more than one paint can in the same color. Count the number of different kinds of colors of these paint cans and tell him. Constraints * 1≦a,b,c≦100 Input The input is given from Standard Input in the following format: a b c Output Print the number of different kinds of colors of the paint cans. Examples Input 3 1 4 Output 3 Input 3 3 33 Output 2
6
0
import java.util.Map; import java.util.Scanner; import java.util.TreeMap; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); Map<Integer,Integer> map = new TreeMap<Integer,Integer>(); for(int i=0;i<3;i++) { map.put(scanner.nextInt(), 0); } System.out.println(map.size()); scanner.close(); } }
JAVA