0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

yukicoder No.2789 hako111223’s Master Thesis 解説

Posted at

問題文

解説

まず前提として12月は31日ある。よって、論文を書ける時間は$B+31-A$日。これを基準に場合分けをすればよい。

C++での解答例

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  b += 31;
  if(b - a >= c) {
    cout << 1 << endl;
  }
  else if(b - a >= d) {
    cout << 2 << endl;
  }
  else {
    cout << 3 << endl;
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?