• 2024-06-19基于QT和C++实现的中国象棋
    一,源码board.h#ifndefBOARD_H#defineBOARD_H#include<QWidget>#include"Stone.h"classBoard:publicQWidget{Q_OBJECTpublic:explicitBoard(QWidget*parent=0);bool_bRedTurn;//红方先走int_currentPlayer;//当前玩
  • 2024-05-19My favorite story(revised)
    Iwasaboywhothoughtlifewaspointless.Youcouldoftenhearmecomplainingtomyfather“Whatisthemeaningoflife?”Myfatherwouldalwayslookatmewithlovingeyes,butneveranswerdirectly.Onedaymyfatheraccidentallyfoundanordinarystone.H
  • 2024-05-19Narrative writing revision
    In221BCE,I-QinshihuangbecametheFirstEmperorofChina.AstorytellertoldmeaninterestingtaleaboutNuwa,theGreatMotherGoddess.Thenanideaappearedinmymind.Iwasdeterminedtofindtheloststone.Soitwouldhelpmebuildastrongempi
  • 2024-05-13My Favorite Story
    Iwasaboywhothoughtlifewaspointless.Youcouldoftenhearmecomplainingtomyfather“Whatisthemeaningoflife?”Myfatherwouldalwayslookatmewithlovingeyes,butneveranswerdirectly.Onedaymyfatherfoundanordinarystone.Hehandedtom
  • 2024-04-27A written script
    In221BCE,I-QinshihuangbecametheFirstEmperorofChina.AstorytellertoldmeaninterestingtaleaboutNuwa,theGreatMother Goddess.Thenanideaappearedinmymind.Iwas determined tofindtheloststone.Soitwouldhelpmebuildastrongempi
  • 2024-02-08ARC171 - sol
    感觉难度并不大,但是就是做不起,呜呜呜。中等题练少了是这样的。AtCoderRegularContest171-AtCoderA-NoAttackingThereisachessboardwith\(N\)rowsand\(N\)columns.Let\((i,j)\)denotethesquareatthe\(i\)-throwfromthetopandthe\(j\)-thco
  • 2023-09-22[JOI 2023 Final] Stone Arranging 2
    洛谷P9349题意一种区间覆盖操作,可以考虑直接无脑线段树,复杂度为\(O(nlog_n)\)。但是观察后发现可以开一个桶,记录这个数在序列中出现的最后一次的下标。循环扫一遍原序列,从小到大对于每一个a[i],使得下标i到m[a[i]]的区间全部覆盖为a[i]。每次覆盖一个小区间后,因为前面的区间已
  • 2023-08-28Codeforces Round 885 (Div. 2)E. Vika and Stone Skipping(数学,质因数分解)
    题目链接:https://codeforces.com/problemset/problem/1848/E 大致题意: 打水漂,某人在海岸线以f(正整数)的力量扔出石头,会在f,f+(f-1),f+(f-1)+(f-2),........,f+(f-1)+.....+2+1,的位置接触水面; 现在给出坐标x和q次询问,每次询问给出一个y值,将x=x*y;假设石头在x的位置接触水面,问有多少
  • 2023-08-15Lifting the Stone
    Smiling&Weeping----繁花落尽,我心中仍有花落的声音  一朵,一朵,在无人的山间轻轻飘落题目链接:1385--LiftingtheStone(poj.org)思路:将多边形三角剖分,计算出每个三角形的重心,三角形的重心是顶
  • 2023-07-17CodeForces 1848E Vika and Stone Skipping
    洛谷传送门CF传送门感觉比这场的F简单。发现我们要进行\(x\)不断乘一些数然后求答案的操作,猜测答案与\(x\)的因数有关。如果你对数字比较敏感,不难发现答案就是\(x\)的奇因子个数。官方题解的证明:设\(x=f+(f-1)+\cdots+(f-(c-1))\),由等差数列求和公
  • 2023-07-03P2895(未解决)
    这是一道略复杂的常规BFS题,但我想用DFS来解决,结果写出代码却总是主函数异常返回,不知哪里错了,检查半天也没发现,以后再看看吧。Code#include<iostream>#include<cstdio>#include<string>#include<vector>#include<algorithm>#include<cstdlib>#include<cmath>usingnamesp
  • 2023-05-31石子合并(GarsiaWachs算法)
    对于石子合并问题,有一个最好的算法,那就是GarsiaWachs算法。时间复杂度为O(n^2)。它的步骤如下:设序列是stone[],从左往右,找一个满足stone[k-1]<= stone[k+1]的k,找到后合并stone[k]和stone[k-1],再从当前位置开始向左找最大的j,使其满足stone[j]> stone[k]+stone[k-1],插到j的后面就
  • 2023-05-04Curling 2.0
     G-Curling2.0OnPlanetMM-21,aftertheirOlympicgamesthisyear,curlingisgettingpopular.Buttherulesaresomewhatdifferentfromours.Thegameisplayedonanicegameboardonwhichasquaremeshismarked.Theyuseonlyasinglestone.The
  • 2023-03-23C++重载递增和递减运算符
    重载递增和递减运算符在迭代器类中通常会实现递增运算符(++)和递减运算符(--),这两种运算符使得类可以在元素的序列中前后移动。C++语言并不要求递增和递减运算符必须是类
  • 2023-03-11A. Stone Game
    A.StoneGame代码点击查看代码#include<iostream>#include<vector>#include<algorithm>usingnamespacestd;intmain(){ intt; cin>>t; while(t--){
  • 2023-02-2659.类的自动转换和强制类型转换
    程序清单11.16stonewt.h#pragmaonce//stone.h--Stonewt类声明#ifndefSTONEWT_H_#defineSTONEWT_H_classStonewt{private: enum{Lbs_per_stn=14};//poun
  • 2023-02-15leetcode-10460-easy
    LastStoneWeightYouaregivenanarrayofintegersstoneswherestones[i]istheweightoftheithstone.Weareplayingagamewiththestones.Oneachtur
  • 2023-02-14C++PrimerPlus中文第六版第11章编程练习答案
    1、//vector.h#ifndefVECTOR_H_#defineVECTOR_H_#include<iostream>namespaceVECTOR{classVector{public:enumMode{RECT,POL};
  • 2023-02-08POJ--3009 Curling 2.0(DFS+减枝)
    记录23:412023-2-8http://poj.org/problem?id=3009reference:《挑战程序设计竞赛(第2版)》第二章练习题索引p135DescriptionOnPlanetMM-21,aftertheirOlympic
  • 2023-02-08拿石子dp
    每次从一开始或者最后拿,拿多的赢#include<iostream>usingnamespacestd;intstone[10];intdp[10][10];//从i到j两人数量差的最大值intmain(){intn;
  • 2023-02-07The Preliminary Contest for ICPC Asia Shanghai 2019 J. Stone game —— 退背包
     CSLlovesstonegames.Hehas nn stones;eachhasaweight a_iai.CSLwantstogetsomestones.Theruleisthatthepilehegetsshouldhaveahigherore
  • 2023-01-30hdu:Two Rabbits(区间DP)
    ProblemDescriptionLonglongago,therelivedtworabbitsTomandJerryintheforest.Onasunnyafternoon,theyplannedtoplayagamewithsomestones.Th
  • 2022-11-22NOIP2015Day2T1-跳石头
    1.跳石头(stone.cpp/c/pas)【问题描述】一年一度的“跳石头”比赛又要开始了!这项比赛将在一条笔直的河道中进行,河道中分布着一些巨大岩石。组委会已经选择好了两块岩石
  • 2022-11-15[LeetCode] 947. Most Stones Removed with Same Row or Column
    Ona2Dplane,weplace n stonesatsomeintegercoordinatepoints.Eachcoordinatepointmayhaveatmostonestone.Astonecanberemovedifitshareseit
  • 2022-11-12洛谷-1052
    洛谷-1052思路文字版视频版Code#include<bits/stdc++.h>usingnamespacestd;#define_u_u_ios::sync_with_stdio(false),cin.tie(nullptr)#definecfint_o_o