Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1−S2 for any given strings. However,
题意: 每次使得一个 a ∗ b a*b a∗b的子矩阵每个值减1,问能否使得这个 n ∗ m n*m n∗m的矩阵全部变成0。 思路: 也是套路题了,直接维护二维前缀和。 #include <cstdio>#include <cstring>#include <algorithm>#include <vector>#include <queue>using namespace st
Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1−S2 for any given s
原题: B. Weird Subtraction Process time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You have two variables a and b. Consider the following s
题目 这里有一个性质,对于互质的两个数 a , b a,b a,b,它们的答案与 a g , b g ag,bg ag,bg 两数的答案相等。设 a g , b g ag,bg ag,bg 第 i i i 操作减去的数 x x x; a , b a,b a,b 第 i i i 次操作减去的数为 y y y,显然有 x = g y x=gy x=gy,前者减去的数是后者的 g
题目链接:https://ac.nowcoder.com/acm/contest/9541/J 题目描述 Given a matrix M_{}M of size n\times mn×m and two integers a, b_{}a,b , determine weither it is possible to make all entrys of M_{}M zero by repea
Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simply to calculate S1−S2 for any given strings. However, it mi