B. Bargaining Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bob wants to put a new bargaining table in his office. To do so he measured the office room thoroughly and drew its plan…
题目链接:Codeforces 417E Square Table 题目大意:给出n和m.要求给出一个矩阵,要求每一列每一行的元素的平方总和是一个平方数. 解题思路:构造.依照 a a a b a a a b a a a b c c c d 的方式取构造,然后a,b,c,d的值用随机生成数去枚举,只是我认为用暴力也是能够的. #include <cstdio> #include <cstring> #include <cmath> #include <cstdli…
Bargaining Table time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bob wants to put a new bargaining table in his office. To do so he measured the office room thoroughly and drew its plan: B…
题目链接:https://codeforces.com/problemset/problem/1099/E You are given an $n×m$ table, consisting of characters «A», «G», «C», «T». Let's call a table nice, if every $2×2$ square contains all four distinct characters. Your task is to find a nice table (…
C. Table Decorations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You have r red, g green and b blue balloons. To decorate a single table for the banquet you need exactly three balloons.…
题目链接: E. Table Compression time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Little Petya is now fond of data compression algorithms. He has already studied gz, bz, zip algorithms and many o…
Levko loves tables that consist of n rows and n columns very much. He especially loves beautiful tables. A table is beautiful to Levko if the sum of elements in each row and column of the table equals k. Unfortunately, he doesn't know any such table.…
Harry Potter has a difficult homework. Given a rectangular table, consisting of n × m cells. Each cell of the table contains the integer. Harry knows how to use two spells: the first spell change the sign of the integers in the selected row, the seco…
题目 Codeforces 题目链接 分析 大佬博客,写的很好 本蒟蒻就不赘述了,就是一个看不出来的异或卷积 精髓在于 mask对sta的影响,显然操作后的结果为mask ^ sta AC code #include <cstdio> #include <cstring> #include <algorithm> using namespace std; typedef long long LL;//必须用long long,过程中可能炸int const int MA…
Let's consider a table consisting of n rows and n columns. The cell located at the intersection of i-th row and j-th column contains numberi × j. The rows and columns are numbered starting from 1. You are given a positive integer x. Your task is to c…
题目:click here 题意:看hint就懂了 分析:数论小题,在n0.5时间里求n的质因子数 #include <bits/stdc++.h> using namespace std; typedef long long ll; int n, x; ll ans; void solve() { ans = ; ; i*i<=x; i++ ) { if( i <= n ) { && x/i <= n ) { ; ; } } else break; } pr…