結果
問題 | No.471 直列回転機 |
ユーザー | Yamyuki |
提出日時 | 2016-12-22 12:27:38 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 339 ms / 3,141 ms |
コード長 | 922 bytes |
コンパイル時間 | 1,109 ms |
コンパイル使用メモリ | 21,632 KB |
実行使用メモリ | 25,592 KB |
平均クエリ数 | 19588.37 |
最終ジャッジ日時 | 2024-06-11 10:33:06 |
合計ジャッジ時間 | 12,852 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 22 ms
24,836 KB |
testcase_01 | AC | 20 ms
24,812 KB |
testcase_02 | AC | 23 ms
24,940 KB |
testcase_03 | AC | 21 ms
25,196 KB |
testcase_04 | AC | 19 ms
25,184 KB |
testcase_05 | AC | 20 ms
24,800 KB |
testcase_06 | AC | 20 ms
24,812 KB |
testcase_07 | AC | 19 ms
25,196 KB |
testcase_08 | AC | 43 ms
25,196 KB |
testcase_09 | AC | 42 ms
25,196 KB |
testcase_10 | AC | 30 ms
24,812 KB |
testcase_11 | AC | 134 ms
25,196 KB |
testcase_12 | AC | 252 ms
25,220 KB |
testcase_13 | AC | 241 ms
25,092 KB |
testcase_14 | AC | 317 ms
24,964 KB |
testcase_15 | AC | 339 ms
25,220 KB |
testcase_16 | AC | 23 ms
25,208 KB |
testcase_17 | AC | 21 ms
24,940 KB |
testcase_18 | AC | 22 ms
25,196 KB |
testcase_19 | AC | 19 ms
25,068 KB |
testcase_20 | AC | 285 ms
24,824 KB |
testcase_21 | AC | 86 ms
25,196 KB |
testcase_22 | AC | 257 ms
25,448 KB |
testcase_23 | AC | 229 ms
25,208 KB |
testcase_24 | AC | 159 ms
25,592 KB |
testcase_25 | AC | 61 ms
25,208 KB |
testcase_26 | AC | 284 ms
24,824 KB |
testcase_27 | AC | 137 ms
24,824 KB |
testcase_28 | AC | 184 ms
24,824 KB |
testcase_29 | AC | 195 ms
25,208 KB |
testcase_30 | AC | 91 ms
24,824 KB |
testcase_31 | AC | 307 ms
24,952 KB |
testcase_32 | AC | 249 ms
24,824 KB |
testcase_33 | AC | 179 ms
24,824 KB |
testcase_34 | AC | 279 ms
25,208 KB |
testcase_35 | AC | 82 ms
25,208 KB |
testcase_36 | AC | 127 ms
24,952 KB |
testcase_37 | AC | 44 ms
25,208 KB |
testcase_38 | AC | 68 ms
24,824 KB |
testcase_39 | AC | 106 ms
24,824 KB |
testcase_40 | AC | 201 ms
25,208 KB |
testcase_41 | AC | 283 ms
25,208 KB |
testcase_42 | AC | 189 ms
25,208 KB |
testcase_43 | AC | 256 ms
25,208 KB |
testcase_44 | AC | 49 ms
25,208 KB |
testcase_45 | AC | 178 ms
24,824 KB |
testcase_46 | AC | 209 ms
24,824 KB |
testcase_47 | AC | 255 ms
24,824 KB |
testcase_48 | AC | 229 ms
25,208 KB |
testcase_49 | AC | 219 ms
24,824 KB |
testcase_50 | AC | 275 ms
24,824 KB |
testcase_51 | AC | 118 ms
24,824 KB |
testcase_52 | AC | 22 ms
25,196 KB |
testcase_53 | AC | 27 ms
25,196 KB |
testcase_54 | AC | 23 ms
24,940 KB |
testcase_55 | AC | 87 ms
25,196 KB |
testcase_56 | AC | 73 ms
25,196 KB |
testcase_57 | AC | 53 ms
25,580 KB |
testcase_58 | AC | 32 ms
24,812 KB |
コンパイルメッセージ
main.c: In function ‘main’: main.c:33:28: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=] 33 | printf("? %d %d\n",x[0],y[0]); | ~^ ~~~~ | | | | int long int | %ld main.c:33:31: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘long int’ [-Wformat=] 33 | printf("? %d %d\n",x[0],y[0]); | ~^ ~~~~ | | | | int long int | %ld main.c:28:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 28 | scanf("%ld",&m); | ^~~~~~~~~~~~~~~ main.c:30:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 30 | scanf("%ld %ld",&x[i],&y[i]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:35:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 35 | scanf("%ld %ld",&x[0],&y[0]); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:39:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 39 | scanf("%ld %ld",&x1,&y1); | ^~~~~~~~~~~~~~~~~~~~~~~~ main.c:42:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 42 | scanf("%ld %ld",&x2,&y2); | ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<stdio.h> long x[50000],y[50000]; void roll(long i,long* xl,long* yl,int r){ long h,hx=xl[i],hy=yl[i]; switch(r){ case 3: h=hy; hy=hx; hx=-h; case 2: h=hy; hy=hx; hx=-h; case 1: h=hy; hy=hx; hx=-h; case 0: xl[i]=hx; yl[i]=hy; return; } } int main(){ long m,i,dx,dy,x1,x2,y1,y2; int r; scanf("%ld",&m); for(i=0;i<m;i++){ scanf("%ld %ld",&x[i],&y[i]); } if(m==1){ printf("? %d %d\n",x[0],y[0]); fflush(stdout); scanf("%ld %ld",&x[0],&y[0]); }else{ printf("? 0 0\n"); fflush(stdout); scanf("%ld %ld",&x1,&y1); printf("? 1 0\n"); fflush(stdout); scanf("%ld %ld",&x2,&y2); x2=x2-x1; y2=y2-y1; if(y2==0){ if(x2==1) r=0; else r=2; }else{ if(y2==1) r=1; else r=3; } for(i=0;i<m;i++){ roll(i,x,y,r); x[i]+=x1; y[i]+=y1; } } printf("!\n"); for(i=0;i<m;i++){ printf("%ld %ld\n",x[i],y[i]); } fflush(stdout); return 0; }