原创 Gym - 101612A 點亮數字

Auxiliary Project Anna has just nished her course project. She has a lot of seven-segment LED displays as leftover

原创 線段樹(動態建點)

敵兵佈陣 Problem Description C國的死對頭A國這段時間正在進行軍事演習,所以C國間諜頭子Derek和他手下Tidy又開始忙乎了。A國在海岸線沿直線佈置了N個工兵營地,Derek和Tidy的任務就是要監視這些工兵

原创 JavaScript & php 正則表達式

百度搜出來這東西。。。 PHP中創建字符串,使用正則匹配函數,返回true/false <?php $pattern="/\w{6,20}/"; $str="djkduhgk"; preg_match($pattern,$s

原创 分糖果

CF-gym-334-A Gerald has n younger brothers and their number happens to be even. One day he bought n2 candy bags. On

原创 Lucas 組合數取模

組合數取模就是求 CnmmodpCmnmodp 的值,當然根據n,m,pn,m,p 的取值範圍不同,採取的方法也不一樣。 pp 比較大就只能一個一個算如 LL C_one_by_one(LL n, LL m)//組合數一個一個算

原创 Sunday 字符串匹配

主串爲s,模式串爲p s=abcdefg p=efg i abcdefg j efg 首先從頭開始比較,第一個字符不一樣,那麼新的下標m=i+ p.length,即s[m]=’d’ 然後在p中從後往前找’d’ ,即i

原创 Cover Point (DP)

Cover Time Limit: 1000MS Memory Limit: 65536K You are given ​N points in the coordinate system. They need to

原创 機器人指令縮減【模擬】

CF-GYM-101608-E You built a new robot that moves over r × c grid. The rows of the grid are numbered from 1 to r fro

原创 Arthur's Language

CF-101628-A Arthur is an extremely important person and rarely has the time to talk. To minimize the time spent wit

原创 小小粉絲度度熊【尺取】

小小粉絲度度熊 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 度度熊喜歡

原创 宇宙通信

CF-101466-C Lately the communication between planets has been an important issue, which is why the Earth has made m

原创 二維線段樹之降維打擊

COCI 2017/2018 ROUND#1Deda Little Marica is making up a nonsensical unusual fairy tale and is telling to her grandf

原创 Chess

Chess Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description 車是中國象棋中

原创 Yet Another Tree Query Problem(二維線段樹)

Yet Another Tree Query Problem Time Limit: 3 Seconds Memory Limit: 65536 KB Given a tree with vertices, which

原创 Winning Cells

GYM-101608-M You and your friend decided to play a new game using a squared chessboard of size n × n and one rook.