0%

You have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is to ask for the sum of numbers in a given interval.

Input

输入描述:

The first line contains two numbers N and Q. 1 ≤ N,Q ≤ 100000.
The second line contains N numbers, the initial values of A1, A2, … , AN. -1000000000 ≤ Ai ≤ 1000000000.
Each of the next Q lines represents an operation.
“C a b c” means adding c to each of Aa, Aa+1, … , Ab. -10000 ≤ c ≤ 10000.
“Q a b” means querying the sum of Aa, Aa+1, … , Ab.

输出描述:

You need to answer all Q commands in order. One answer in a line.

Read more »

Language:
Matrix
Time Limit: 3000MS Memory Limit: 65536K
Total Submissions: 37057 Accepted: 13286
Description

Given an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th row and j-th column. Initially we have A[i, j] = 0 (1 <= i, j <= N).

We can change the matrix in the following way. Given a rectangle whose upper-left corner is (x1, y1) and lower-right corner is (x2, y2), we change all the elements in the rectangle by using “not” operation (if it is a ‘0’ then change it into ‘1’ otherwise change it into ‘0’). To maintain the information of the matrix, you are asked to write a program to receive and execute two kinds of instructions.

  1. C x1 y1 x2 y2 (1 <= x1 <= x2 <= n, 1 <= y1 <= y2 <= n) changes the matrix by using the rectangle whose upper-left corner is (x1, y1) and lower-right corner is (x2, y2).
  2. Q x y (1 <= x, y <= n) querys A[x, y].

输入描述:

The first line of the input is an integer X (X <= 10) representing the number of test cases. The following X blocks each represents a test case.

The first line of each block contains two numbers N and T (2 <= N <= 1000, 1 <= T <= 50000) representing the size of the matrix and the number of the instructions. The following T lines each represents an instruction having the format “Q x y” or “C x1 y1 x2 y2”, which has been described above.

输出描述:

For each querying output one line, which has an integer representing A[x, y].

There is a blank line between every two continuous test cases.

Read more »

Idea:

  1. Action from the autonomous car will affect human responses and these could be leveraged for planning.
  2. Approximate human as optimal driver, with a reward function acquired through inverse reinforcement learning.

Motivation:

  1. Current autonomous cars are defensive
  2. Plan more efficient and communicative behaviors for autonomous cars.
Read more »

Formalizing Human-Robot Mutual Adaptation: A Bounded Memory Model

Idea: the robot reasons how human may change its strategy, based on a model of human adaptation.
Motivation:

  1. Previous works do not use a model of human adaptation that can enable the robot to actively influence the actions of human.
  2. Previous works do not reason over the human adaptation throughout the interaction. Compare with Intention-Aware Motion Planning paper.
Read more »

Intention-aware motion planning

Motivation: Motion planning with uncertainty in human intention.
Assumptions

  1. A finite set of unknown intentions.
  2. Given intention, the agent’s dynamics is modeled and known to robot.
  3. The agent has perfect information on the robot’s and its own state.
Read more »

End-to-End Robotic Reinforcement Learning without Reward Engineering

Motivation: Manual-engineered reward defeats the purpose of end-to-end learning
Idea:

  1. Human periodically labels the queries, used to supervise reward training
  2. Train a classifier to predict reward, based on high-dimensional input (pixels)
  3. Use RL to provide negative samples for step2 and RL uses the reward from step 2.

Self-training with Noisy Student improves ImageNet classification

The idea is to train a noisy student no smaller than the teacher and repeat.

1
2
3
While not converge
1. Train a teacher net to provide pseudo-labels (unoised).
2. Train a larger student model with pseudo and groundtruth labels (noised).
Read more »

《孙子算经》中的题目:有物不知其数,A[i]个一数余B[i],问该物总数几何?

输入描述:

第一行,一个整数n。
接下来n行,每行两个整数A[i]和B[i],表示用这个数模A[i]得B[i]。
保证所有A[i]两两互素。

输出描述:

输出最小的满足条件的正整数解。

Read more »

两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只乐观的青蛙,你被要求写一个程序来判断这两只青蛙是否能够碰面,会在什么时候碰面。
我们把这两只青蛙分别叫做青蛙A和青蛙B,并且规定纬度线上东经0度处为原点,由东往西为正方向,单位长度1米,这样我们就得到了一条首尾相接的数轴。设青蛙A的出发点坐标是x,青蛙B的出发点坐标是y。青蛙A一次能跳m米,青蛙B一次能跳n米,两只青蛙跳一次所花费的时间相同。纬度线总长L米。现在要你求出它们跳了几次以后才会碰面。

输入描述:

输入只包括一行5个整数x,y,m,n,L

输出描述:

输出碰面所需要的跳跃次数,如果永远不可能碰面则输出一行”Impossible”

Read more »