You are viewing a single comment's thread. Return to all comments →
int main() { string s; cin >> s; int l = s.length(); long long int n, a = 0, a1 = 0; cin >> n; for(int i = 0; i < l; i++) if(s[i] == 'a') a++; for(int i = 0; i < n % l; i++) if(s[i] == 'a') a1++; cout << (n * l) / a + a1; return 0; }
I think we have the same approach to the problem, but still I get only 8.49 but if i copy paste your code I get full. What's the difference?
Seems like cookies are disabled on this browser, please enable them to open this website
Repeated String
You are viewing a single comment's thread. Return to all comments →
I think we have the same approach to the problem, but still I get only 8.49 but if i copy paste your code I get full. What's the difference?