Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

咋错了捏?NOIP2008的数据都过了啊。附上我的程序产生的擎天一柱图

Posted by Sinya at 2009-06-16 21:08:18 on Problem 2330
5 12
1 1 1 1 1 1 1 1 1 1 1 1
1 2 2 2 1 8 8 1 2 2 2 1
1 2 3 2 1 9 9 1 2 3 2 1
1 2 2 2 1 1 1 1 2 2 2 1
1 1 1 1 1 1 1 1 1 1 1 1

..........................+---+---+........................
........................./   /   /|-+......................
........................+---+---+ |/|......................
........................|   |   | + |......................
........................|   |   |/| +......................
........................+---+---+ |/|......................
........................|   |   | + |......................
........................|   |   |/| +......................
........................+---+---+ |/|......................
........................|   |   | + |......................
........................|   |   |/| +......................
........................+---+---+ |/|......................
........................|   |   | + |......................
........................|   |   |/| +......................
........................+---+---+ |/|......................
........................|   |   | + |......................
........................|   |   |/| +......................
........................+---+---+ |/|......................
..............+---+.....|   |   | + |.....+---+............
............+/   /|-+---|   |   |/| +...+/   /|-+---+......
..........+/+---+ |/   /+---+---+ |/|-+/+---+ |/   /|-+---+
........./+-|   | +---+ |   |   | + |/+-|   | +---+ |/   /|
........+/  |   |/   /| |   |   |/| +/  |   |/   /| +---+ |
......./+---+---+---+ |/+---+---+ |/+---+---+---+ |/   /| +
......+/   /   /   /| +-|   |   | +/   /   /   /| +---+ |/.
...../+---+---+---+ |/  |   |   |/+---+---+---+ |/   /| +..
....+-|   |   |   | +---+---+---+-|   |   |   | +---+ |/...
.../  |   |   |   |/   /   /   /  |   |   |   |/   /| +....
..+---+---+---+---+---+---+---+---+---+---+---+---+ |/.....
./   /   /   /   /   /   /   /   /   /   /   /   /| +......
+---+---+---+---+---+---+---+---+---+---+---+---+ |/.......
|   |   |   |   |   |   |   |   |   |   |   |   | +........
|   |   |   |   |   |   |   |   |   |   |   |   |/.........
+---+---+---+---+---+---+---+---+---+---+---+---+..........


// For Junde Huang
// POJ 2300
// Written by Sinya in June, 2009.

const
  pn='p2330';
  sg:array[0..5,0..6]of char=(('+','-','-','-','+','.','.'),('|',' ',' ',' ','|','/','.'),('|',' ',' ',' ','|',' ','+'),('+','-','-','-','+',' ','|'),('.','/',' ',' ',' ','/','|'),('.','.','+','-','-','-','+'));

var
  n,m,i,j,k,mr,mc,nr,nc,r,c:longint;
  a:array[0..50,0..50]of longint;
  g:array[0..1000,0..1000]of char;

function max(const x,y:longint):longint;begin
  if x>y then exit(x);exit(y);
end;

procedure scan;begin
  readln(n,m);
  for i:=n-1 downto 0 do begin
    for j:=0 to m-1 do
      read(a[i,j]);
    readln;
  end;
end;

procedure draw;begin
  fillchar(g,sizeof(g),'.');
  mr:=0;mc:=0;
  for i:=n-1 downto 0 do
    for j:=0 to m-1 do
      for k:=0 to a[i,j]-1 do begin
        nr:=i*2+k*3;
        nc:=i*2+j*4;
        mr:=max(mr,nr+5);
        mc:=max(mc,nc+6);
        for r:=0 to 5 do
          for c:=0 to 6 do
            if sg[r,c]<>'.' then
              g[nr+r,nc+c]:=sg[r,c];
      end;
end;

procedure print;begin
  for i:=mr downto 0 do begin
    for j:=0 to mc do
      write(g[i,j]);
    writeln;
  end;
end;

begin
  assign(input,pn+'.in');reset(input);
  assign(output,pn+'.out');rewrite(output);

  scan;
  draw;
  print;

  close(input);close(output);
end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator