Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

TanishqRJ's blog

By TanishqRJ, history, 7 weeks ago, In English

I tried this quetion and was getting Memory limit error: https://codeforces.com/problemset/problem/151/A There's no way this code will take more than 256megabytes Here's my code: https://codeforces.com/contest/151/submission/192111544 ---------------

OR

include

include<bits/stdc++.h>

using namespace std; int main() { int n,k,l,c,d,p,nl,np; cin >> n >> k >>l >> c >> d >> p >> nl >> np; k = k * l/nl; c = c * d; p = p / np; cout<<min(k, min(c, p))/n; }

 
 
 
 
  • Vote: I like it
  • +1
  • Vote: I do not like it

»
7 weeks ago, # |
  Vote: I like it +1 Vote: I do not like it

Auto comment: topic has been updated by TanishqRJ (previous revision, new revision, compare).

»
7 weeks ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

where is return 0?? write return 0 at last bro inside

int main(){

return 0;

}

»
7 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Try cahnging the submission language. You're submitting this solution with clang++17, try using GNU C++20. This is your submission in clang++17 192113254. This is it but in GNU C++20 192113074.

  • »
    »
    7 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you, didn't know about this, btw can you explain why didnt it worked

    • »
      »
      »
      7 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      According to a cursory google search, clang++ simply uses that much memory because the diagnostics are very aggressive. They're available I suppose for technical reasons, because if your program gives WA or RE under certain conditions they are rejudged by that compiler.