-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10a.cpp
More file actions
30 lines (29 loc) · 658 Bytes
/
10a.cpp
File metadata and controls
30 lines (29 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
//#include <bits/stdc++.h>
using namespace std;
map<int,int> cuantos={{1,0},{3,0}};
vector<int> line;
int main(){
int dato;
while(cin>>dato){
line.push_back(dato);
}
line.push_back(0);
line.push_back(*max_element(line.begin(),line.end())+3);
sort(line.begin(),line.end());
for(int x=1;x<=line.size()-1;x++){
int temp=line[x]-line[x-1];
if(temp==1)cuantos[1]++;
if(temp==3)cuantos[3]++;
}
int temp1=1;
for(auto c: cuantos){
temp1*=c.second;
}
cout<<temp1<<endl;
}