提出 #44348463
ソースコード 拡げる
Copy
Copy
- #include <stdio.h>
-
- void x87_sincos(double* sin_res, double* cos_res, double angle) {
- __asm__ __volatile__(
- "fldl %2\n\t"
- "fsincos\n\t"
- "fstpl %1\n\t"
- "fstpl %0\n\t"
- : "=m"(*sin_res), "=m"(*cos_res) : "m"(angle));
- }
-
- double x87_sqrt(double value) {
- double res;
- __asm__ __volatile__(
- "fldl %1\n\t"
- "fsqrt\n\t"
- "fstpl %0\n\t"
- : "=m"(res) : "m"(value));
- return res;
- }
-
- double x87_atan2(double y, double x) {
- double res;
- __asm__ __volatile__(
- "fldl %1\n\t"
- "fldl %2\n\t"
- "fpatan\n\t"
- "fstpl %0\n\t"
- : "=m"(res) : "m"(y), "m"(x));
- return res;
- }
-
- int main(void) {
- double PI = x87_atan2(1, 1) * 4;
- double T;
- double L, X, Y;
- int Q;
- int i;
- if (scanf("%lf", &T) != 1) return 1;
- if (scanf("%lf%lf%lf", &L, &X, &Y) != 3) return 1;
- if (scanf("%d", &Q) != 1) return 1;
- for (i = 0; i < Q; i++) {
- double E;
- double s, c;
- double y, z;
- double teihen, takasa;
- if(scanf("%lf", &E) != 1) return 1;
- x87_sincos(&s, &c, 2.0 * PI * E / T);
- y = -(L / 2) * s;
- z = (L / 2) - (L / 2) * c;
- teihen = x87_sqrt(X * X + (Y - y) * (Y - y));
- takasa = z;
- printf("%.15f\n", x87_atan2(takasa, teihen) * 180.0 / PI);
- }
- return 0;
- }
#include <stdio.h>
void x87_sincos(double* sin_res, double* cos_res, double angle) {
__asm__ __volatile__(
"fldl %2\n\t"
"fsincos\n\t"
"fstpl %1\n\t"
"fstpl %0\n\t"
: "=m"(*sin_res), "=m"(*cos_res) : "m"(angle));
}
double x87_sqrt(double value) {
double res;
__asm__ __volatile__(
"fldl %1\n\t"
"fsqrt\n\t"
"fstpl %0\n\t"
: "=m"(res) : "m"(value));
return res;
}
double x87_atan2(double y, double x) {
double res;
__asm__ __volatile__(
"fldl %1\n\t"
"fldl %2\n\t"
"fpatan\n\t"
"fstpl %0\n\t"
: "=m"(res) : "m"(y), "m"(x));
return res;
}
int main(void) {
double PI = x87_atan2(1, 1) * 4;
double T;
double L, X, Y;
int Q;
int i;
if (scanf("%lf", &T) != 1) return 1;
if (scanf("%lf%lf%lf", &L, &X, &Y) != 3) return 1;
if (scanf("%d", &Q) != 1) return 1;
for (i = 0; i < Q; i++) {
double E;
double s, c;
double y, z;
double teihen, takasa;
if(scanf("%lf", &E) != 1) return 1;
x87_sincos(&s, &c, 2.0 * PI * E / T);
y = -(L / 2) * s;
z = (L / 2) - (L / 2) * c;
teihen = x87_sqrt(X * X + (Y - y) * (Y - y));
takasa = z;
printf("%.15f\n", x87_atan2(takasa, teihen) * 180.0 / PI);
}
return 0;
}
提出情報
ジャッジ結果
セット名 |
Sample |
All |
得点 / 配点 |
0 / 0 |
3 / 3 |
結果 |
|
|
セット名 |
テストケース |
Sample |
00_sample_00.txt, 00_sample_01.txt |
All |
00_sample_00.txt, 00_sample_01.txt, 10_random_small_00.txt, 10_random_small_01.txt, 10_random_small_02.txt, 10_random_small_03.txt, 10_random_small_04.txt, 10_random_small_05.txt, 10_random_small_06.txt, 10_random_small_07.txt, 10_random_small_08.txt, 10_random_small_09.txt, 11_random_large_00.txt, 11_random_large_01.txt, 11_random_large_02.txt, 11_random_large_03.txt, 11_random_large_04.txt, 11_random_large_05.txt, 11_random_large_06.txt, 11_random_large_07.txt, 11_random_large_08.txt, 11_random_large_09.txt, 20_random_max_00.txt, 20_random_max_01.txt, 20_random_max_02.txt, 20_random_max_03.txt, 20_random_max_04.txt |
ケース名 |
結果 |
実行時間 |
メモリ |
00_sample_00.txt |
AC |
4 ms |
1692 KB |
00_sample_01.txt |
AC |
3 ms |
1648 KB |
10_random_small_00.txt |
AC |
1 ms |
1656 KB |
10_random_small_01.txt |
AC |
1 ms |
1668 KB |
10_random_small_02.txt |
AC |
1 ms |
1708 KB |
10_random_small_03.txt |
AC |
1 ms |
1672 KB |
10_random_small_04.txt |
AC |
1 ms |
1652 KB |
10_random_small_05.txt |
AC |
2 ms |
1728 KB |
10_random_small_06.txt |
AC |
1 ms |
1684 KB |
10_random_small_07.txt |
AC |
1 ms |
1652 KB |
10_random_small_08.txt |
AC |
1 ms |
1696 KB |
10_random_small_09.txt |
AC |
2 ms |
1724 KB |
11_random_large_00.txt |
AC |
1 ms |
1672 KB |
11_random_large_01.txt |
AC |
2 ms |
1740 KB |
11_random_large_02.txt |
AC |
3 ms |
1672 KB |
11_random_large_03.txt |
AC |
2 ms |
1748 KB |
11_random_large_04.txt |
AC |
2 ms |
1644 KB |
11_random_large_05.txt |
AC |
2 ms |
1632 KB |
11_random_large_06.txt |
AC |
2 ms |
1748 KB |
11_random_large_07.txt |
AC |
2 ms |
1732 KB |
11_random_large_08.txt |
AC |
2 ms |
1672 KB |
11_random_large_09.txt |
AC |
2 ms |
1680 KB |
20_random_max_00.txt |
AC |
2 ms |
1636 KB |
20_random_max_01.txt |
AC |
5 ms |
1728 KB |
20_random_max_02.txt |
AC |
2 ms |
1636 KB |
20_random_max_03.txt |
AC |
2 ms |
1736 KB |
20_random_max_04.txt |
AC |
2 ms |
1648 KB |