search
HomeWeb Front-endHTML TutorialCodeforces Round #280 (Div. 2)_html/css_WEB-ITnose

This question is surprisingly simple


ABC is almost all sign-in questions


For D,

Convert the shooting time of two people into integers

Find a gcd and divide it.

Assume that the shooting frequency of the two people is 1 second x, 1 second y respectively

x, y’s gcd is g

Converting it is equivalent to

The first person shoots one shot at y/g seconds, and the second person shoots one shot at x/g seconds

Then the two people will shoot at the same time at x/g*y/g seconds

Then each x/g*y/g second is a cycle

Assume the monster’s blood has a, then a% (x y) is the blood volume to be shot in the last cycle

At this time, I am too lazy to continue thinking. Just halve the number of times someone shoots, and that’s it.


#include <iostream>#include <cstdio>#include <cstring>#include <queue>#include <cmath>#include <algorithm>#include <map>#define MAXN 55555#define MAXM 222222#define INF 1000000001using namespace std;int n, x, y, a;int main() {    scanf("%d%d%d", &n, &x, &y);    int g = __gcd(x, y);    x /= g;    y /= g;    for(int i = 0; i > 1;                long long tmp = (long long)mid * (long long)y;                long long z = tmp / (long long)x;                if(z + mid > a) {                    high = mid - 1;                } else if(z + mid == a) {                    flag = 1;                    break;                } else {                    low = mid + 1;                }            }            if(flag) {                puts("Vanya");            } else {                puts("Vova");            }        }    }    return 0;}</map></algorithm></cmath></queue></cstring></cstdio></iostream>



If E

the question gives a good limit

that is, from the x direction or the y direction, you start from Start walking at 0 and walk n steps. You will definitely be able to traverse all 0~n-1

. Then you simulate walking n steps from 0 in the x direction and get an x ​​coordinate sequence

y Coordinates do the same thing

two sequences. They are all cyclic

Then you choose to start from a certain point (x0, y0)

It is nothing more than two sequences, the x sequence starts from x0, and the y sequence starts from y0, Each took n steps to see which points met the requirements of the question

Looking again, I found that it was nothing more than looking at the relative positions of the two sequences.

For all given points, calculate the relative positions of the two corresponding sequences, and finally count


#include <iostream>#include <cstdio>#include <cstring>#include <queue>#include <cmath>#include <algorithm>#include <map>#define MAXN 55555#define MAXM 222222#define INF 1000000001using namespace std;int posx[1111111], posy[1111111];int n, m, dx, dy;int x[111111], y[111111];int num[1111111];int main() {    scanf("%d%d%d%d", &n, &m, &dx, &dy);    int now = 0;    int ind = 0;    while(posx[now] == 0) {        posx[now] = ++ind;        now = (now + dx) % n;    }    now = 0, ind = 0;    while(posy[now] == 0) {        posy[now] = ++ind;        now = (now + dy) % n;    }    int mx = 0, p = 0;    for(int i = 0; i  mx) {            mx = num[t];            p = t;        }    }    for(int i = 0; i  <br> <br> <p></p> <p><br> </p> </map></algorithm></cmath></queue></cstring></cstdio></iostream>
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

HTML: Is It a Programming Language or Something Else?HTML: Is It a Programming Language or Something Else?Apr 15, 2025 am 12:13 AM

HTMLisnotaprogramminglanguage;itisamarkuplanguage.1)HTMLstructuresandformatswebcontentusingtags.2)ItworkswithCSSforstylingandJavaScriptforinteractivity,enhancingwebdevelopment.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)