china area part 3/3

CREATE TABLE [area] (
 [id] [int] NOT NULL ,
 [name] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [Rome] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 [sz_code] [nvarchar] (6) COLLATE Chinese_PRC_CI_AS NOT NULL ,
 [zm_code] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
 CONSTRAINT [PK_area] PRIMARY KEY  CLUSTERED
 (
  [id]
 )  ON [PRIMARY]
) ON [PRIMARY]
GO

 

 

 

 

 

文件说明:
area.sql 创建表 area
area.CSV 数据文件
数据倒入方法:

1.创建了area表后
2.打开企业管理,右键选择area表,在右键菜单里选择 所有任务->导入数据.出现向导提示,点下一步.
3.进入选择数据源菜单,数据源选择为"文本文件",在文件名里选择"area.CSV"文件,点下一步.
4.进入选择文本格式菜单,什么都不管,点下一步.
5.进入指定列分割符选择逗号,点下一步.
6.进入选择目的菜单,选择你的数据库,ok,Next!
7,一路Next,Next...Ok,You are a wise man!

由于某些外在原因程序代码不能Show.So,Sorry,I say only(哇!我简直是个英语天才,~V~)

 

但是,这里有参考的T-sql:
--------------------------------------------------------------------------------------------
得到省级:Select * FROM area where sz_code like '__0000'

说明:"__"是指语法,没什么好说明的.
--------------------------------------------------------------------------------------------
得到市级:Select * FROM area where sz_code like 'nn__00'

说明:"nn"是指城市的所属省份的sz_code字段值的前两位.例如山东省sz_code是:370000,则它的所属城市的查询语句是:Select * FROM area where sz_code like '37__00',可以去式下.所以我们在程序中只需要把370000处理下得到37就ok,完全的字符串操作.

--------------------------------------------------------------------------------------------
得到乡镇:Select * FROM area where sz_code like 'nnnn__'

说明:从上面就不难理解这个了"nnnn"是指乡镇所属城市的sz_code字段值的前四位.例如临沂的sz_code是:371300,则它的所属城市的查询语句是:Select * FROM area where sz_code like '3713__',所以我们在程序中只需要把371300处理下得到3713就ok,完全的字符串操作.


由于原来的数据导入出现错误,感谢:vagerent 的建议,现在提供access数据文档

有问题请联系:QQ:357128859(独木桥遇狗熊)

 

 

 

 

 

7-168 Dream to EC-Final 分数 20 作者 吕佳霖 单位 中国计量大学 ICPC Asia East Continent Final, one of the oldest, largest, and most prestigious programming competitions in China, is attracting more and more competitors from all over the country to participate in, including CJLUACMers. Moreover, it's a huge dream for most of them. During these years, the EC-Final was always hosted by Northwestern Polytechnical University (NWPU) in Xi'an City, Shann Xi Province. (Reference: http://m.haiwainet.cn/middle/3542417/2019/1218/content_31684163_1.html) As a competitor of ICPC EC-Final in 2019, Derrick took part in this programming competition and visited Xi'an City. However, Derrick had another dream that would be never come true, which was travelling in the ancient Xi'an City in Tang Dynasty. 微信图片_20210307183647(1).jpg In order to discover the landscape of the ancient Xi'an City, Derrick has already searched enough information about it. Just as Hundreds and Thousands of houses are like a Go game, and twelve streets are like a vegetable garden(百千家似围棋局,十二街如种菜畦)written by Juyi Bai. This poetry vividly demonstrates the structure of the ancient Xi'an City, it consists of several vertical streets and horizontal roads of the same lengths but different widths. Supposed that the shape of whole city is an n×n square, which composed of n vertical streets x 1 ​ , x 2 ​ ,..., x n ​ and n horizontal roads y 1 ​ , y 2 ​ ,..., y n ​ within the same lengths and different widths from centre. Derrick is curious about calculating the area of all intersections, because he wants to calculate the traffic flow accurately at each intersection in the ancient Xi'an City. However, Derrick considers this task is quite easy for you, so Derrick will spin the whole square with 45 degree at first, maybe clockwise or maybe counterclockwise. After that, you are asked to calculate the total area of all intersections for each row and each column. Input Specification: There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case: The first line contains two integers n (1≤n≤1000) and d, indicating the size of the square and the direction of rotating the square. When d=1, it means that the direction of rotation is clockwise. When d=0, it means that the direction of rotation is counterclockwise. The second line contains n integers x 1 ​ , x 2 ​ ,..., x n ​ (0≤x i ​ ≤5×10 4 ), indicating the width of vertical streets at the i-th position from centre. The third line contains n integers y 1 ​ , y 2 ​ ,..., y n ​ (0≤y j ​ ≤5×10 4 ), indicating the width of horizontal roads at the j-th position from centre. It's guaranteed that the sum of n of all test cases will not exceed 2×10 4 . Output Specification: For each case, in the first line output 2n−1 integers separated by a space, indicating the total area of intersections for each row after rotating 45 degree. Similarly, in the second line print 2n−1 integers separated by a space, indicating the total area of intersections for each column after rotating 45 degree. Note: Please, DO NOT output extra spaces at the end of each line, or your answer may be considered incorrect! Sample Input: 1 3 0 1 2 3 3 2 1 Sample Output: 3 8 14 8 3 1 4 10 12 9 Hint: For example, the initial state of 3×3 square, the clockwise state of 3×3 square and the counterclockwise state of 3×3 square are shown as the following, respectively: 微信图片_20210307204029.png给出C代码
最新发布
09-20
ICPC Asia East Continent Final, one of the oldest, largest, and most prestigious programming competitions in China, is attracting more and more competitors from all over the country to participate in, including CJLUACMers. Moreover, it's a huge dream for most of them. During these years, the EC-Final was always hosted by Northwestern Polytechnical University (NWPU) in Xi'an City, Shann Xi Province. (Reference: http://m.haiwainet.cn/middle/3542417/2019/1218/content_31684163_1.html) As a competitor of ICPC EC-Final in 2019, Derrick took part in this programming competition and visited Xi'an City. However, Derrick had another dream that would be never come true, which was travelling in the ancient Xi'an City in Tang Dynasty. 微信图片_20210307183647(1).jpg In order to discover the landscape of the ancient Xi'an City, Derrick has already searched enough information about it. Just as Hundreds and Thousands of houses are like a Go game, and twelve streets are like a vegetable garden(百千家似围棋局,十二街如种菜畦)written by Juyi Bai. This poetry vividly demonstrates the structure of the ancient Xi'an City, it consists of several vertical streets and horizontal roads of the same lengths but different widths. Supposed that the shape of whole city is an n×n square, which composed of n vertical streets x 1 ​ , x 2 ​ ,..., x n ​ and n horizontal roads y 1 ​ , y 2 ​ ,..., y n ​ within the same lengths and different widths from centre. Derrick is curious about calculating the area of all intersections, because he wants to calculate the traffic flow accurately at each intersection in the ancient Xi'an City. However, Derrick considers this task is quite easy for you, so Derrick will spin the whole square with 45 degree at first, maybe clockwise or maybe counterclockwise. After that, you are asked to calculate the total area of all intersections for each row and each column. Input Specification: There are multiple test cases. The first line of the input contains an integer T, indicating the number of test cases. For each test case: The first line contains two integers n (1≤n≤1000) and d, indicating the size of the square and the direction of rotating the square. When d=1, it means that the direction of rotation is clockwise. When d=0, it means that the direction of rotation is counterclockwise. The second line contains n integers x 1 ​ , x 2 ​ ,..., x n ​ (0≤x i ​ ≤5×10 4 ), indicating the width of vertical streets at the i-th position from centre. The third line contains n integers y 1 ​ , y 2 ​ ,..., y n ​ (0≤y j ​ ≤5×10 4 ), indicating the width of horizontal roads at the j-th position from centre. It's guaranteed that the sum of n of all test cases will not exceed 2×10 4 . Output Specification: For each case, in the first line output 2n−1 integers separated by a space, indicating the total area of intersections for each row after rotating 45 degree. Similarly, in the second line print 2n−1 integers separated by a space, indicating the total area of intersections for each column after rotating 45 degree. Note: Please, DO NOT output extra spaces at the end of each line, or your answer may be considered incorrect! Sample Input: 1 3 0 1 2 3 3 2 1 Sample Output: 3 8 14 8 3 1 4 10 12 9 Hint: For example, the initial state of 3×3 square, the clockwise state of 3×3 square and the counterclockwise state of 3×3 square are shown as the following, respectively: 微信图片_20210307204029.png 代码长度限制 16 KB Java (javac) 时间限制 2000 ms 内存限制 64 MB Python (python2) 时间限制 2000 ms 内存限制 64 MB Python (python3) 时间限制 2000 ms 内存限制 64 MB 其他编译器 时间限制 1000 ms 内存限制 64 MB 栈限制 8192 KB
08-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值