Python敲警钟

P1719 最大加权矩形

Jiuweixiansheng @ 2023-12-30 10:37:57

Py党崩溃,第五个一直re,下载数据一看,原来不是一行100个,100个被拆成了很多行,,汗流浃背了


by heyx0201 @ 2023-12-30 10:42:44

@Jiuweixiansheng ???看样例就知道是 nn 列啊


by Jiuweixiansheng @ 2023-12-30 10:45:25

#部分数据
'''
100
119 -111 -6 104 -38 110 39 -123 3 -77 112 -76 -32 75 -55 -60
-37 -96 52 60 77 106 2 67 -12 -8 -52 28 -110 -1 -72 -118 16 50 115 106
33 26 112 -92 78 96 -40 -81 43 34 -12 -121 67 -88 67 16 -110 -58 -45 7
63 32 -92 82 -96 -36 92 48 -114 80 27 48 -21 11 84 -71 -20 -83 -23
-105 80 93 -98 19 -123 98 -92 -104 -87 -8 31 104 -104 67 59 -71 -97 23
105 -82 -25 5 95 83 -112 51 -115 -4 97 -10 20 49 -44 51 -59 -38 22 -23
-14 63 97 -111 40 122 85 -29 -77 116 123 -99 -93 -29 34 -126 -74 51 54
-61 -80 24 58 68 -55 -114 -8 14 -24 -114 120 90 78 89 108 -9 84 65 91
-120 54 86 -91 90 -70 72 92 -16 -5 19 52 43 -85 -18 -16 -11 -3 105
-124 101 120 124 64 70 86 44 -66 43 -18 -103 51 -92 112 89 126 -86 33
91 27 -99 -17 -48 73 27 62 -71 -112 -69 -93 -107 -95 -101 -111 97 98
104 14 -96 19 124 -70 -58 -96 -86 -97 -97 -43 65 123 113 94 -22 -63 39
-123 -127 97 -106 -68 -124 -85 -34 -97 -67 -65 -127 -91 78 -94 56 74
-36 127 107 7 -97 -117 93 96 -122 78 63 -15 -112 -26 -10 -111 -57 13
-50 -53 56 44 -21 118 108 -19 -101 58 15 84 5 107 83 -16 -13 115 -5
-48 83 2 -97 18 115 -80 121 -23 -63 -64 119 15 12 48 -69 120 38 -88
-27 65 98 116 22 -25 96 -23 88 -45 -35 -44 36 -80 86 68 67 73 116 60
-77 -75 125 -86 69 10 90 -127 2 1 -87 103 -62 -116 92 89 -12 61 -61
-52 -111 32 32 53 80 -10 -6 20 -65 -18 -48 -14 36 -50 29 -23 88 -9 -21
-38 120 21 -62 -69 33 -97 -108 -107 92 -41 -30 110 119 -126 36 72 -7
-98 -36 57 12 45 -85 -80 123 73 26 84 -64 -122 -82 -71 27 -15 -11 -68
'''

@heyx0201


by heyx0201 @ 2023-12-30 10:51:02

@Jiuweixiansheng 仔细看题就知道了啊,甚至都不需要很仔细看题


by Jiuweixiansheng @ 2023-12-30 10:53:21

@heyx0201 我寻思这数据也不是100行100列啊,,,总的数据有525行捏


by Jiuweixiansheng @ 2023-12-30 10:54:16

@heyx0201 我指的是最后一个数据n是100,但是不是100行100列


by 1_1_1_1_1_1_ @ 2024-01-28 09:31:30

@Jiuweixiansheng

py不能换行读入吗?


by Jiuweixiansheng @ 2024-01-28 10:28:35

@1_1_1_1_11 py一次读入一行捏,不知道的情况下都是循环读入100行,然后发现结果re,因为数据没读完


|