Created
January 12, 2011 14:49
-
-
Save shnya/776238 to your computer and use it in GitHub Desktop.
SRM 290 Div2 250
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class SpeedTyper | |
| { | |
| public: | |
| string lettersToPractice(string letters, vector <int> times) | |
| { | |
| vector<int> times2; | |
| int ave = 0; | |
| for(size_t i = 0; i < times.size(); i++){ | |
| int time = times[i]; | |
| if(i != 0) | |
| time -= times[i-1]; | |
| ave += time; | |
| times2.push_back(time); | |
| } | |
| ave /= (double)times.size(); | |
| string res; | |
| for(size_t j = 0; j < times2.size(); j++){ | |
| if(times2[j] > ave){ | |
| res.push_back(letters[j]); | |
| } | |
| } | |
| return res; | |
| } | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment