输入班级人数,统计人名,性别,年龄: 建立一维数组,并放到集合中: //Console.Write("请输入班级人数:"); //int a = int.Parse(Console.ReadLine()); //ArrayList al = new ArrayList(); //for (int i = 0; i < a;i++ ) //{ // string[] name = new string[3]; // Console.Write("请输入第{}个人的姓名:&
[抄题]: We have two integer sequences A and B of the same non-zero length. We are allowed to swap elements A[i] and B[i]. Note that both elements are in the same index position in their respective sequences. At the end of some number of swaps, A and B
Modular Inverse Time Limit: 2 Seconds Memory Limit: 65536 KB The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equivalent to ax≡1 (mod m). Input There are multiple test cases. Th
One Person Game Time Limit: 2 Seconds Memory Limit: 65536 KB There is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at point A at first and your aim is point B. There are 6 kinds of operations
序列(数组)的区间通过左右端点确定,这样首先设置一个最值变量用来记录最值,从左端点一步步移动到右端点,自然移动的过程中也可以计算整个区间的和,也即一次线性遍历下来,可同时获得多个有用信息. // 区间左闭右开 int getRangeMin(const vector<int>& seq, int begin, int end){ int minVal = seq[begin]; for (int walk = begin + 1; walk < end; ++walk){ min