What kindCodeThe difference is whether you think about it in another way.
Isn't it possible to solve such a difficult problem with simple map?
MAP is good. It is used for function ing. In fact, you can map arrays, but it is just one thing:
The array is linear. You can store O (1), but you can find O (n.
However, this is not the case with map, which is based on the data you saved. Sparse data can be used quickly.
If it is very dense, it is similar to array.
In addition, map can define the key as many types, but the array can only be a positive integer.
I have to review it...
# include
# include
#include
#include
# include
using namespace STD; int N; int main () {int input; Map
m; map
: iterator it; while (scanf ("% d", & N )! = EOF) {for (INT I = 0; I
second; If (temp> MAX) {max = temp ;}} printf ("% d \ n ", max); M. clear () ;}// system ("pause"); Return 0 ;}