Four major questions:
The first problem, is Ctrip station has a 725*286 (specifically do not remember) advertising area, can think of test types and methods.
Write test Cases-from January 1, 2016 to March 1, 2016 the same order round trip ticket was reduced by 50 of all function points.
The second problem, the SQL statement. (The school sql--)
Third question, programming question:
There are n balls, m colors (m is less than or equal to n), if you want to take out all (m) colored balls from these n balls, at least how many you need to take.
Ideas:
I also use map to achieve, when the map of the size==m, it means that the color has been set up, calculate a minnum, and then continue to scan, update minnum
Sense of efficiency is a little low, first stick up the Code, tomorrow optimization (set the color, determine whether it must be updated minnum)
#include <iostream>#include<map>#include<vector>using namespacestd;intCollectcolor (vector<int> Balls,intM) {Map<int,int>Collect; intminnum=9999, mintemp=9999; for(intI=0; I<balls.size (); i++) {Collect[balls[i]]=i;//map Note where each color appears recently if(Collect.size () ==m)//the set color is no longer scanned. { intmaxindex=0, minindex=99999; for(Auto J=collect.begin (); J!=collect.end (); j + +){ if((*J) .second>maxindex) Maxindex=(*j). Second; if((*J) .second<minindex) Minindex=(*j). Second; Mintemp=maxindex-minindex+1; } if(mintemp<minnum) Minnum=mintemp; } } returnMinnum;}intMain () {intarray1[]={0,1,2,6,7,4,1,1,1,1,2,6,7,2,2,0}; Vector<int> v1 (array1,array1+ -); cout<<collectcolor (v1,6) <<Endl; return 0;}
2016 Ctrip test intern written programming questions