Topic Portal
1 /*2 Construction + Violence: According to the title meaning, as long as 10 times plus 1 will change back to the original number, violence enumeration all numbers, String Dafa good! 3 */4 /************************************************5 Author:running_time6 Created time:2015-8-3 8:43:027 File name:a.cpp8 *************************************************/9 Ten#include <cstdio> One#include <algorithm> A#include <iostream> -#include <sstream> -#include <cstring> the#include <cmath> -#include <string> -#include <vector> -#include <queue> +#include <deque> -#include <stack> +#include <list> A#include <map> at#include <Set> -#include <bitset> -#include <cstdlib> -#include <ctime> - using namespacestd; - in #defineLson L, Mid, RT << 1 - #defineRson mid + 1, R, RT << 1 | 1 totypedefLong Longll; + Const intMAXN = 1e3 +Ten; - Const intINF =0x3f3f3f3f; the Const intMOD = 1e9 +7; * stringmn, now, str; $ intN;Panax Notoginseng - intMainvoid) {//codeforces Round #283 (Div. 2) B. Secret Combination the while(Cin >>N) { +CIN >> str; MN = str; now =str; A for(intI=1; i<=Ten; ++i) { the for(intj=0; j<n; ++j) { + if(Now[j] = ='9') Now[j] ='0'; - Elsenow[j]++; $ } $cout << now <<Endl; - for(intj=0; j<n; ++j) { - stringTMP =""; the for(intK=j; k<n; ++K) tmp + =Now[k]; - for(intk=0; k<j; ++K) tmp + =Now[k];Wuyi if(TMP < MN) MN =tmp; the } - } Wucout << mn <<Endl; - } About $ return 0; -}
Construction + violence codeforces Round #283 (Div. 2) B. Secret Combination