結果
問題 | No.188 HAPPY DAY |
ユーザー |
![]() |
提出日時 | 2018-02-28 15:47:09 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 839 bytes |
コンパイル時間 | 818 ms |
コンパイル使用メモリ | 69,500 KB |
実行使用メモリ | 6,816 KB |
最終ジャッジ日時 | 2024-12-21 10:24:30 |
合計ジャッジ時間 | 1,231 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
// No.188 HAPPY DAY// https://yukicoder.me/problems/no/188//#include <iostream>#include <iomanip>using namespace std;bool is_happy_day(int mm, int dd);int main() {int hit = 0;for (auto mm = 1; mm <= 12; mm++) {for (auto dd = 1; dd <= 31; dd++) {if (mm == 4 || mm == 6 || mm == 9 || mm == 11) {if (dd > 30)continue;} else if (mm == 2) {if (dd > 28)continue;}if (is_happy_day(mm, dd)) {// cout << mm << "/" << dd << endl;hit++;}}}cout << hit << endl;}bool is_happy_day(int mm, int dd) {int dd_total = 0;while (dd > 0) {dd_total += (dd % 10);dd /= 10;}return mm == dd_total;}