Inhaltsverzeichnis
题目链接:
hdu5054 Alice and Bob
Heim Web-Frontend HTML-Tutorial BestCoder Round #11 (Div. 2) 前三题题解_html/css_WEB-ITnose

BestCoder Round #11 (Div. 2) 前三题题解_html/css_WEB-ITnose

Jun 24, 2016 am 11:56 AM
round

题目链接:

huangjing

hdu5054 Alice and Bob

思路:

就是(x,y)在两个参考系中的表示演完全一样。那么只可能在这个矩形的中点。。

题目:

Alice and Bob Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 216    Accepted Submission(s): 166


Problem Description

Bob and Alice got separated in the Square, they agreed that if they get separated, they'll meet back at the coordinate point (x, y). Unfortunately they forgot to define the origin of coordinates and the coordinate axis direction. Now, Bob in the lower left corner of the Square, Alice in the upper right corner of the the Square. Bob regards the lower left corner as the origin of coordinates, rightward for positive direction of axis X, upward for positive direction of axis Y. Alice regards the upper right corner as the origin of coordinates, leftward for positive direction of axis X, downward for positive direction of axis Y. Assuming that Square is a rectangular, length and width size is N * M. As shown in the figure:

Bob and Alice with their own definition of the coordinate system respectively, went to the coordinate point (x, y). Can they meet with each other ? 
Note: Bob and Alice before reaching its destination, can not see each other because of some factors (such as buildings, time poor).

 


Input

There are multiple test cases. Please process till EOF. Each test case only contains four integers : N, M and x, y. The Square size is N * M, and meet in coordinate point (x, y). ( 0

 


Output

If they can meet with each other, please output "YES". Otherwise, please output "NO".

 


Sample Input

                  <p class="sycode">                      10 10 5 510 10 6 6                  </p>
Nach dem Login kopieren

 


Sample Output

                  <p class="sycode">                      YESNO                  </p>
Nach dem Login kopieren

 


Source

BestCoder Round #11 (Div. 2)

 


Recommend

heyang   |   We have carefully selected several similar problems for you:   5057  5052  5051  5050  5049 


代码:

#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<map>#include<vector>#include<cmath>#include<string>#include<queue>#define eps 1e-9#define ll long long#define INF 0x3f3f3f3fusing namespace std;int  main(){    int x,y,n,m;    while(scanf("%d%d%d%d",&n,&m,&x,&y)!=EOF)    {        if(2*x==n&&2*y==m)            printf("YES\n");        else            printf("NO\n");    }  }</queue></string></cmath></vector></map></algorithm></cstring></cstdio></iostream>
Nach dem Login kopieren

hdu 5055 Bob and math problem

题意:

就是给出n个数字,然后要你找到一个满足如下条件的数。

(1)这个数是奇数。

(2)这个数是是最大的数。

(3)还有一个被cha的点是所有的数字都要用到。我就是0 0 1 被cha了。。我还故意特判这种情况,都是题目没有读懂啊。。

思路:

贪心的做法,首先看所有的位是否存在基数,如果基数都没有,那么肯定是不存在这种数的,其次如果有,那么就将最小的基数找出来做各位,然后将所有的位进行排序,然后从低位向高位赋值,那么就得到这个树了,最后判断一下,如果首位为0,那么这个数就是不存在的,因为要求输出所有的位。。

题目:

Bob and math problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 643    Accepted Submission(s): 245


Problem Description

Recently, Bob has been thinking about a math problem.
There are N Digits, each digit is between 0 and 9. You need to use this N Digits to constitute an Integer.
This Integer needs to satisfy the following conditions:

  • 1. must be an odd Integer.
  • 2. there is no leading zero.
  • 3. find the biggest one which is satisfied 1, 2.

  • Example: 
    There are three Digits: 0, 1, 3. It can constitute six number of Integers. Only "301", "103" is legal, while "130", "310", "013", "031" is illegal. The biggest one of odd Integer is "301".

     


    Input

    There are multiple test cases. Please process till EOF.
    Each case starts with a line containing an integer N ( 1 The second line contains N Digits _1, a_2, a_3, \cdots, a_n. ( 0 \leqwhich indicate the digit $a  a_i \leq 9)$.

     


    Output

    The output of each test case of a line. If you can constitute an Integer which is satisfied above conditions, please output the biggest one. Otherwise, output "-1" instead.

     


    Sample Input

                      <p class="sycode">                      30 1 335 4 232 4 6                  </p>
    Nach dem Login kopieren

     


    Sample Output

                      <p class="sycode">                      301425-1                  </p>
    Nach dem Login kopieren

     


    Source

    BestCoder Round #11 (Div. 2)

     


    Recommend

    heyang   |   We have carefully selected several similar problems for you:   5057  5052  5051  5050  5049 

     

    代码:

    #include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<map>#include<vector>#include<cmath>#include<string>#include<queue>#define eps 1e-9#define ll long long#define INF 0x3f3f3f3fusing namespace std;const int maxn=100+10;int a[maxn],odd[maxn];char str[maxn];int n;int  main(){    int ans,pd;    while(scanf("%d",&n)!=EOF)    {        memset(str,0,sizeof(str));        int cnt=0,first=0;        for(int i=1;i   <br>   <br>    <p class="sycode">   hdu 5056 Boring count  </p>  <p class="sycode">   题意:  </p>  <p class="sycode">   给出一个字符串,然后求出它所有的子串中每个字母的数目不超过k个的所有的子串的数目。。  </p>  <p class="sycode">   思路:  </p>  <p class="sycode">   枚举每一个字符,然后以每个字符i为子串末尾,然后得到的满足条件的子串的最长长度。。就算字母相同,只要位置不相同就算不同的。。2333333333,那么思路就是维护一个起点st,每当第i个字符的数目大于k后 ,那么就将st后移,同时将当前的每个cnt[i]减减,直到移动到与i相同的字符你,那么从st到i这段字符就满足条件了。。。觉得这个思路真是神奇。。。。  </p>  <p class="sycode">   题目;  </p>  <p class="sycode">   Boring count   <strong>Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)<br> Total Submission(s): 451    Accepted Submission(s): 169<br> </strong>   <br>   <br>   </p>
    <p class="sycode">    Problem Description   </p>   <p class="sycode">    You are given a string S consisting of lowercase letters, and your task is counting the number of substring that the number of each lowercase letter in the substring is no more than K.   </p>   <p class="sycode">        </p>   <br>   <p class="sycode">    Input   </p>   <p class="sycode">    In the first line there is an integer T , indicates the number of test cases.    <br> For each case, the first line contains a string which only consist of lowercase letters. The second line contains an integer K.    <br>    <br> [Technical Specification]    <br> 1 1  1    </p>
    <p class="sycode">        </p>   <br>   <p class="sycode">    Output   </p>   <p class="sycode">    For each case, output a line contains the answer.   </p>   <p class="sycode">        </p>   <br>   <p class="sycode">    Sample Input   </p>   <p class="sycode">    </p>
    <pre style="代码" class="precsshei">                  <p class="sycode">                      3abc1abcabc1abcabc2                  </p>
    Nach dem Login kopieren

     


    Sample Output

                      <p class="sycode">                      61521                  </p>
    Nach dem Login kopieren

     


    Source

    BestCoder Round #11 (Div. 2)

     


    Recommend

    heyang   |   We have carefully selected several similar problems for you:   5057  5052  5051  5050  5049 

    代码:

    #include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<map>#include<vector>#include<cmath>#include<string>#include<queue>#define eps 1e-9#define ll long long#define INF 0x3f3f3f3fusing namespace std;const  int maxn=100000+10;char str[maxn];int cnt[28];int main(){    ll ans;    int t,st,k,ly;    scanf("%d",&t);    while(t--)    {        memset(cnt,0,sizeof(cnt));        st=ans=0;        scanf("%s%d",str,&k);        for(int i=0;str[i]!='\0';i++)        {           ly=str[i]-'a';           cnt[ly]++;           if(cnt[ly]>k)           {              while(str[st]!=str[i])              {                 cnt[str[st]-'a']--;                 st++;              }               cnt[ly]--;               st++;           }           ans+=i-st+1;        }        printf("%I64d\n",ans);    }    return 0;}</queue></string></cmath></vector></map></algorithm></cstring></cstdio></iostream>
    Nach dem Login kopieren



    Erklärung dieser Website
    Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn

    Heiße KI -Werkzeuge

    Undresser.AI Undress

    Undresser.AI Undress

    KI-gestützte App zum Erstellen realistischer Aktfotos

    AI Clothes Remover

    AI Clothes Remover

    Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

    Undress AI Tool

    Undress AI Tool

    Ausziehbilder kostenlos

    Clothoff.io

    Clothoff.io

    KI-Kleiderentferner

    AI Hentai Generator

    AI Hentai Generator

    Erstellen Sie kostenlos Ai Hentai.

    Heißer Artikel

    R.E.P.O. Energiekristalle erklärten und was sie tun (gelber Kristall)
    3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. Beste grafische Einstellungen
    3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O. So reparieren Sie Audio, wenn Sie niemanden hören können
    3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌
    WWE 2K25: Wie man alles in Myrise freischaltet
    3 Wochen vor By 尊渡假赌尊渡假赌尊渡假赌

    Heiße Werkzeuge

    Notepad++7.3.1

    Notepad++7.3.1

    Einfach zu bedienender und kostenloser Code-Editor

    SublimeText3 chinesische Version

    SublimeText3 chinesische Version

    Chinesische Version, sehr einfach zu bedienen

    Senden Sie Studio 13.0.1

    Senden Sie Studio 13.0.1

    Leistungsstarke integrierte PHP-Entwicklungsumgebung

    Dreamweaver CS6

    Dreamweaver CS6

    Visuelle Webentwicklungstools

    SublimeText3 Mac-Version

    SublimeText3 Mac-Version

    Codebearbeitungssoftware auf Gottesniveau (SublimeText3)

    Was ist der Zweck des & lt; Fortschritts & gt; Element? Was ist der Zweck des & lt; Fortschritts & gt; Element? Mar 21, 2025 pm 12:34 PM

    Der Artikel erörtert den HTML & lt; Progress & gt; Element, Absicht, Styling und Unterschiede vom & lt; Meter & gt; Element. Das Hauptaugenmerk liegt auf der Verwendung & lt; Fortschritt & gt; Für Aufgabenabschluss und & lt; Meter & gt; für stati

    Was ist der Zweck des & lt; datalist & gt; Element? Was ist der Zweck des & lt; datalist & gt; Element? Mar 21, 2025 pm 12:33 PM

    Der Artikel erörtert den HTML & lt; Datalist & gt; Element, das die Formulare verbessert, indem automatische Vorschläge bereitgestellt, die Benutzererfahrung verbessert und Fehler reduziert werden.Character Count: 159

    Was ist der Zweck des & lt; Meter & gt; Element? Was ist der Zweck des & lt; Meter & gt; Element? Mar 21, 2025 pm 12:35 PM

    Der Artikel erörtert das HTML & lt; Meter & gt; Element, verwendet zur Anzeige von Skalar- oder Bruchwerten innerhalb eines Bereichs und seine gemeinsamen Anwendungen in der Webentwicklung. Es differenziert & lt; Meter & gt; von & lt; Fortschritt & gt; und Ex

    Was sind die besten Praktiken für die Kompatibilität des Cross-Browsers in HTML5? Was sind die besten Praktiken für die Kompatibilität des Cross-Browsers in HTML5? Mar 17, 2025 pm 12:20 PM

    In Artikel werden Best Practices zur Gewährleistung der HTML5-Cross-Browser-Kompatibilität erörtert und sich auf die Erkennung von Merkmalen, die progressive Verbesserung und die Testmethoden konzentriert.

    Wie verwende ich HTML5 -Formularvalidierungsattribute, um die Benutzereingabe zu validieren? Wie verwende ich HTML5 -Formularvalidierungsattribute, um die Benutzereingabe zu validieren? Mar 17, 2025 pm 12:27 PM

    In dem Artikel werden unter Verwendung von HTML5 -Formularvalidierungsattributen wie Erforderlich, Muster, Min, MAX und Längengrenzen erörtert, um die Benutzereingabe direkt im Browser zu validieren.

    Was ist das Ansichtsfenster -Meta -Tag? Warum ist es wichtig für reaktionsschnelles Design? Was ist das Ansichtsfenster -Meta -Tag? Warum ist es wichtig für reaktionsschnelles Design? Mar 20, 2025 pm 05:56 PM

    In dem Artikel wird das Ansichtsfenster -Meta -Tag erörtert, das für das reaktionsschnelle Webdesign auf mobilen Geräten unerlässlich ist. Es wird erläutert, wie die ordnungsgemäße Verwendung eine optimale Skalierung von Inhalten und Benutzerinteraktion gewährleistet, während Missbrauch zu Design- und Zugänglichkeitsproblemen führen kann.

    Wie benutze ich die HTML5 & lt; Zeit & gt; Element, um Daten und Zeiten semantisch darzustellen? Wie benutze ich die HTML5 & lt; Zeit & gt; Element, um Daten und Zeiten semantisch darzustellen? Mar 12, 2025 pm 04:05 PM

    Dieser Artikel erklärt den HTML5 & lt; Time & gt; Element für semantische Datum/Uhrzeit. Es betont die Wichtigkeit des DateTime-Attributs für die Maschinenlesbarkeit (ISO 8601-Format) neben menschenlesbarem Text, das Zubehör steigert

    Was ist der Zweck des & lt; iframe & gt; Etikett? Was sind die Sicherheitsüberlegungen bei der Verwendung? Was ist der Zweck des & lt; iframe & gt; Etikett? Was sind die Sicherheitsüberlegungen bei der Verwendung? Mar 20, 2025 pm 06:05 PM

    Der Artikel erörtert das & lt; iframe & gt; Der Zweck von Tag, externe Inhalte in Webseiten, seine gemeinsamen Verwendungen, Sicherheitsrisiken und Alternativen wie Objekt -Tags und APIs einzubetten.

    See all articles