
训练一
文章平均质量分 56
一只小熊做蹲起
这个作者很懒,什么都没留下…
展开
-
A - Cards for Friends
A - Cards for Friends#include <stdio.h>#include <stdlib.h>int main(){ int w,h,n,i,t,m; scanf("%d",&t); while(~scanf("%d%d%d",&w,&h,&n)) { m=1; for(i=2;w%i==0;i*=2) { m*=2; }原创 2021-01-26 20:43:58 · 85 阅读 · 0 评论 -
B - Fair Division
B - Fair DivisionAlice and Bob received n candies from their parents. Each candy weighs either 1 gram or 2 grams. Now they want to divide all candies among themselves fairly so that the total weight of Alice’s candies is equal to the total weight of Bob’s原创 2021-01-26 20:53:36 · 202 阅读 · 0 评论 -
C - Maximum GCD
C - Maximum GCDLet’s consider all integers in the range from 1 to n (inclusive).Among all pairs of distinct integers in this range, find the maximum possible greatest common divisor of integers in pair. Formally, find the maximum value of gcd(a,b), where原创 2021-01-26 20:55:44 · 166 阅读 · 0 评论 -
D - Four Segments
D - Four SegmentsMonocarp wants to draw four line segments on a sheet of paper. He wants the i-th segment to have its length equal to ai (1≤i≤4). These segments can intersect with each other, and each segment should be either horizontal or vertical.Monoc原创 2021-01-26 21:00:05 · 236 阅读 · 0 评论 -
E - New Year Candles
E - New Year CandlesVasily the Programmer loves romance, so this year he decided to illuminate his room with candles.Vasily has a candles.When Vasily lights up a new candle, it first burns for an hour and then it goes out. Vasily is smart, so he can make原创 2021-01-26 21:02:59 · 107 阅读 · 0 评论 -
F - The New Year: Meeting Friends
F - The New Year: Meeting FriendsThere are three friend living on the straight line Ox in Lineland. The first friend lives at the point x1, the second friend lives at the point x2, and the third friend lives at the point x3. They plan to celebrate the New原创 2021-01-26 23:00:10 · 177 阅读 · 1 评论 -
G - Again Twenty Five!
G - Again Twenty Five!The HR manager was disappointed again. The last applicant failed the interview the same way as 24 previous ones. “Do I give such a hard task?” — the HR manager thought. “Just raise number 5 to the power of n and get last two digits o原创 2021-01-26 23:02:36 · 162 阅读 · 0 评论 -
H - Fence
H - FenceThere is a fence in front of Polycarpus’s home. The fence consists of n planks of the same width which go one after another from left to right. The height of the i-th plank is hi meters, distinct planks can have distinct heights.Fence for n = 7原创 2021-01-26 23:04:55 · 166 阅读 · 0 评论 -
I - Red and Blue
I - Red and BlueMonocarp had a sequence a consisting of n+m integers a1,a2,…,an+m. He painted the elements into two colors, red and blue; n elements were painted red, all other m elements were painted blue.After painting the elements, he has written two原创 2021-01-26 23:10:40 · 237 阅读 · 0 评论 -
J - Strange List
J - Strange ListYou have given an array a of length n and an integer x to a brand new robot. What the robot does is the following: it iterates over the elements of the array, let the current element be q. If q is divisible by x, the robot adds x copies of原创 2021-01-27 17:19:17 · 145 阅读 · 0 评论 -
K - Wizard of Orz
K - Wizard of OrzProblem DescriptionThere are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0.Every second, the digit shown by each panel increases by 1. In other words, at the end of e原创 2021-01-27 20:54:51 · 167 阅读 · 0 评论 -
L - Regular Bracket Sequence CodeForces - 1469A
L - Regular Bracket Sequence CodeForces - 1469AProblem DescriptionA bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters + and 1 into this sequence. For example, sequences (())(), () and (()原创 2021-01-27 21:53:07 · 203 阅读 · 0 评论 -
M - String LCM
M - String LCMProblem DescriptionLet’s define a multiplication operation between a string a and a positive integer x: a⋅x is the string that is a result of writing x copies of a one after another. For example, “abc” ⋅ 2 = “abcabc”, “a” ⋅ 5 = “aaaaa”.A s原创 2021-01-29 19:26:20 · 146 阅读 · 0 评论 -
N - Odd Divisor
N - Odd DivisorProblem DescriptionYou are given an integer n. Check if n has an odd divisor, greater than one (does there exist such a number x (x>1) that n is divisible by x and x is odd).For example, if n=6, then there is x=3. If n=4, then such a n原创 2021-01-29 19:27:49 · 349 阅读 · 0 评论 -
O - Vanya and Cubes
O - Vanya and Cubes#include<stdio.h>int main(){ int n,m,i,j,sum=0,t; scanf("%d",&n); for(i=1;i<10000;i++) { m=0; for(j=1;j<=i;j++) { m+=j; } sum+=m; if(sum>n) break; } t=i-1; printf("%d\n",t);原创 2021-01-29 20:38:16 · 126 阅读 · 0 评论 -
P - Game With Sticks
P - Game With Sticks#include<bits/stdc++.h>using namespace std;int main(){ int n,m; int min;while(cin>>n>>m){ if(n>0&&n<=100&&m>0&&m<=100) { min=n<m?n:m; } if(mi原创 2021-01-29 21:39:53 · 112 阅读 · 0 评论 -
Q - Keyboard
Q - Keyboard#include <stdio.h>#include <stdlib.h>#include <string.h>int main(){ char a[222],b; char c[35]="qwertyuiopasdfghjkl;zxcvbnm,./"; scanf("%c",&b); getchar(); scanf("%s",a); int len=strlen(a); if(b=='R')原创 2021-02-01 22:03:20 · 105 阅读 · 0 评论 -
R - Dreamoon and Stairs
R - Dreamoon and Stairs#include <stdio.h>#include <stdlib.h>#include <string.h>int main(){ int n,m,k,s=-1,i;scanf("%d%d",&n,&m);if(m>n) printf("-1\n");else{if(n%2==0){ k=n/2;}if(n%2==1){ k=1+n/2;}原创 2021-02-01 22:04:09 · 71 阅读 · 0 评论 -
S - Alice, Bob and Chocolate
S - Alice, Bob and Chocolate#include<stdio.h>#include<string.h>int main() { int n,a[222222],i; scanf("%d",&n); for(i=0;i<n;i++) scanf("%d",&a[i]); int A=0,B=0,ta=0,tb=0,l=0,m=n-1; while(l<=m) { if(ta<=原创 2021-02-03 19:41:21 · 122 阅读 · 0 评论 -
T - Kalevitch and Chess
T - Kalevitch and Chess#include<stdio.h>#include<string.h>int main(){ char a[2222]; int k,cout,sum,j,m=0; k=1; cout=0; for(int i=0;i<8;i++) { gets(a); sum=0; for(int i=0;i<8;i++) { if(a[原创 2021-02-03 19:44:13 · 97 阅读 · 0 评论 -
U - Expression
U - Expression#include <iostream>#include <cstdlib>#include <cmath>using namespace std;int main(){ int a,b,c; while(cin>>a>>b>>c) { int d=a*b*c; int e=a+b+c; int f=a*(b+c); int g=(a+b)*c;原创 2021-02-03 20:25:20 · 145 阅读 · 0 评论 -
V - Fafa and his Company
V - Fafa and his Company#include <iostream>#include <cstdlib>using namespace std;int main(){ int n; cin>>n; int m=0; for(int i=1;i<n;i++) { if((n-i)%i==0)//剩下的人能平均分给这i个人 m++; } cout<<m; return 0;}原创 2021-02-03 20:39:37 · 157 阅读 · 0 评论 -
X - I_love_%username%
X - I_love_%username%Vasya adores sport programming. He can’t write programs but he loves to watch the contests’ progress. Vasya even has a favorite coder and Vasya pays special attention to him.One day Vasya decided to collect the results of all contest原创 2021-02-17 22:09:25 · 330 阅读 · 0 评论 -
Y - Strange Partition
Y - Strange PartitionYou are given an array a of length n, and an integer x. You can perform the following operation as many times as you would like (possibly zero): replace two adjacent elements of the array by their sum. For example, if the initial arra原创 2021-02-17 22:10:45 · 123 阅读 · 0 评论 -
Z - Olesya and Rodion
Z - Olesya and RodionOlesya loves numbers consisting of n digits, and Rodion only likes numbers that are divisible by t. Find some number that satisfies both of them.Your task is: given the n and t print an integer strictly larger than zero consisting of原创 2021-02-17 22:12:05 · 201 阅读 · 1 评论