- 明明的随机数
- 2014-08-08 19:45:08 @
评测状态 Wrong Answer
题目 P1316 明明的随机数
递交时间 2014-08-08 19:40:29
代码语言 Pascal
评测机 VijosEx
消耗时间 30 ms
消耗内存 612 KiB
评测时间 2014-08-08 19:40:30
评测结果
编译成功
Free Pascal Compiler version 2.6.2 [2013/02/12] for i386
Copyright (c) 1993-2012 by Florian Klaempfl and others
Target OS: Win32 for i386
Compiling foo.pas
foo.pas(3,11) Note: Local variable "b" not used
Linking foo.exe
33 lines compiled, 0.3 sec , 28608 bytes code, 1628 bytes data
1 note(s) issued
测试数据 #0: Accepted, time = 0 ms, mem = 612 KiB, score = 10
测试数据 #1: Accepted, time = 0 ms, mem = 604 KiB, score = 10
测试数据 #2: Accepted, time = 0 ms, mem = 604 KiB, score = 10
测试数据 #3: Accepted, time = 15 ms, mem = 608 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 608 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 608 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 608 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 608 KiB, score = 10
测试数据 #8: Accepted, time = 0 ms, mem = 608 KiB, score = 10
测试数据 #9: WrongAnswer, time = 15 ms, mem = 612 KiB, score = 0
WrongAnswer, time = 30 ms, mem = 612 KiB, score = 90
代码
var
n,m,i,j,k,t:longint;
a,b:array[1..100] of integer;
begin
readln(n);
m:=n;
for i:=1 to n do
read(a[i]);
begin
for i:=1 to n-1 do
for j:=i+1 to n do
begin
if a[i]=a[j] then begin
for k:=j to m do
begin
a[k]:=a[k+1];
end;
n:=n-1;
end;
end;
end;
begin
for i:=1 to n-1 do
for j:=i+1 to n do
begin
if a[i]>a[j] then begin
t:=a[i];a[i]:=a[j];a[j]:=t;
end;
end;
writeln(n);
for k:=1 to n do
write(a[k],' ');
end;
end.
9 条评论
-
swfxwyr LV 7 @ 2016-08-25 10:27:37
var
n,i,j,m,t:longint;
a,b:array[1..100] of longint;
begin
readln(n);
for i:=1 to n do read(a[i]);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[i]=a[j] then a[j]:=0;
j:=1;
for i:=1 to n do
if a[i]<>0 then begin
b[j]:=a[i];
j:=j+1;
end;
m:=j-1;
writeln(m);
for i:=1 to m-1 do
for j:=i+1 to m do
if b[i]>b[j] then begin
t:=b[i];
b[i]:=b[j];
b[j]:=t;
end;
for i:=1 to m do write(b[i],' ');
end. -
2015-11-01 11:19:39@
呃呃呃,编辑器问题。
program lkdsjflkjds;
var i,j,m,n,t:integer;a:array[1..1000]of integer;
begin
readln(n);
for i:=1 to n do
begin
read(j);
a[j]:=1;
end;
for i:=1 to 1000 do m:=m+a[i];
writeln(m);
for i:=1 to 1000 do if a[i]=1 then write(i,' ');
end. -
2015-11-01 11:18:28@
program lkdsjflkjds;
var i,j,m,n,t:integer;a:array[1..1000]of integer;
begin
readln(n);
for i:=1 to n do
begin
read(j);
a[j]:=1;
end;
一个简单的计数排序不就行了。
for i:=1 to 1000 do m:=m+a[i];
writeln(m);
for i:=1 to 1000 do if a[i]=1 then write(i,' ');
end. -
2014-08-15 11:47:23@
桶排序赛高ww
-
2014-08-13 19:05:40@
测试数据:in:3
1 1 1
out:2
1 1 -
2014-08-13 19:02:12@
一个
-
2014-08-13 19:01:34@
在删去重复的数的时候只删了yige
-
2014-08-09 14:13:10@
...
-
2014-08-08 20:46:25@
评测姬抽风了
- 1