SMU Spring 2023 Trial Contest Round 1】的更多相关文章

1001 数长方形 题目大意 平面内有N条平行于坐标轴的线段,且不会在端点处相交 问共形成多少个矩形 算法思路 枚举4条线段的全部组合.分别作为矩形四条边.推断是否合法 时间复杂度: O(N4) 代码 /** * Copyright © 2015 Authors. All rights reserved. * * FileName: A.cpp * Author: Beiyu Li <sysulby@gmail.com> * Date: 2015-06-06 */ #include <c…
题意: 有一个a+b=c的等式,去掉两个符号,把三个数连在一起得到一个数 给出这个数,要求还原等式,length <= 1e6 三个数不能含有前导0,保证有解 解法: 铁头过题法,分类然后各种判断 我分了5种情况 0.开头字符为0, 那么结果一定是0+a=a的形式 然后4种情况 1.len(a) >= len(b) 且 len(c) == len(a) 2.len(a) <= len(b) 且 len(c) == len(b) 3.len(a) >= len(b) 且 len(c)…
这道题目灰常简单,我们先从最简单的3个字符串开始 有以下几种情况: 可以看到,只有在中间是O的情况下才有可能变成MOO 辣么我们不妨在在s串中枚举这个中间 O 每枚举到一个就看看能不能用他的本身操作次数加上删除旁边的字符次数得出的实际操作次数来更新ans(取min)(记得在for开始前判断s长度是否<3,<3就return -1) 最后如果ans还是开始的那个值return -1,else return ans; 程序: #include<bits/stdc++.h> using…
A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have decided to watch the best moments of some movie. There are two buttons on your player: Watch the current minute…
http://delphi.about.com/od/windowsshellapi/l/aa093003a.htm Page 1: How Delphi dispatches messages in windowed applications Article submitted by Catalin Ionescu for the Delphi Programming Quickies Contest - Round #2 Winner! Learn how to send signals t…
F. TorCoder time limit per test 3 seconds memory limit per test 256 megabytes input input.txt output output.txt A boy named Leo doesn't miss a single TorCoder contest round. On the last TorCoder round number 100666 Leo stumbled over the following pro…
http://codeforces.com/problemset/problem/499/B B. Lecture     You have a new professor of graph theory and he speaks very quickly. You come up with the following plan to keep up with his lecture and make notes. You know two languages, and the profess…
线段树统计和维护某一区间内的字母个数.. . . F. TorCoder time limit per test 3 seconds memory limit per test 256 megabytes input input.txt output output.txt A boy named Leo doesn't miss a single TorCoder contest round. On the last TorCoder round number 100666 Leo stumbl…
问题 A: 剪纸片 时间限制: 1 Sec 内存限制: 128 MB 题目描写叙述 这是一道简单的题目,假如你身边有一张纸.一把剪刀.在H-star的比赛现场,你会这么做: 1. 将这张纸剪成两片(平行于短边剪开): 2. 将当中一片剪成一个圆.作为圆柱的底面. 3. 纸的还有一片的一边沿着圆的周长将圆围起来,直到围成一圈.形成一个无盖的圆柱体. 须要注意的是,纸片可能会有重叠部分. 聪明的你机智的你喜欢思考的你这时候就開始想,一张纸片按上述方式所组成的圆柱的最大体积是多少呢?请你用编程解决问题…
[cf contest 893(edu round 33)] F - Subtree Minimum Query time limit per test 6 seconds memory limit per test 512 megabytes input standard input output standard output You are given a rooted tree consisting of n vertices. Each vertex has a number writ…