codeforces 412E
1#include"iostream"2#include"Cstdio"3#include"CString"4#include"algorithm"5#include"Vector"6 using namespacestd;7 Charstr[1000010];8 intLen;9 BOOLIslCharc)Ten { One if(c >='a'&& C <='Z') A return 1; - if(c >='A'&& C <='Z') - return 1; the return 0; - } - - BOOLisnCharc) + { - if(c >='0'&& C <='9') + return 1; A return 0; at } - - intMain () - { - intI, J; -scanf"%s", str +1); inlen = strlen (str +1); -__int64 res =0, A, b; to for(i =1; I <= Len; ++i) { + if(Str[i] = ='@') { -A = b =0; the for(j = i-1; J >=1; --j) { * if(Str[j] = ='@'|| STR[J] = ='.') $ Break;Panax Notoginseng if(ISL (Str[j])) -++A; the } + for(j = i +1; J <= Len && (ISL (str[j) | | isn (STR[J])); ++j); A if(Str[j] = ='.'&& J! = i +1) { the for(++j; J <= Len && ISL (Str[j]); + +j) { +++b; - } $ } $Res + = A *b; - } - } theprintf"%i64d\n", res); -}
Codeforces 412E Hand Speed problem