結果

問題 No.296 n度寝
ユーザー naimonon77
提出日時 2015-11-12 20:40:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 767 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 34,688 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-06 22:28:01
合計ジャッジ時間 738 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:34:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   34 |   scanf("%d %d %d %d",&n,&h,&m,&t);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <cstring>
#include <algorithm>
#include <cstdio>
#include <ctype.h>
#include <limits.h>
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
/* ここからが本編 */
/* */
/* 入力開始! */
/* 入力終了! */
/* ll_pow(x,n)はx^nを返すよ! */
ll ll_pow(ll x,ll n) {
   ll res = 1;
   while(n > 0) {
      if(n&1) res = res * x;
      x = x * x;
      n >>= 1;
   }
   return res;
}

int main(void)
{
  int i,j;
  int n,h,m,t;
  int s[100],k[100];
  scanf("%d %d %d %d",&n,&h,&m,&t);
  m += h*60;
  m += t*(n-1);
  m -= ( m/(60*24) )*60*24;
  h = m / 60;
  
  printf("%d\n",h);
  m %= 60;
  printf("%d\n",m);
  
  
  
  return 0;
}
0