zen0wu / topcoder-greed

greedy editor for topcoder arena
Apache License 2.0
229 stars 48 forks source link

New arena time limit / memory limit feature. #94

Closed vexorian closed 10 years ago

vexorian commented 10 years ago

Since latest arena update, problem statements now have a limits section. It is important we figure out a way for Greed to detect this section, so that problem statement template can use it.

Could also be useful for custom test templates to know the limits so that they could enforce them.

vexorian commented 10 years ago

Arena maintainer reports: http://apps.topcoder.com/forums/?module=Thread&threadID=806641&start=15&mc=26#1828583

The latest arena version has ProblemCompoment.getExecutionTimeLimit() and ProblemCompoment.getMemLimit(),

vexorian commented 10 years ago

Comment from maintainer wasn't so helpful. It turns out that the method names he shared were wrong or inexistent. I have, however, managed to make Greed fetch the memory limit: https://github.com/vexorian/topcoder-greed/commit/3992da3af2c6375ebb9931d65224e39fb0e87208

So you would use ${Problem.MemoryLimitMB} to fetch the memory limit in MB (that's how the plugin interface sends it, so I think it is a fair bet to think that the limit will always be in MB).

I am quite sure that the arena will provide time limit in milliseconds. I added some placeholders for it.

I also have some placeholders for the Time limit. ${Problem.TimeLimitMillis} gets it as integer and is useful for code templates, ${Problem.TimeLimitSeconds} returns it as double and I think it is best for the HTML template. Actually, we might need a good double/float formatter/renderer for this, or does it already exist?

vexorian commented 10 years ago

done by #116