日本搞逼视频_黄色一级片免费在线观看_色99久久_性明星video另类hd_欧美77_综合在线视频

國內最全IT社區平臺 聯系我們 | 收藏本站
阿里云優惠2
您當前位置:首頁 > php開源 > 綜合技術 > Codeforces Round #249 (Div. 2)C. Cardiogram

Codeforces Round #249 (Div. 2)C. Cardiogram

來源:程序員人生   發布時間:2015-05-22 08:16:29 閱讀次數:3164次
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In this problem, your task is to use ASCII graphics to paint a cardiogram.

A cardiogram is a polyline with the following corners:

That is, a cardiogram is fully defined by a sequence of positive integers a1,?a2,?...,?an.

Your task is to paint a cardiogram by given sequence ai.

Input

The first line contains integer n (2?≤?n?≤?1000). The next line contains the sequence of integers a1,?a2,?...,?an (1?≤?ai?≤?1000). It is guaranteed that the sum of all ai doesn't exceed 1000.

Output

Print max |yi?-?yj| lines (where yk is the y coordinate of the k-th point of the polyline), in each line print characters. Each character must equal either ??/?? (slash), ? ? (backslash), ? ? (space). The printed image must be the image of the given polyline. Please study the test samples for better understanding of how to print a cardiogram.

Note that in this problem the checker checks your answer taking spaces into consideration. Do not print any extra characters. Remember that the wrong answer to the first pretest doesn't give you a penalty.

Sample test(s)
Input
5
3 1 2 5 1
Output
     ?/?     
  ?/??/?      
 ?/?         
?/?          
          ?/?
Input
3
1 5 1
Output
?/?     
      
      
      
     ?/?
Note

Due to the technical reasons the answers for the samples cannot be copied from the statement. We've attached two text documents with the answers below.

http://assets.codeforces.com/rounds/435/1.txt

http://assets.codeforces.com/rounds/435/2.txt


有些坑。。。

注意每行要填滿,最大的x個字符

就是可能要用空格填坑


這次大概用了1個小時才有思路,

就是保護1個堆,畫圖

中途寫好以后發現不能把/跟一樣處理


以后又發現每行還要填坑。。。


#include<map> #include<string> #include<cstring> #include<cstdio> #include<cstdlib> #include<cmath> #include<queue> #include<vector> #include<iostream> #include<algorithm> #include<bitset> #include<climits> #include<list> #include<iomanip> #include<stack> #include<set> using namespace std; struct st { int x,y; int flag; st(){} st(int x,int y,int flag) { this->x=x; this->y=y; this->flag=flag; } bool operator <(st one)const { if(y!=one.y) return y<one.y; return x>one.x; } }; int main() { int n; cin>>n; int x=0,y=0; priority_queue<st>qq; set<st>vis; vis.insert(st(x,y,1)); for(int i=0;i<n;i++) { int t; cin>>t; x+=t; if(i%2==0) { y+=t; if(i!=n⑴) qq.push(st(x,y,1)); else qq.push(st(x,y,3)); } else { y-=t; vis.insert(st(x,y,1)); } } int px=0,py=qq.top().y; while(qq.size()) { st t=qq.top(); qq.pop(); if(vis.count(st(t.x,t.y,1))) continue; if(t.y!=py) { printf("%*s ",x-px,""); px=0; py=t.y; } if(t.flag==0) { printf("%*c",t.x-px,'/'); px=t.x; qq.push(st(t.x⑴,t.y⑴,0)); } else if(t.flag==2) { printf("%*c",t.x-px+1,92); px=t.x+1; qq.push(st(t.x+1,t.y⑴,2)); } else { printf("%*c",t.x-px,'/'); px=t.x; qq.push(st(t.x⑴,t.y⑴,0)); if(t.flag!=3) { putchar(92); px=t.x+1; qq.push(st(t.x+1,t.y⑴,2)); } } } printf("%*s ",x-px,""); }


生活不易,碼農辛苦
如果您覺得本網站對您的學習有所幫助,可以手機掃描二維碼進行捐贈
程序員人生
------分隔線----------------------------
分享到:
------分隔線----------------------------
關閉
程序員人生
主站蜘蛛池模板: 国产精品美女在线观看 | 婷婷成人基地 | 精品国产乱码久久久久久蜜臀 | 色女孩综合 | 国产精品久久久久久久久久久久冷 | 亚洲欧美在线综合 | 久久aⅴ乱码一区二区三区 青青草国产成人av片免费 | 色婷婷av一区 | 中文在线一区二区 | 国产不卡视频 | 成人在线免费 | 亚洲精品久久久蜜桃 | 麻豆精品一区 | 91亚洲精品一区二区 | 97国产在线视频 | 日日夜夜狠狠 | 久9热这里只有精品视频 | 国产成人在线视频 | 成人免费在线视频 | 中文字幕在线视频观看 | 国产理论电影 | 狠狠搞狠狠搞 | 免费麻豆 | 国产在线精品成人免费怡红院 | 国产精品久久久av久久久 | 欧美精品在线一区 | 欧美怡红院视频一区二区三区 | 亚洲福利精品 | 日韩综合在线 | 日日夜夜天天综合 | 一区二区蜜桃 | 福利视频网 | 午夜性生活片 | 日韩毛片在线观看 | xxxx中国一级片 | 日韩欧美在线视频 | a级毛毛片 | 中文一区| 国产精品网站在线 | 又黄又湿的网站 | 日韩福利在线 |