【记录CF】Codeforces Round #774 (Div. 2) A~C 题解

目录

杂谈

A. Square Counting

B. Quality vs Quantity

C. Factorials and Powers of Two


杂谈

不得不说这场 cf 的时间真的很阴间,在菜和状态差的双重影响下毫无疑问直接掉大分。

这场的A题特别友好,属于看完题直接能签的那种;B题上来就想了个假思路,连WA两发,意识到问题之后改完思路,但没完全改完代码,又草率地交了,理所当然的又WA了一发,最后调整完索性算是过了;C题上来又想了个分情况的假算法,但后来发现情况分不完(<@_@>),在结束前半个小时发现好像直接暴力枚举也T不了,可惜最后还是没写出来。

赛后看了下同学的暴力代码,二进制枚举,这才回想起来寒假集训营也有一题用二进制枚举不同的组合,没想到这才补完题没多久就忘了(看来还是不够努力-O-)。

A. Square Counting

题目链接:Problem - A - Codeforces

题目大意:定义 n + 1 长度的序列中每个数是 [0, n) 或者是 n^2,序列所有元素的和为 s,求给定 n 和 s 的情况下,序列中是 n^2 的数的个数。(其中 s 是一定合法的值)

解题思路:因为 s 一定是合法值,那么如果 s 是大于等于 n^2 的数,那么一定有 

找出sql错误SELECT * FROM ( SELECT a.id, a.CODE AS &#39;sourceBillCode&#39;, a.type AS &#39;originalOrderType&#39;, a.unit_of_origin, a.unit_of_origin_type, a.time AS &#39;orderOriginCreationTime&#39;, a.warehouse, a.receiving_storage_space, b.type_of_material, b.quality_control_number, b.good_products_number, b.defective_products_number, b.yield, b.quantity_of_returns, b.as_received_condition, b.quantity_of_order, b.quantity_not_received, b.quantity_of_goods_received, b.number_of_spare_parts, b.quantity_of_returns_actual, b.special_production_quantity, b.quantity_in_storage, b.receipt_quantity AS &#39;inqty&#39;, b.quantity_not_in_storage FROM wareh_source_order a LEFT JOIN statistics_receiving_order b ON a.id = b.order_id UNION ALL SELECT a.id, a.CODE AS &#39;sourceBillCode&#39;, a.type AS &#39;originalOrderType&#39;, a.unit_of_origin, a.source_of_delivery_note, a.time AS &#39;orderOriginCreationTime&#39;, a.warehouse, a.receiving_storage_space, b.type_of_material, b.quality_control_number, b.good_products_number, b.defective_products_number, b.yield, b.quantity_of_returns, b.as_received_condition, b.quantity_of_order, b.quantity_not_received, b.quantity_of_goods_received, b.number_of_spare_parts, b.quantity_of_returns_actual, b.special_production_quantity, b.quantity_in_storage, b.receipt_quantity AS &#39;inqty&#39;, b.quantity_not_in_storage FROM wareh_source_order a LEFT JOIN statistics_purchase_order b ON a.id = b.order_id ) tab WHERE originalOrderType IN ( &#39;PurchaseOrder&#39;, &#39;ReceiptRecord&#39; ) AND warehouse = &#39;string&#39; AND receiving_storage_space = &#39;string&#39; AND date_format( orderOriginCreationTime, &#39;%y%m%d&#39; ) >= date_format( &#39;2023-07-07 00:00:00.0&#39;, &#39;%y%m%d&#39; ) AND date_format( orderOriginCreationTime, &#39;%y%m%d&#39; ) <= date_format( &#39;2023-07-07 00:00:00.0&#39;, &#39;%y%m%d&#39; ) AND ( EXISTS ( SELECT material_no FROM wareh_source_order_list c WHERE c.order_id = id AND ( c.material_name REGEXP &#39;string&#39; OR c.material_full REGEXP &#39;string&#39; OR c.material_lot REGEXP &#39;string&#39; ) ) OR source_of_delivery_note REGEXP &#39;string&#39; OR CONVERT ( source_bill_code USING utf8mb4 ) REGEXP &#39;string&#39; )
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值