結果

問題 No.296 n度寝
ユーザー Y_S
提出日時 2020-08-28 05:48:20
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 1,000 ms
コード長 667 bytes
コンパイル時間 857 ms
コンパイル使用メモリ 77,920 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-09 01:00:41
合計ジャッジ時間 1,444 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max,count
#include <string>	//string
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap
#include <cstdlib>	//abs(int)
#include <cmath>	//sqrt
#include <sstream>	//stringstream,getline
#include <cmath>	//ceil,M_PI

using namespace std;

int main() {

	int N, H, M, T;
	cin >> N >> H >> M >> T;

	int add_h = ((N - 1) * T) / 60;
	int add_m = ((N - 1) * T) % 60;

	add_h += (M + add_m) / 60;
	
	int ans_h = (H + add_h) % 24;
	int ans_m = (M + add_m) % 60;

	cout << ans_h << endl;
	cout << ans_m << endl;

	return 0;

}
0