
模拟
SingleK
这个作者很懒,什么都没留下…
展开
-
HDU 5983 - Pocket Cube(模拟)
Pocket CubeProblem DescriptionThe Pocket Cube, also known as the Mini Cube or the Ice Cube, is the 2 × 2 × 2 equivalence of a Rubik’s Cube.The cube consists of 8 pieces, all corners.Each piece is labe...原创 2017-10-22 17:33:17 · 299 阅读 · 0 评论 -
Uva 11054 - Wine trading in Gergovia(模拟)
As you may know from the comic “Asterix andthe Chieftain’s Shield”, Gergovia consists of one street, and every inhabitantof the city is a wine salesman. You wonder how this economy works? Simple enoug...原创 2017-12-26 22:46:14 · 240 阅读 · 0 评论 -
hihocoder 1671 - 反转子串(模拟)
题目链接 https://vjudge.net/problem/HihoCoder-1671【思路】 类似括号匹配,递归函数的妙用。le,ri记录括号的相对位置。#include<bits/stdc++.h>using namespace std;const int maxn = 5000050;int len;char s[maxn];int st[max...原创 2018-01-29 11:15:53 · 933 阅读 · 0 评论 -
Uva 1610 - Party Games(模拟)
You’ve been invited to a party. The hostwants to divide the guests into 2 teams for party games, with exactly the samenumber of guests on each team. She wants to be able to tell which guest is onwhic...原创 2017-12-24 23:11:33 · 321 阅读 · 0 评论 -
Uva 442 - Matrix Chain Multiplication(模拟)
题目链接 https://cn.vjudge.net/problem/UVA-442【题意】 输入n个矩阵的维度和一些矩阵链乘表达式,输出乘法次数。如果乘法无法执行,输出error。假定A是m×n矩阵,B是n×p矩阵,则A×B的结果是一个m×p矩阵,乘法次数是m×n×p,当左边矩阵的列不等于右边矩阵的行时,乘法就无法进行。保证输入合法并且每个括号里面只包含两个矩阵。【思路】 用一个栈来...原创 2018-03-27 17:21:59 · 207 阅读 · 0 评论 -
POJ 1298 - The Hardest Problem Ever(模拟)
题目链接 https://cn.vjudge.net/problem/POJ-1298简单模拟,每个字母往前推5个位置#include<cstdio>#include<iostream>#include<algorithm>#include<cctype>#include<cstring>#include<stri...原创 2018-06-06 19:23:15 · 159 阅读 · 0 评论 -
HDU 6308 - Time Zone [2018杭电多校联赛第一场 K](模拟)
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=6308【题意】 给你某个时区的时间,让你转换成东八区的时间,格式为hh mm UTC+X(UTC-X UTC+X.Y或者是UTC-X.Y)的形式【思路】 把时间都换成分钟计算,按题意模拟即可,最后取模防止时间为负数或超过23:59#include&lt;bits/stdc++.h&gt;...原创 2018-07-28 20:02:08 · 157 阅读 · 0 评论 -
UVA 1641 - ASCII Area(模拟)
题目链接 https://cn.vjudge.net/problem/UVA-1641【题意】 在一个n*w的字符矩阵里(2<=h,w<=100)用 “.” “/” “\” 画出一个多边形并计算面积【思路】 从上到下从左到右模拟,字符”/”和”\”对应的格子时半白半黑,其它格子时全黑或全白,用一个变量in记录当前格子是否在多边形内部即可#include<b...原创 2018-08-28 18:31:41 · 212 阅读 · 0 评论 -
UVA 808 - Bee Breeding(建坐标系+找规律)
题目链接 https://cn.vjudge.net/problem/UVA-808【题意】 给定两个格子的编号a和b(1<=a,b<=10000)求它们之间的最短距离 【思路】 太菜了,这种题根本没思路,看了别人的题解才会做. 大概是建立平面坐标系,一个x轴一个y轴,然后用向量表示每个点,向量位于一三象限时最短路为坐标绝对值之和,位于二四象限时最短路为坐标绝对值的最大值...原创 2018-08-24 19:25:17 · 639 阅读 · 1 评论