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
paint = input().split(" ") print(len(set(paint)))
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()) d = {a,b,c} print len(d)
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() { set<int>a; int x; for (int i=1;i<=3;++i) { cin>>x; a.insert(x); } cout<<a.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 <iostream> using namespace std; int main(void){ int a,b,c,cnt=1; cin >> a>>b>>c; if(a!=b) cnt++; if(a!=c&&b!=c) cnt++; cout<<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
n = input().split() m = set(n) print(len(m))
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 result = 3; if (a == b) { result--; } if (a == c) { result--; } if (b == c) { result--; } if (result == 0) { result = 1; } 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=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
#include <bits/stdc++.h> using namespace std; int main(){ set<int> s; for(int i=0;i<3;i++){ int x; cin >> x; s.insert(x); } cout << s.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
s = list(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
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
caralist = input().split() print(len(set(caralist)))
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); 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 && a != c) { 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.*; public class Main{ public static void main(String[] args) { Set colorSet = new HashSet(); Scanner sc = new Scanner(System.in); int color1 = sc.nextInt(); int color2 = sc.nextInt(); int color3 = sc.nextInt(); colorSet.add(color1); colorSet.add(color2); colorSet.add(color3); System.out.println(colorSet.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;cin>>a>>b>>c; int ans=3; if(a==b&&b==c)ans=1; else if(a==b||b==c||c==a) ans=2; 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
import java.util.*; 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++){ int t = sc.nextInt(); set.add(t); } 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=input().split(" ") b=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
def main(): colors = [int(x) for x in raw_input().split()] print(len(set(colors))) main()
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
print(len(set((int(i) for i in 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
#include<stdio.h> int main() { int a,b,c,n; scanf("%d %d %d",&a,&b,&c); if(a!=b&&a!=c&&b!=c) printf("3"); else if(a==b&&b==c&&a==c) printf("1"); else printf("2"); 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
a,b,c=map(int,raw_input().split()) col=[a,b,c] col_kind=[] for i in col: if i in col_kind: pass else: col_kind.append(i) print len(col_kind)
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.Scanner; public class Main{ public static void main(String[]args) { Scanner input=new Scanner(System.in); int a; int b; int c; do { a=input.nextInt(); b=input.nextInt(); c=input.nextInt(); }while(a<1&&a>100&&b<1&&b>100&&c<1&&c>100); if(a==b&&b==c) { System.out.println("1"); }else if((a!=b&&b==c)||(a==b&&b!=c)||(a==c&&b!=c)) { 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.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<>(); set.add(sc.nextInt()); set.add(sc.nextInt()); set.add(sc.nextInt()); sc.close(); 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() { set<int> c; for(int i = 0; i < 3; i++) { int t; scanf("%d", &t); c.insert(t); } printf("%d\n", c.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<cstdio> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if(a!=b&&b!=c&&c!=a) printf("3"); else if(a==b&&b==c&&c==a) printf("1"); else printf("2"); 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 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"); } } }
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 bisect import sys import math import itertools sys.setrecursionlimit(10000) INF = float('inf') # input macro def i(): return int(raw_input()) def ii(): return map(int,raw_input().split(" ")) def s(): return raw_input() def ss(): return raw_input().split(" ") def slist(): return list(raw_input()) # def join(s): return ''.join(s) #iterate macro def piter(n,m): return itertools.permutations(n,m) def citer(n,m): return itertools.combinations(n,m) #modulo macro def modc(a,b,m): c = 1 for i in xrange(b): c = c * (a - i) % m c = c * modinv(i + 1,m) % m return c def gcd(a, b): (x, lastx) = (0, 1) (y, lasty) = (1, 0) while b != 0: q = a // b (a, b) = (b, a % b) (x, lastx) = (lastx - q * x, x) (y, lasty) = (lasty - q * y, y) return (lastx, lasty, a) def modinv(a, m): (inv, q, gcd_val) = gcd(a, m) return inv % m #bisect macro def index(a, x): #Locate the leftmost value exactly equal to x i = bisect_left(a, x) if i != len(a) and a[i] == x: return i return -1 #memoize macro def memoize(f): cache = {} def helper(*args): if args not in cache: cache[(args)] = f(*args) return cache[args] return helper @memoize def nck(a,b,m): b = min([a-b,b]) if (b>a or b<0 or a<0): return 0 elif a == 0: return 1 return (nck(a-1,b-1,m)+nck(a-1,b,m)) % m nh=zip([1,0,-1,0],[0,1,0,-1]) ########### a,b,c=ii() x=[a] if b not in x: x.append(b) if c not in x: x.append(c) print len(x)
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
list = input().split() print(len(set(list)))
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 = map(int,input().split()) s = set(a) 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
l = set(list(map(int, input().split()))) print(len(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; cin>>a>>b>>c; int count=1; if(b!=a)count++; if((c!=a) && (c!=b))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
#include <iostream> using namespace std; int main(void){ int a,b,c; cin>>a>>b>>c; if (a==b && b==c){cout<<1;} else if (a==b || b==c || a==c){cout<<2;} else cout<<3; }
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; #define REP(i,n) for(int(i)=0;i<(n);i++) int main(){ int a; map<int,int> m; REP(i,3){ cin>>a; m[a]++; } cout<<m.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 <iostream> #include <map> using namespace std; int main(){ int a,b,c,kind=0; cin>>a>>b>>c; map<int,int> m; m[a]=1; m[b]=1; m[c]=1; cout << m.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"bits/stdc++.h" int main(){int a,b,c;std::cin>>a>>b>>c;std::cout<<(3-std::min((a==b)+(a==c)+(b==c),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(); int SUM = 1; if(A == B && A == C) { }else if(A != B && A != C && B != C) { SUM = 3; }else{ SUM = 2; } System.out.print(SUM); } }
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> 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
S = map(int, 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
L=list(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
print(len({n for n in 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
#include<bits//stdc++.h>> using namespace std; int main(){ set<int> st;int n; for(int i = 0; i <3;i++){ cin >> n;st.insert(n); }cout <<st.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
a = [int(x) for x in raw_input().split()] dic = {} for x in a: dic[x] = 1 print len(dic)
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 && b==c ? 1 : (a!=b && b!=c && c!=a? 3 : 2)) << 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
#include<iostream> #include<cstdio> using namespace std; int a,b,c; int main() { scanf("%d%d%d",&a,&b,&c); printf("%d",3-min((a==b)+(a==c)+(b==c),2)); 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
print(len(set([int(n) for n in 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
A = list(input().split()) print(len(set(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
abc = list(input().split()) print(len(set(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(){ set<int> s; for(int i=0;i<3;i++){ int a; cin>>a; s.insert(a); } 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
ns = set(map(int, input().split())) print(len(ns))
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,h; cin>>a>>b>>h; if(a==b&&b==h) cout<<1; else if(a==b||b==h||h==a) cout<<2; else cout<<3; }
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(); int cnt = 3; if(a==b)cnt--; if(b==c)cnt--; if(a==c)cnt--; if(a==b&&b==c)cnt++; System.out.println(cnt); } }
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 = map(int,raw_input().split(" ")) b = a[0] c = a[1] d = a[2] cnt = 3 if b == c: cnt = cnt -1 if b == d: cnt = cnt -1 if c == d: cnt = cnt -1 if c == d and c == b and b == d: cnt = cnt + 1 print cnt
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,b,c=map(int,input().split()) s={a,b,c} 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
#include<bits/stdc++.h> using namespace std; int main(){ int a, b, c; scanf("%d%d%d", &a, &b, &c); printf("%d", (a == b ? a == c ? 1 : 2 : a == c ? 2 : b == c ? 2 : 3)); }
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; import java.util.HashSet; import java.lang.String; public class Main { public static void main (String[] arg) { Scanner sc = new Scanner(System.in); HashSet<Integer> colors = new HashSet<Integer>(); colors.add(sc.nextInt()); colors.add(sc.nextInt()); colors.add(sc.nextInt()); sc.close(); int result = colors.size(); 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
# vim: set fileencoding=utf-8: def main(): print(len(set(map(int, raw_input().split())))) if __name__ == "__main__": main()
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 main (){ set<int> ans; for (int i = 0; i < 3; i++) { int sub; cin >> sub; ans.insert(sub); } cout <<ans.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; class Main{ public static void main(String[] args){ Scanner scanner=new Scanner(System.in); int a = scanner.nextInt(); int b = scanner.nextInt(); int c = scanner.nextInt(); if(a==b && a==c){ System.out.println(1); }else if(a==b || a==c || b==c){ 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
Array= list(input().split()) print(len(set(Array)))
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
Can = set(input().split()) print(len(Can))
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 { private static Main instance = new Main(); private Scanner scanner = new Scanner(System.in); public static void main(String[] args) { instance.solve(); } private void solve() { int answer = 1; int a = scanner.nextInt(); int b = scanner.nextInt(); if(a != b) answer++; int c = scanner.nextInt(); if(c != a && c != b) answer++; System.out.printf("%d", answer); } }
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 = set(map(int, input().split())) print(len(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
import math a = set(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
#include <bits/stdc++.h> using namespace std; int a[3]; int main(){ for(int i=0;i<3;i++)scanf("%d",a+i);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
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 || a == c){ 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
l = list(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 scan = new Scanner(System.in); int a = scan.nextInt(); int b = scan.nextInt(); int c = scan.nextInt(); int count = 1; if(a != b && a != c){ count += 1; } if(b != c){ count += 1; } 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
a, b, c = map(int, raw_input().split()) print(len(set([a,b,c])))
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
li = input().split() print(len(set(li)))
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(list(set(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
a, b, c = map(int, raw_input().split()) answer = 1 if b != a: answer += 1 if c != a and c != b: answer += 1 print answer
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
X = set(map(int,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<cstdio> int main() { int a,b,c,ans; scanf("%d%d%d",&a,&b,&c); if(a==b&&b==c) ans=1; else if(a==b||a==c||b==c) ans=2; else ans=3; printf("%d\n",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
a = raw_input() a = [i for i in a.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<bits/stdc++.h> using namespace std; int main() { set<int> n; for(int i = 0; i < 3; i++) { int a; cin>>a; n.insert(a); } cout<<n.size()<<"\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 = [int(x) for x in raw_input().split(" ")] if a == b and b == c and c == a: print 1 elif a == b or b == c or c == a: 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,b,c=input().split() set={a,b,c} print(len(set))
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; import java.util.stream.IntStream; public class Main{ static final Scanner s=new Scanner(System.in); public static void main(String[] __){ System.out.println(IntStream.of(s.nextInt(),s.nextInt(),s.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
#include <bits/stdc++.h> int main() { int a, b, c; std::cin >> a >> b >> c; std::set<int> s = {a, b, c}; std::cout << s.size() << std::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
#include<bits/stdc++.h> using namespace std; int main(){ set<int>list; for(int i=0;i<3;i++){ int N; cin>>N; list.insert(N); } cout<<list.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.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); HashSet<Integer> hs = new HashSet<>(); hs.add(sc.nextInt()); hs.add(sc.nextInt()); hs.add(sc.nextInt()); System.out.println(hs.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> using namespace std; int main() { int a, b, c; cin >> a >> b >> c; set<int> res{a, b, c}; cout << res.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
x = map(int, 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
#include <iostream> using namespace std; int main(void){ int a,b,c; cin>>a>>b>>c; if(a==b&&b==c) cout<<1; else if(a==b||b==c||a==c) cout<<2; else cout<<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
#include<iostream> using namespace std; int main(){ int a,b,c; cin>>a>>b>>c; if(a==b && a==c)cout<<1; else if(a==b || a==c || b==c)cout<<2; else cout<<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
abc = raw_input().split() print len(set(abc))
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
abc=input().split() sort=set(abc) print(len(sort))
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 = len(set(map(int, input().split()))) print(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
s = list(map(int,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<bits/stdc++.h> using namespace std; int a[3],cnt=3; int main(){ cin>>a[0]>>a[1]>>a[2];sort(a,a+3); if(a[0]==a[1])cnt--; if(a[1]==a[2])cnt--; cout<<cnt<<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; import java.util.stream.Stream; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); int c = sc.nextInt(); long ans = Stream.of(a, b, c).distinct().count(); 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
print(len({int(x) for x in 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
#include<bits/stdc++.h> using namespace std; set<int>se; int main(){ int a,b,c;cin>>a>>b>>c; se.insert(a);se.insert(b);se.insert(c); printf("%d\n",se.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
print(len(set(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
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 = 3; if (a == b && b == c && c == a) { System.out.println(1); } else { 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
#include<iostream> #include<map> using namespace std; int main(){ map<int,int> m; for(int i = 0;i < 3;i++){ int a; cin >> a; m[a]++; } cout << m.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
#include "bits/stdc++.h" using namespace std; int main(){ int a,b,c,ans=3; cin>>a;cin>>b;if(a==b)--ans; cin>>c;if(a==c||b==c)--ans; cout<<ans; }
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=set([int(x) for x 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
a,b,c = raw_input().split() a=int(a) b=int(b) c=int(c) A = {a:1,b:1,c:1} print len(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
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){ 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
L=set(list(map(int,input().split()))) print(len(L))
PYTHON3