首页 > TAG信息列表 > 1320
1320: [蓝桥杯2017初赛]方格分割(DFS)
1320: [蓝桥杯2017初赛]方格分割 主要是思维啦 由于切割后两部分要对称,切割线总会经过整个方块的中心点(3,3),从中心点出发,只需要遍历找到半条分割线,一旦走到边界点即分隔出一种,一条路结束。 但由于dfs是一条路走到黑,设置vis时要将对称点也设置成1, 走一条路的时候要在从这点出发[LeetCode]1320. Minimum Distance to Type a Word Using Two Fingers 动态规划解法
题目描述 LeetCode原题链接:1320. Minimum Distance to Type a Word Using Two Fingers You have a keyboard layout as shown above in the X-Y plane, where each English uppercase letter is located at some coordinate. For example, the letter 'A' is located at1320:【例6.2】均分纸牌(Noip2002)
均分纸牌 1 #include<iostream> 2 #include<cstdio> 3 using namespace std; 4 const int N=105; 5 int t[N]; 6 int main(){ 7 int n,sum=0,ans=0; 8 cin>>n; 9 for(int i=1;i<=n;i++){ 10 cin>>t[i]; 11 sum+