結果
問題 |
No.296 n度寝
|
ユーザー |
![]() |
提出日時 | 2025-03-04 16:07:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 472 bytes |
コンパイル時間 | 459 ms |
コンパイル使用メモリ | 27,008 KB |
実行使用メモリ | 8,608 KB |
最終ジャッジ日時 | 2025-03-04 16:07:18 |
合計ジャッジ時間 | 1,302 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&count); | ~~~~~^~~~~~~~~~~~~ main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d",&hour); | ~~~~~^~~~~~~~~~~~ main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d",&minute); | ~~~~~^~~~~~~~~~~~~~ main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d",&interval); | ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> int main(){ int count, hour, minute,interval; // n度寝の回数 scanf("%d",&count); // 最初のアラームの時間(h) scanf("%d",&hour); // 最初のアラームの時間(m) scanf("%d",&minute); // アラームの間隔 scanf("%d",&interval); int overminute = count * interval; hour += (overminute + minute) / 60; minute = (overminute + minute) % 60; if(hour >= 24){ hour -= 24; } printf("%d\n%d",hour,minute); }