Solution for CCC '14 J3 - Double Dice in C++


April 17, 2020 0.044037 seconds C++
#include <iostream>

int main() {
  std::ios::sync_with_stdio(0); std::cin.tie(0); std::cout.tie(0);
  
  int n, a, d, p1 = 100, p2 = p1;
  std::cin >> n;
  for(int i = 0; i < n; i++){
  
	std::cin >> a >> d; 
	
	if(a > d){
		p2 -= a;
	}else if(d > a){
		p1 -= d;
	}
  
}

std::cout << p1 << "\n" << p2;  
  
 }

Editorial


No editorial for this problem. :(

Original Problem


You can view the original page for this problem on the DMOJ.