結果
| 問題 | No.70 睡眠の重要性! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-06-07 09:52:59 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 5,000 ms |
| コード長 | 1,282 bytes |
| 記録 | |
| コンパイル時間 | 1,923 ms |
| コンパイル使用メモリ | 103,168 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-09-21 04:51:25 |
| 合計ジャッジ時間 | 2,731 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace yukicoder
{
class Program
{
static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int sum = 0;
int t = 0;
int t1 = 0;
int m = 0;
int m1 = 0;
int c=0;
int d=0;
int e = 0;
for(int i = 0; i < a; i++)
{
string[] s = Console.ReadLine().Split(' ',':');
t = int.Parse(s[0]);
t1 = int.Parse(s[2]);
m = int.Parse(s[1]);
m1 = int.Parse(s[3]);
if (m > m1)
{
t1 -= 1;
}
if (t > t1)
{
t = 24 - t;
c = t1 + t;
}
else
{
c = t1 - t;
}
c *= 60;
d = (60-m)+m1;//分の計算
if (d >= 60)//分が60を超えたとき
{
e=d / 60;
c += 60*(e-1);
d = d%60;
}
sum += c+d;
}
Console.WriteLine(sum);
}
}
}