<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无码免费高潮水| 国产成人精品男人免费| 亚洲av无码专区国产不乱码| 免费观看的毛片手机视频| 91在线亚洲综合在线| 成年女人看片免费视频播放器| 亚洲人成电影网站| av无码免费一区二区三区| 亚洲精品综合在线影院| 最好免费观看韩国+日本| 亚洲成AV人片高潮喷水| 免费国产小视频在线观看| 男女啪啪免费体验区| 在线精品亚洲一区二区小说 | 在线观看AV片永久免费| 亚洲AV色吊丝无码| 在线观着免费观看国产黄| 一级做a爰片性色毛片免费网站| 中文字幕久久亚洲一区| 国产免费阿v精品视频网址| 久久亚洲精品AB无码播放| 亚欧在线精品免费观看一区| 亚洲综合中文字幕无线码| 成人免费无码精品国产电影| 久久毛片免费看一区二区三区| 亚洲无线电影官网| 无码人妻一区二区三区免费| 国产午夜亚洲精品不卡免下载| 亚洲一本大道无码av天堂| 无码日韩精品一区二区三区免费| 67194在线午夜亚洲| 免费观看日本污污ww网站一区| www一区二区www免费| 亚洲小视频在线观看| 日本一道本高清免费| 久久er国产精品免费观看2| 亚洲国产日韩精品| 亚洲综合精品香蕉久久网| 波多野结衣免费在线|