結果

問題 No.296 n度寝
ユーザー alpha_virginisalpha_virginis
提出日時 2015-11-06 22:23:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 2,682 bytes
コンパイル時間 698 ms
コンパイル使用メモリ 26,884 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 03:38:57
合計ジャッジ時間 1,553 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>

#include <cstdint>

typedef uint8_t  u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t   s8;
typedef int16_t  s16;
typedef int32_t  s32;
typedef int64_t  s64;

constexpr int INF = (1 << 28);
constexpr long INFL = (1LL << 50);

class FastIO {
public:
  void flush() {
    fflush(stdin);
    fflush(stdout);
  }
  FastIO& operator >> (int &right) {
    if( scanf("%d", &right) == EOF ) {
      fprintf(stderr, "cannot scanf().");
      exit(1);
    }
    return *this;
  }
  FastIO& operator >> (u32 &right) {
    if( scanf("%d", &right) == EOF ) {
      fprintf(stderr, "cannot scanf().");
      exit(1);
    }
    return *this;
  }
  FastIO& operator >> (double &right) {
    if( scanf("%lf", &right) == EOF ) {
      fprintf(stderr, "cannot scanf().");
      exit(1);
    }
    return *this;
  }
  FastIO& operator >> (char &right) {
    if( scanf("%c", &right) == EOF ) {
      fprintf(stderr, "cannot scanf().");
      exit(1);
    }     
    return *this;
  }
  FastIO& operator >> (char right[]) {
    if( scanf("%s", right) == EOF ) {
      fprintf(stderr, "cannot scanf().");
      exit(1);
    }           
    return *this;
  }
  
  FastIO& operator << (const int& right) {
    printf("%d", right);
    return *this;
  }
  FastIO& operator << (int&& right) {
    printf("%d", right);
    return *this;
  }
  FastIO& operator << (const u32& right) {
    printf("%d", right);
    return *this;
  }
  FastIO& operator << (u32&& right) {
    printf("%d", right);
    return *this;
  }
  FastIO& operator << (const u64& right) {
    printf("%ld", right);
    return *this;
  }
  FastIO& operator << (u64&& right) {
    printf("%ld", right);
    return *this;
  }
  FastIO& operator << (const long& right) {
    printf("%ld", right);
    return *this;
  }
  FastIO& operator << (long&& right) {
    printf("%ld", right);
    return *this;
  }

  FastIO& operator << (const double& right) {
    printf("%.20lf", right);
    return *this;
  }
  FastIO& operator << (double&& right) {
    printf("%.20lf", right);
    return *this;
  }

  FastIO& operator << (const char right[]) {
    printf("%s", right);
    return *this;
  }
  
  FastIO& operator << (const char& right) {
    printf("%c", right);
    return *this;
  }
  FastIO& operator << (char&& right) {
    printf("%c", right);
    return *this;
  }
};

FastIO io;

#include <typeinfo>

class Solver {
public:
  void solve() {
    int N, H, M, T;
    io >> N >> H >> M >> T;
    M += T * (N - 1);
    H += M / 60;
    M %= 60;
    H %= 24;
    io << H << '\n' << M << '\n';    
  }
};

int main() {

  Solver solver;
  solver.solve();

  return 0;
}
0