testcase generator για ΠΔΠ-34
Δημοσιεύτηκε: Τρί Νοέμ 02, 2021 5:51 pm
Κώδικας: Επιλογή όλων
uses sysutils;
var i,x,y,j,f,n,count:longint;
m,vote:integer;
fout:text;
mtv:array[0..1000] of longint;
begin
assign(fout,'voting.in');
rewrite(fout);
write(timetostr(time),' Give me M: 1<M<1.000 ');
readln(m);
write(timetostr(time),' Give me N: ',m,'<N<1.000.000 ');
readln(n);
count:=0;
for x:=1 to m do begin
y:=2*x+3;
for j:=1 to y do begin
mtv[count]:=x;
count:=count+1;
if count>999 then break;
end;
if count>999 then break;
end;
writeln(timetostr(time),' motivo= ',count);
writeln(fout,n,' ',m,' ',n);
//writeln(n,' ',m,' ',n);
for i:=1 to m do write(fout,i,' ');
//for i:=1 to m do write(i,' ');
for i:=1 to n-m do begin
vote:=mtv[i mod count];
write(fout,vote,' ');
// write(vote,' ');
end;
close(fout);
writeln;
writeln(timetostr(time),' file ok');
end.
Κώδικας: Επιλογή όλων
100 4 100
1 2 3 4 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 1