Is there a way I can track the # of problems (both in contest and practice) that I solved at CodeChef? I used to be able to do it from my Profile page but it’s no longer possible (i.e. no total count of problems I solved in contest.)
int main() {
// your code goes here
int t;
cin >> t;
while (t–)
{
int n;
cin >> n;
vector < int > a(n);
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
sort(a.rbegin(), a.rend());
float ans = a[0], m = 2;
for (int i = 1; i < n; i++)
{
if (a[i] * m >= ans)
{
ans = a[i]*m;
m += 1;
}
// else continue;
}
cout << ans << endl;
}
// 1
while(t > 0){
//....
t = t - 1;
}
//2
float ans = a[0], m = 2;
// and the solution could be this?
float ans; // than I have to understand why everybody use "ans"
float m = 2; // as a variable name (and what it mean...)
ans = (float)a[0];
hope this is helpfull bye
(I verified and got "Status :Successfully executed" at link of problem you provided)
There’s a 3^{rd}-party website that keeps track of the problems solved across major Platforms. You can register on it and check after a while (example).