Submission #32375
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #include <stdio.h> #include <string.h> #include <stdlib.h> int main(){ char command[8]; int color; int r,g,b; int shift; int ans[1000000]; int ans_p = 0; int quit = 0; int i; scanf ( "%X" ,&color); while (quit == 0){ scanf ( "%s" ,command); if ( strcmp (command, "update" ) == 0){ scanf ( "%d %d %d" ,&r,&g,&b); if (r != -1){ color = color & 0X00FFFF; color += (r << 16); } if (g != -1){ color = color & 0XFF00FF; color += (g << 8); } if (b != -1){ color = color & 0XFFFF00; color += b; } } else if ( strcmp (command, "disp" ) == 0){ ans[ans_p] = color; ans_p++; } else if ( strcmp (command, "shift" ) == 0){ scanf ( "%d" ,&shift); if (shift > 0){ color = color >> shift; } else { color = color << abs (shift); } color = color &0XFFFFFF; } else if ( strcmp (command, "reverse" ) == 0){ color = color ^ 0XFFFFFF; } else if ( strcmp (command, "quit" ) == 0){ quit = 1; } } for (i = 0;i < ans_p;i++){ printf ( "%06X\n" ,ans[i]); } return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0900 - あーるじーびー操作 |
ユーザー名 | ei1719 |
投稿日時 | 2018-03-23 22:09:37 |
言語 | C |
状態 | Accepted |
得点 | 3 |
ソースコード長 | 1177 Byte |
最大実行時間 | 41 ms |
最大メモリ使用量 | 3504 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 3 / 3 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
input01 | AC | 35 ms | 608 KB |
1
|
input02 | AC | 22 ms | 684 KB |
1
|
input03 | AC | 39 ms | 1044 KB |
1
|
input04 | AC | 20 ms | 1080 KB |
1
|
input05 | AC | 40 ms | 1468 KB |
1
|
input06 | AC | 25 ms | 1508 KB |
1
|
input07 | AC | 36 ms | 1760 KB |
1
|
input08 | AC | 25 ms | 1936 KB |
1
|
input09 | AC | 39 ms | 2400 KB |
1
|
input10 | AC | 32 ms | 2760 KB |
1
|
input11 | AC | 37 ms | 2996 KB |
1
|
input12 | AC | 22 ms | 2884 KB |
1
|
input13 | AC | 23 ms | 2912 KB |
1
|
input14 | AC | 24 ms | 2928 KB |
1
|
input15 | AC | 41 ms | 3316 KB |
1
|
input16 | AC | 40 ms | 3488 KB |
1
|
input_sample1 | AC | 14 ms | 3412 KB |
1
|
input_sample2 | AC | 25 ms | 3456 KB |
1
|
input_sample3 | AC | 28 ms | 3504 KB |
1
|
input_sample4 | AC | 23 ms | 3452 KB |
1
|