Why are my submissions using so much memory?

For example, this simple submission from the GERALD04 problem used 15.7M:

#include <stdio.h>
int main(){
	int T, H1, M1, H2, M2, dist;
	float t1, t2;
	scanf("%d", &T);
		scanf("%d:%d", &H1, &M1);
		scanf("%d:%d", &H2, &M2);
		scanf("%d", &dist);
		t1 = 60*H1+M1;
		t2 = 60*H2+M2;
		printf("%.1f ", (float)(t1-t2+dist));
		if(t1<t2+2*dist) printf("%.1f\n", (float)(t1-t2)*0.5 + dist);
		else printf("%.1f\n", (float)(t1-t2));

	return 0;

Actually, all my submissions, seem to use approximately 15M, despite the simplicity of the code or the libraries included. What am I doing wrong?

You can follow the link below to get your answer.


1 Like

Thanks! Is there a way to compile or submit a code with previous language’s versions in CodeChef? When I choose the language in submit section of the problem, it only shows C++14(gcc 6.3) for the C++ language.

1 Like

No, you can only use the versions available in submit section.