Namareba食べたい

備忘録てきなもの。だらだら書いていきます。

ICPC国内予選A問題 カレンダー

ICPC国内予選のA問題の回答

かれんだー

書くだけ。

#include<iostream>

#include<cstdio>

#include<algorithm>

#include<cmath>

using namespace std;

 

int main(){

   int n;

   cin >> n;

   while(n-- > 0){

      

      int y,m,d;

      int ans = 0;

 

      cin >> y >> m >> d;

 

      for(int i = m+1;i <= 10;i++){

if(y % 3 == 0){

   ans += 20;

}else{

   if(i % 2 == 0){

      ans += 19;

   }else{

      ans += 20;

   }

}

      }

 

      if(y % 3 == 0){

ans += 20 - d + 1;

      }else{

if(m % 2 == 0){

   ans += 19 - d + 1;

}else{

   ans += 20 - d + 1;

}

      }

 

 

 

      for(int i = y+1;i < 1000;i++){

if(i % 3 == 0){

   ans += 200;

}else{

   ans += 195;

}

      }

 

 

      cout << ans << endl;

 

   }

   return 0;

}