刷题
julia7_
keep coding
展开
-
B1050 螺旋矩阵 (25 分)(找规律图形输出)
本题要求将给定的N个正整数按非递增的顺序,填入“螺旋矩阵”。所谓“螺旋矩阵”,是指从左上角第 1 个格子开始,按顺时针螺旋方向填充。要求矩阵的规模为m行n列,满足条件:m×n等于N;m≥n;且m−n取所有可能值中的最小值。输入格式:输入在第 1 行中给出一个正整数N,第 2 行给出N个待填充的正整数。所有数字不超过104,相邻数字以空格分隔。输出格式:...原创 2019-03-10 21:18:06 · 413 阅读 · 0 评论 -
A1057 Stack (30 分)(进栈出栈的同时求栈中元素的中位数)(分块)(难)
Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and Po...原创 2019-03-11 13:14:55 · 537 阅读 · 0 评论
分享