题意:给你n*n矩阵,里面是1或0,然后q次询问,如果操作数为1,那么就把x行数0变成1,1变成0;如果操作数为2,那么在x列上数0变成1,1变成0;如果是3,输出;思路:在求时候,对角线上数是自己乘自己,其他位置上数都是相乘两次,最后其他位置上数求得值都为0,当改变每一行或者每一列其...
转载 2015-02-03 20:31:00
93阅读
2评论
On the last day of the year, let me share a few thoughts in hindsight on a year that didn’t turn out as anyone expected. The outcome: Not everyone was as lucky as MariaDB Foundation. The pandemic take
转载 2021-01-23 19:57:36
145阅读
2评论
Unusual memory bit patterns Software development is an intellectual challenge. Sometimes the process is interrupted by
转载 2011-04-07 10:37:00
35阅读
题意:给出一个含有 ()( )() 字符串,让你可以选择一个区间码:int n, m, p;int a...
原创 2023-02-03 11:24:58
69阅读
一、内容A bracketed sequence is called correct (regular) if by inserting "+" and "1" you can get a well-formed mathematical expression from it. For exam
原创 2022-01-06 15:07:06
50阅读
一、内容A bracketed sequence is called correct (regular) if by inserting "+" and "1" you can get a well-formed mathematical expression from it. For example, sequences "(())()", "()" and "(()(()))" are co...
原创 2021-08-27 14:21:30
87阅读
题目题目描述Count the number of distinct sequences a_{1},a_{2},…,a_{n}a1​ ,a2​ ,…,an​ ( 1<=a_{i}1<=ai​ ) consisting of positive integers such that gcd(a_{1},a_{2},…,a_{n})=xgcd(a1​ ,a...
原创 2021-07-13 14:44:43
33阅读
显然我们需要 \(x|y\),不妨令 \(n={y\over x}\),则变成求 \(\gcd(a_1,a_2,...,a_n)=1\) 且 \(\sum a_i=n\) 个数。 令 \(f(n)\) 为答案,考虑反演。设 \(g(n)\) 为满足后面一个条件序列个数,由插板法知: \(g(n) ...
转载 2021-09-15 17:27:00
50阅读
2评论
好题! 求 \(\gcd\) 为 \(x\) 且和为 \(y\) 序列个数。 首先容易想到把问题转换成和为 \(\frac{y}{x}\),gcd 是 \(1\) 方案数。 然后我想着能否通过容斥方式计算这个东西,比如先插板算出没有限制,再把每一个约数减直接插板造成贡献减掉,最后把重复减去 ...
转载 2021-07-27 16:03:00
89阅读
2评论
The unusual square of A is equal to (1·1 + 1·0 + 1·1) + (0·1 + 1·1 + 1·0) + (1·1 + 0·1 + 0·0) = 0 + 1 + 1 = 0.该运算法
原创 2022-09-19 10:00:48
16阅读
传送门发现每一行,每一列如果操作,必然是奇数次操作否则,偶数次操作和不操作没有区别。而且,当ai,j==bi,ja_{i,j}==b_
原创 2022-02-08 13:49:15
42阅读
传送门发现每一行,每一列如果操作,必然是奇数次操作否则,偶数次操作和不操作没有区别。而且,当ai,j==bi,ja_{i,j}==b_{i,j}ai,j​==bi,j​时每个格子被操作偶数次当ai,j!=bi,ja_{i,j}!=b_{i,j}ai,j​!=bi,j​时这个格子被操作奇数次设rowirow_irowi​为第iii行操作次数,liejlie_jliej​为第jjj列操作次数那么ai,ja_{i,j}ai,j​操作次数等于rowi+liejrow_i+lie_jrowi​+li
原创 2021-08-26 15:39:58
30阅读
题解 首先显然若 \(x\nmid y\) 则无解。否则,令 \(y\gets \frac{y}{x}\)。 设 \(f_{k,g}\) 为选若干个数 \(\langle a_{i=1}^n\rangle\) 使得 \(\sum_{i=1}^n a_i=k\) 且 \(g\mid \gcd(a_1, ...
转载 2021-10-21 19:28:00
25阅读
2评论
Count the number of distinct sequences a1, a2, …, an (1 ≤ ai) consisting of positive integers such th
原创 2023-04-24 21:40:50
319阅读
ChatGPT报错:“Our systems have detected unusual activity from your system. Please try again later”出现上面的提示,
题目链接 题目思路 一个重要结论就是$x$因子个数最多$\sqrt[ 3]{x }$ 然后再随便容斥下即可 代码 #include<bits/stdc++.h> #define fi first #define se second #define debug cout<<"I AM HERE"<< ...
转载 2021-08-06 17:10:00
108阅读
2评论
在做机器学习实战第九章实验,使用Tkinter和matplotlib绘制回归树和模型树时,代码没有问题但是抛出了如下错误ValueError: Masked arrays must be 1-D Fatal Python error: PyEval_RestoreThread: NULL tstate This application has requested the Runtime to t
原创 2023-03-20 09:37:41
245阅读
【CF900D】Unusual Sequences 题意:定义正整数序列$a_1,a_2...a_n$是合法,当且仅当$gcd(a_1,a_2...a_n)=x$且$a_1+a_2+...+a_n=y$。给定x,y,求合法序列总数。 x,y<=10^9。 题解:不难想到容斥,先不管gcd限制,
转载 2017-12-17 18:50:00
36阅读
2评论
题意 "题目链接" Sol 首先若y % x不为0则答案为0 否则,问题可以转化为,有多少个数列满足和为y/x,且整个序列gcd=1 考虑容斥,设$g[i]$表示满足和为$i$序列方案数,显然$g[i] = 2^{i 1}$(插板后每空位放不放) 同时还可以枚举一下gcd,设$f[i]$表示满
原创 2021-06-04 23:15:34
130阅读
题目链接好久没遇到莫比乌斯反演题了,今天打cf遇到了 居然没写出来。特地来补补D. Unusual Sequences题意:做法参考来自:博客1、首先隔板法那里解析:将y 为 y个1 然后就是 简单隔板法。最后然后有个地方一直没懂为什么是相等:现在来分析分析,g(i)里面有很多gcd不同 假设i为6 那么 g(i)中gcd有四种:1,2,3,6当为2、3、6 时,将所有的数除上2、3、6 不就变成了,gcd为1了,然后总和 ...
原创 2021-09-06 13:51:23
83阅读
  • 1
  • 2
  • 3
  • 4
  • 5