2015, just walk away; 2016, that's it.
In the past year, I have reaped many.
I got my grades. I got the first prize in my Life in the Informatics competition (AHOI 2015), and the first prize of NOIP (NOIP 2015); Although these achievements are nothing, but for me such a konjac konjac, it is a positive for my efforts.
I have learned lessons. In Noip 2015, I lost a full 50 points because the array was opened in a small box. It's sad to get the source code and the results, but now think about it and it's a gift for me.
I have harvested.
Finally, I'll take a look at the first and last questions I did in 2015.
First topic:
Codevs 3004 I am the King of the World
1#include <map>2#include <cstdio>3#include <string>4 5 using namespacestd;6 7 Constsize_t Max_size ( the);8 9 CharInput_str[max_size];TenUnsignedintInput_number; Onemap<string, unsignedint>v; A -UnsignedintN, M; - the intMain () - { -scanf"%u%u", &m, &n); - while(m--) + { -scanf"%s%u", Input_str, &input_number); +v[string(INPUT_STR)] =Input_number; A } at - while(n--) - { -scanf"%s", input_str); - if(v[string(INPUT_STR)] ==0) -printf"Incorrect number\n"); in Else -printf"%u\n", v[string(INPUT_STR)]); to } + - return 0; the}
Last topic:
Bzoj 1047 [HAOI2007] Ideal Square
1#include <deque>2#include <cstdio>3#include <cstring>4#include <algorithm>5 6 using namespacestd;7 8 voidGet_val (int&Ret)9 {TenRet =0; One Charch; A while(ch = getchar ()), (Ch >'9'|| Ch <'0')) - ; - Do the { -(Ret *=Ten) + = CH-'0'; - } - while(ch = getchar ()), (Ch >='0'&& CH <='9')); + } - + Constsize_t Max_ab (1050); A at intA, B; - intN; - intValue[max_ab][max_ab]; - - intColmax[max_ab][max_ab], Rowmax[max_ab][max_ab]; - intColmin[max_ab][max_ab], Rowmin[max_ab][max_ab]; in - voidInit () to { + Get_val (A), Get_val (B), Get_val (N); - for(inti =1; I <= a;++i) the for(intj =1; J <= b;++j) * Get_val (Value[i][j]); $ }Panax Notoginseng - structnode the { +NodeConst int&a =0,Const int&b =0): Number (a), Value (b) {} A intNumber ; the intValue; + }; - $ voidCol_max (intCol[][max_ab]) $ { -Deque<node>Q; - for(intj =1; J <= b;++j) the { - q.clear ();Wuyi for(inti =1; I <= a;++i) the { - while(! Q.empty () && q.back (). Value <Value[i][j]) Wu Q.pop_back (); - Q.push_back (Node (i, value[i][j])); About if(Q.front (). Number < I-n +1) $ Q.pop_front (); -COL[I][J] =Q.front (). Value; - } - } A } + the voidRow_max (intCol[][max_ab],intRow[][max_ab]) - { $Deque<node>Q; the for(inti =1; I <= a;++i) the { the q.clear (); the for(intj =1; J <= b;++j) - { in while(! Q.empty () && q.back (). Value <Col[i][j]) the Q.pop_back (); the Q.push_back (Node (j, Col[i][j])); About if(Q.front (). Number < J-n +1) the Q.pop_front (); theROW[I][J] =Q.front (). Value; the } + } - } the Bayi voidWork () the { the Col_max (Colmax); - Row_max (Colmax, Rowmax); - for(inti =1; I <= a;++i) the for(intj =1; J <= b;++j) theVALUE[I][J] =-Value[i][j]; the Col_max (colmin); the Row_max (Colmin, rowmin); - } the the voidGet_ans () the {94 intAns (0x7f7f7f7f); the for(inti = N;i <= a;++i) the for(intj = N;j <= b;++j) theans = min (ans, rowmax[i][j] +rowmin[i][j]);98printf"%d", Ans); About } - 101 intMain ()102 {103 init ();104 Work (); the Get_ans ();106 return 0;107}
Goodbye, 2015; Hello, 2016