<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關鍵字專題1關鍵字專題50關鍵字專題500關鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關鍵字專題關鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當前位置: 首頁 - 科技 - 知識百科 - 正文

        CodeforcesRound#283(Div.2)D.TennisGame_html/css

        來源:懂視網 責編:小采 時間:2020-11-27 16:00:03
        文檔

        CodeforcesRound#283(Div.2)D.TennisGame_html/css

        CodeforcesRound#283(Div.2)D.TennisGame_html/css_WEB-ITnose:標程貌似是二分? 我預處理標記了一下,然后從1到n枚舉t,因為對于每個t,若s存在,那么s是唯一的,所以枚舉t即可。 判斷t是否合法,直接暴力的話,會超時 不知道標程大致思想是否跟我的一樣,也許就是標程沒有標記而是二分來找 但是,我的時間復雜度
        推薦度:
        導讀CodeforcesRound#283(Div.2)D.TennisGame_html/css_WEB-ITnose:標程貌似是二分? 我預處理標記了一下,然后從1到n枚舉t,因為對于每個t,若s存在,那么s是唯一的,所以枚舉t即可。 判斷t是否合法,直接暴力的話,會超時 不知道標程大致思想是否跟我的一樣,也許就是標程沒有標記而是二分來找 但是,我的時間復雜度

        標程貌似是二分?

        我預處理標記了一下,然后從1到n枚舉t,因為對于每個t,若s存在,那么s是唯一的,所以枚舉t即可。

        判斷t是否合法,直接暴力的話,會超時

        不知道標程大致思想是否跟我的一樣,也許就是標程沒有標記而是二分來找

        但是,我的時間復雜度是更優的,n*(1+1/2+1/3+......1/n)=n*lnn的做法


        #include#include#include#include#include#include#include#include#include#includeusing namespace std;struct Ans{	int s,t;	Ans(){}	Ans(int a,int b){s=a;t=b;}	bool operator <(Ans x)const	{	return s!=x.s?sbp[t2]))	{	t1=as[bp[t2]]+s;	t2+=s;	y++;	}	else	return 0;	}}int main(){	int i,t,m;	scanf("%d",&n);	for(i=0;i


        D. Tennis Game

        time limit per test

        2 seconds

        memory limit per test

        256 megabytes

        input

        standard input

        output

        standard output

        Petya and Gena love playing table tennis. A single match is played according to the following rules: a match consists of multiple sets, each set consists of multiple serves. Each serve is won by one of the players, this player scores one point. As soon as one of the players scores t points, he wins the set; then the next set starts and scores of both players are being set to 0. As soon as one of the players wins the total ofs sets, he wins the match and the match is over. Heres and t are some positive integer numbers.

        To spice it up, Petya and Gena choose new numbers s andt before every match. Besides, for the sake of history they keep a record of each match: that is, for each serve they write down the winner. Serve winners are recorded in the chronological order. In a record the set is over as soon as one of the players scores t points and the match is over as soon as one of the players winss sets.

        Petya and Gena have found a record of an old match. Unfortunately, the sequence of serves in the record isn't divided into sets and numberss and t for the given match are also lost. The players now wonder what values ofs and t might be. Can you determine all the possible options?

        Input

        The first line contains a single integer n ? the length of the sequence of games (1?≤?n?≤?105).

        The second line contains n space-separated integersai. Ifai?=?1, then thei-th serve was won by Petya, if ai?=?2, then the i-th serve was won by Gena.

        It is not guaranteed that at least one option for numberss and t corresponds to the given record.

        Output

        In the first line print a single number k ? the number of options for numberss and t.

        In each of the following k lines print two integerssi andti ? the option for numberss and t. Print the options in the order of increasingsi, and for equalsi ? in the order of increasingti.

        Sample test(s)

        Input

        51 2 1 2 1

        Output

        21 33 1

        Input

        41 1 1 1

        Output

        31 42 24 1

        Input

        41 2 1 2

        Output

        Input

        82 1 2 1 1 1 1 1

        Output

        31 62 36 1

        聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        CodeforcesRound#283(Div.2)D.TennisGame_html/css

        CodeforcesRound#283(Div.2)D.TennisGame_html/css_WEB-ITnose:標程貌似是二分? 我預處理標記了一下,然后從1到n枚舉t,因為對于每個t,若s存在,那么s是唯一的,所以枚舉t即可。 判斷t是否合法,直接暴力的話,會超時 不知道標程大致思想是否跟我的一樣,也許就是標程沒有標記而是二分來找 但是,我的時間復雜度
        推薦度:
        • 熱門焦點

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 国产精品亚洲а∨无码播放| 亚洲国产成人精品无码久久久久久综合| 亚洲午夜国产精品无码| 香蕉视频免费在线播放| 国产一区二区免费在线| 美女被吸屁股免费网站| 亚洲第一网站男人都懂| 一个人免费观看视频在线中文| 亚洲国产成人五月综合网 | 亚洲精品国产福利片| 岛国av无码免费无禁网站| 亚洲精品日韩专区silk| 日本XXX黄区免费看| 亚洲精品无码日韩国产不卡av| 国产午夜无码片免费| 亚洲V无码一区二区三区四区观看| 暖暖免费日本在线中文| 水蜜桃亚洲一二三四在线| 999久久久免费精品国产| 国产AV旡码专区亚洲AV苍井空| 在线观看片免费人成视频无码| 亚洲av日韩av高潮潮喷无码| 88xx成人永久免费观看| 99热亚洲色精品国产88| 免费成人黄色大片| 拍拍拍无挡视频免费观看1000| 亚洲精品永久www忘忧草| 日韩视频在线免费观看| 国产成人精品日本亚洲直接| 亚洲AⅤ无码一区二区三区在线| 国偷自产一区二区免费视频| 亚洲国产美女视频| 97碰公开在线观看免费视频| 亚洲妇女无套内射精| 亚洲精品午夜无码电影网| 免费观看黄色的网站| 麻豆91免费视频| 亚洲第一成年人网站| 亚洲国产成人久久综合区| 亚洲人成在线免费观看| 特黄特色的大片观看免费视频|