結果
| 問題 | No.1932 動く点 P / Moving Point P |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2022-05-11 16:00:45 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 125 ms |
| コンパイル使用メモリ | 25,600 KB |
| 最終ジャッジ日時 | 2026-02-22 09:05:06 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:2:13: warning: no semicolon at end of struct or union
2 | struct{C r,t} ms[100001];
| ^
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
4 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
6 | scanf("%ld",&n);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | typedef __typeof(1.j) C;
main.c:6:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
6 | scanf("%ld",&n);
| ^~~~~
main.c:6:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:12:17: error: implicit declaration of function 'sincos' [-Wimplicit-function-declaration]
12 | sincos(3.14159265358979/180*r,&s,&c);
| ^~~~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'sincos'
+++ |+#include <math.h>
1 | typedef __typeof(1.j) C;
main.c:12:17: warning: incompatible implicit declaration of built-in function 'sincos' [-Wbuiltin-declaration-mismatch]
12 | sincos(3.14159265358979/180*r,&s,&c);
| ^~~~~~
main.c:12:17: note: include '<math.h>' or provide a declaration of 'sincos'
main.c:26:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
26 | printf("%f %f\n",mr*(x+y*1j)+mt);
| ^~~~~~
main.c:26:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:17: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
typedef __typeof(1.j) C;
struct{C r,t} ms[100001];
main(){
long n;
scanf("%ld",&n);
ms[0].r=1;
ms[0].t=0;
for(long i=0;i<n;++i){
double p,q,r,c,s;
scanf("%lf%lf%lf",&p,&q,&r);
sincos(3.14159265358979/180*r,&s,&c);
C mr=c+s*1j;
C mt=(1-c-s*1j)*(p+q*1j);
ms[i+1].r=mr*ms[i].r;
ms[i+1].t=mr*ms[i].t+mt;
}
long q;
scanf("%ld",&q);
for(long j=0;j<q;++j){
long s,t;
double x,y;
scanf("%ld%ld%lf%lf",&s,&t,&x,&y);
C mr=ms[t].r/ms[s-1].r;
C mt=mr*-ms[s-1].t+ms[t].t;
printf("%f %f\n",mr*(x+y*1j)+mt);
}
}
tails