提出 #574621
ソースコード 拡げる
#include <stdio.h>
#include <math.h>
double ExchangeHourTo360(int hour, int min)
{
double angle = (double) hour * 360.0F / 12.0F + (double) min * 30.0F / 60.0F;
while (angle > 360.0F) {
angle -= 360.0F;
}
return angle;
}
double ExchangeMinTo360(int min)
{
return (double) min * 360.0F / 60.0F;
}
int main(int argc, char **argv)
{
int a, b;
double angle;
scanf("%d %d", &a, &b);
angle = fabs(ExchangeHourTo360(a, b) - ExchangeMinTo360(b));
printf("%.1f\n", (angle > 180.0F) ? 360.0F - angle : angle);
return 0;
}
提出情報
コンパイルエラー
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:23:27: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
scanf("%d %d", &a, &b);
^
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | subtask0_1.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt |
| All | 0.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 2.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt, 26.txt, 27.txt, 28.txt, 29.txt, 3.txt, 30.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, subtask0_1.txt, subtask0_2.txt, subtask0_3.txt, subtask0_4.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 0.txt | AC | 23 ms | 796 KiB |
| 1.txt | AC | 24 ms | 668 KiB |
| 10.txt | AC | 21 ms | 700 KiB |
| 11.txt | AC | 23 ms | 796 KiB |
| 12.txt | AC | 23 ms | 704 KiB |
| 13.txt | AC | 23 ms | 644 KiB |
| 14.txt | AC | 22 ms | 792 KiB |
| 15.txt | AC | 24 ms | 708 KiB |
| 16.txt | AC | 24 ms | 692 KiB |
| 17.txt | AC | 24 ms | 788 KiB |
| 18.txt | AC | 25 ms | 784 KiB |
| 19.txt | AC | 24 ms | 700 KiB |
| 2.txt | AC | 24 ms | 700 KiB |
| 20.txt | AC | 24 ms | 644 KiB |
| 21.txt | AC | 27 ms | 712 KiB |
| 22.txt | AC | 24 ms | 664 KiB |
| 23.txt | AC | 25 ms | 708 KiB |
| 24.txt | AC | 27 ms | 652 KiB |
| 25.txt | AC | 24 ms | 696 KiB |
| 26.txt | AC | 25 ms | 788 KiB |
| 27.txt | AC | 26 ms | 696 KiB |
| 28.txt | AC | 23 ms | 792 KiB |
| 29.txt | AC | 25 ms | 692 KiB |
| 3.txt | AC | 24 ms | 696 KiB |
| 30.txt | AC | 24 ms | 788 KiB |
| 4.txt | AC | 24 ms | 788 KiB |
| 5.txt | AC | 26 ms | 792 KiB |
| 6.txt | AC | 25 ms | 788 KiB |
| 7.txt | AC | 25 ms | 692 KiB |
| 8.txt | AC | 25 ms | 688 KiB |
| 9.txt | AC | 26 ms | 792 KiB |
| subtask0_1.txt | AC | 25 ms | 684 KiB |
| subtask0_2.txt | AC | 26 ms | 704 KiB |
| subtask0_3.txt | AC | 25 ms | 792 KiB |
| subtask0_4.txt | AC | 24 ms | 792 KiB |