Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <algorithm>
- using namespace std;
- int n;
- float all[12];
- string color, type;
- int main(){
- ifstream fin("input.txt");
- ofstream fout("output.txt");
- fin>>n;
- for(int i=0;i<n;i++){
- fin>>color>>type;
- if (color=="white"){
- if(type=="pawn"){
- all[0]+=0.125;
- continue;
- }
- if(type=="rook"){
- all[1]+=0.5;
- continue;
- }
- if(type=="bishop"){
- all[2]+=0.5;
- continue;
- }
- if(type=="knight"){
- all[3]+=0.5;
- continue;
- }
- if(type=="king"){
- all[4]++;
- continue;
- }
- if(type=="queen"){
- all[5]++;
- continue;
- }
- }
- else if (color=="black"){
- if(type=="pawn"){
- all[6]+=0.125;
- continue;
- }
- if(type=="rook"){
- all[7]+=0.5;
- continue;
- }
- if(type=="bishop"){
- all[8]+=0.5;
- continue;
- }
- if(type=="knight"){
- all[9]+=0.5;
- continue;
- }
- if(type=="king"){
- all[10]++;
- continue;
- }
- if(type=="queen"){
- all[11]++;
- continue;
- }
- }
- }
- sort(all,all+12);
- fout<<(int)all[0];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement