結果

問題 No.296 n度寝
コンテスト
ユーザー kachipan
提出日時 2023-06-23 16:27:03
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 15 ms / 1,000 ms
コード長 477 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 182 ms
コンパイル使用メモリ 41,812 KB
最終ジャッジ日時 2026-02-22 10:56:00
ジャッジサーバーID
(参考情報)
judge1 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main()
{
	int nidoneCnt = 0;
	int time = 0;
	int minutes = 0;
	int sleepTime = 0;

	scanf("%d", &nidoneCnt);
	scanf("%d", &time);
	scanf("%d", &minutes);
	scanf("%d", &sleepTime);

	sleepTime = (nidoneCnt - 1) * sleepTime;
	minutes += sleepTime;

	while (minutes >= 60)
	{
		minutes -= 60;
		time++;
		if (time > 23)
		{
			time = 0;
		}
	}

	printf("%d\n", time);
	printf("%d\n", minutes);
}

0