結果

問題 No.773 コンテスト
ユーザー masakiGitmasakiGit
提出日時 2019-03-14 22:09:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 933 bytes
コンパイル時間 442 ms
コンパイル使用メモリ 63,076 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-09 12:43:46
合計ジャッジ時間 1,571 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 2 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,380 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,380 KB
testcase_22 AC 2 ms
4,384 KB
testcase_23 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


#include <iostream>
#include <string>

using namespace std;
int main() {
  //入力1回でスペース区切りで2つの数値されるので cin に2つ変数を書いて受け取る
  int a, b, x, y;
  cin >> a >> b;

  /*cout << a << endl;
  cout << b << endl;
  */

  if (b < 23) {
    //範囲の後ろが23より小さいのであれば3日間出席可能
    cout << 3 << endl;
  } else if (a > 25) {
    //範囲の開始が25より大きければ3日間出席可能
    cout << 3 << endl;
  } else if (a <= 23 && b >= 25) {
    // またがっていたら0日
    cout << 0 << endl;
  } else {
    if (a < 23) {
      x = 23;
    } else {
      x = a;
    }

    if (b > 25) {
      y = 25;
    } else {
      y = b;
    }

    if (x == y) {
      //同一なら他の2日に出席可能
      cout << 2 << endl;
    } else {
      // 連続した日付なら残り1日
      cout << 1 << endl;
    }
  }

  return 0;
}
0