记录编号 |
111575 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[Tyvj 1236] 比特 |
最终得分 |
100 |
用户昵称 |
(⊙o⊙)… |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.345 s |
提交时间 |
2014-07-13 17:15:17 |
内存使用 |
3.98 MiB |
显示代码纯文本
- program cc(input,output);
- var
- a:array[0..1000000]of longint;
- n,i,j,x,w,q:longint;
- begin
- assign(input,'bita.in');
- assign(output,'bita.out');
- reset(input);
- rewrite(output);
- read(n);
- for q:=1 to n do
- begin
- w:=q;
- repeat
- inc(i);
- a[i]:=w mod 2;
- w:=w div 2;
- until w=0;
- for j:=i downto 1 do
- begin
- if (a[j]=1)and(a[j]=a[j-1]) then x:=x+1;
- end;
- i:=0;
- end;
- writeln(x);
- close(input);
- close(output);
- end.
-
-