LeetCode Weekly Contest 149 1問目 - Day of the Year [1154]

Source

LeetCode Weekly Contest 149
問題文

問題概要

省略

解法

省略

cLayversion 20190818-1)のコード

C++に変換後のコードはこちら

#define main dummy_main
{}
#undef main

class Solution {
public:
  int dayOfYear(string date) {
    int y, m, d, res=0, i;
    y = atoi(date.c_str());
    m = atoi(date.c_str()+5);
    d = atoi(date.c_str()+8);
    rep(i,1,m) res += numOfDaysInMonth(y,i);
    res += d;
    return res;
  }
};

Current time: 2024年05月02日07時02分05秒
Last modified: 2019年08月18日05時19分21秒 (by laycrs)
Tags: Competitive_Programming_Incomplete LeetCode
トップページに戻る

Logged in as: unknown user (not login)

ログイン: