Codeforces Round #279 (Div. 2) 解题报告_html/css_WEB-ITnose
A - Team Olympiad
贪心水题。。都从第一个开始取即可。
代码如下:
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>using namespace std;#define LL __int64int a[6000], b[6000];int main(){ int n, x, y, z, ans, i, j; while(scanf("%d",&n)!=EOF) { x=y=z=0; for(i=0;i<n scanf memset for if x b else y z ans="min(x,min(y,z));" printf puts return> <br> B - Queue <br> <p></p> <p>通过用数组记录下一个位置,分别把偶数位置与奇数位置上的填满。</p> <p>偶数位置上一定是从0开始的,奇数位置一定是从一个没有出度只有入度的一个数开始的。</p> <p>代码如下:</p> <p></p> <pre name="code" class="sycode">#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>using namespace std;#define LL __int64int next[1100000], a[1100000], out[1100000];struct node{ int u, v;}fei[1100000];int main(){ int n, i, j, u, v, cnt, pos; while(scanf("%d",&n)!=EOF) { memset(next,-1,sizeof(next)); memset(out,0,sizeof(out)); for(i=0;i<n scanf next out cnt="1;" for if break a pos="fei[i].u;" printf return> <br> C - Hacking Cypher <br> <p></p> <p>分别从前和后扫一遍记录下能整除的位置。从前往后的很好处理。</p> <p>至于从后往前的,对于第k位来说,可以先预处理10^k对b的余数和以及前k位对b的余数,然后,后几位=总数-前k位表示的数*10^k。所以只要满足总数%b==(前k位表示的数%b)*(10^k%b)%b,就标明后几位表示的数可以整除b。</p> <p>这样就可以在O(n)的复杂度内完成了。</p> <p>表示自己真是弱渣。。看别人都一会儿就做出来了。。自己却想了半个小时才想出来。。。</p> <p>代码如下:</p> <p></p> <pre name="code" class="sycode">#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>using namespace std;#define LL __int64int a[1100000], b[1100000], c[1100000], d[1100000];char s[1100000];int main(){ int aa, bb, i, x, len, pos, flag=0, y; gets(s); scanf("%d%d",&aa,&bb); memset(a,0,sizeof(a)); memset(d,0,sizeof(d)); x=1; c[1]=1%bb; for(i=2;i <br> D - Chocolate <br> <p></p> <p>如果最终的面积相等的话,那么2的因子数与3的因子数一定相等。所以可以先求出2的因子数与3的因子数。然后这时候我们可以有两种操作:消去一个2或者把一个3变成2.所以这时候先把3较大的一方变成2,使得剩下的3相等,然后再消去2的因子数较大的一方使得相等。然后在判断这时候双方面积相等即可。</p> <p>代码如下:</p> <p></p> <pre name="code" class="sycode">#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <stdlib.h>#include <math.h>#include <ctype.h>#include <queue>#include <map>#include <set>#include <algorithm>using namespace std;#define LL __int64int main(){ int a1, b1, a2, b2, x2, x3, y2, y3, ans, m1, m2, n1, n2; while(scanf("%d%d%d%d",&a1,&b1,&a2,&b2)!=EOF) { m1=a1; m2=a2; n1=b1; n2=b2; x2=x3=y2=y3=0; while(!(a1%2)||!(a1%3)) { if(a1%2==0) { x2++; a1/=2; } if(a1%3==0) { x3++; a1/=3; } } while(!(b1%2)||!(b1%3)) { if(b1%2==0) { x2++; b1/=2; } if(b1%3==0) { x3++; b1/=3; } } while(!(a2%2)||!(a2%3)) { if(a2%2==0) { y2++; a2/=2; } if(a2%3==0) { y3++; a2/=3; } } while(!(b2%2)||!(b2%3)) { if(b2%2==0) { y2++; b2/=2; } if(b2%3==0) { y3++; b2/=3; } } if(x3>=y3) { x2+=x3-y3; ans=x3-y3; for(int i=0; i<x3-y3 i if m1="m1/3*2;" else n1="n1/3*2;" y2 ans="y3-x3;" for m2="m2/3*2;" n2="n2/3*2;">=y2) { for(int i=0; i<x2-y2 i if m1 else n1 for m2 n2 puts printf return> <br> <br> <p></p> </x2-y2></x3-y3></algorithm></set></map></queue></ctype.h></math.h></stdlib.h></cstring></string></cstdio></iostream>

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











이 기사는 HTML & lt; Progress & Gt에 대해 설명합니다. 요소, 그 목적, 스타일 및 & lt; meter & gt의 차이; 요소. 주요 초점은 & lt; progress & gt; 작업 완료 및 & lt; meter & gt; Stati의 경우

이 기사는 HTML & LT; Datalist & GT에 대해 논의합니다. 자동 완성 제안을 제공하고, 사용자 경험을 향상시키고, 오류를 줄임으로써 양식을 향상시키는 요소. 문자 수 : 159

이 기사는 HTML & lt; meter & gt에 대해 설명합니다. 범위 내에 스칼라 또는 분수 값을 표시하는 데 사용되는 요소 및 웹 개발의 일반적인 응용 프로그램. & lt; meter & gt; & lt; Progress & Gt; 그리고 Ex

이 기사는 모바일 장치의 반응 형 웹 디자인에 필수적인 Viewport Meta Tag에 대해 설명합니다. 적절한 사용이 최적의 컨텐츠 스케일링 및 사용자 상호 작용을 보장하는 방법을 설명하는 반면, 오용은 설계 및 접근성 문제로 이어질 수 있습니다.

이 기사는 html5 & lt; time & gt; 시맨틱 날짜/시간 표현 요소. 인간이 읽을 수있는 텍스트와 함께 기계 가독성 (ISO 8601 형식)에 대한 DateTime 속성의 중요성을 강조하여 Accessibilit를 향상시킵니다.

기사는 HTML5 크로스 브라우저 호환성을 보장하기위한 모범 사례에 대해 논의하고 기능 감지, 점진적 향상 및 테스트 방법에 중점을 둡니다.

이 기사에서는 브라우저에서 직접 사용자 입력을 검증하기 위해 필요한, Pattern, Min, Max 및 Length 한계와 같은 HTML5 양식 검증 속성을 사용하는 것에 대해 설명합니다.

이 기사는 & lt; iframe & gt; 외부 컨텐츠를 웹 페이지, 공통 용도, 보안 위험 및 객체 태그 및 API와 같은 대안을 포함시키는 태그의 목적.
