Comments

Nopes, I don't trust brits.

-28

The Iran had bombed US bases and I have to prepare for word war 3.

Great, just learnt a better way of doing. Thanks.

  • I still have no idea why 1st submission got accepted while 2nd one was not accepted.
  • 1st solution
  • 2nd solution
  • Can someone help me, I only changed s = s + s[i] to s+=s[i]

This is because n,m can take maximum value upto 20. So you have to compute all 2^20 paths. This will exceed the time limit because time limit is generally upto 2^12 . So it is wiser to break problems into two sets of 10, so computations will become 2^10+2^10= 2^11 which fits our time limit.

You can try this problem too Codechef Problem

+1

The world in round round sphere. Someone will have mid day when you have mid night.

awoo What will be the penalty in this round, 10 or 20 ?

#include <bits/stdc++.h>
using namespace std;

/* CODE */
int main(int argc, char const *argv[]){
	//IO();
	FAST_IO();
	int n;
	cin >> n;
	int mem[15];
	set<int> s;
	s.insert(0);
	for(int i=0;i<15;i++){
		set<int >tmp;
		for(auto it :s){
			tmp.insert(it+1);
			tmp.insert(it+5);
			tmp.insert(it+10);
			tmp.insert(it+50);
		}
		s=tmp;
		mem[i]=s.size();
	}
	// for(int i=0;i<15;i++){
	// 	cout << i << " " << mem[i] << endl;
	// }
	if(n<=15){
		cout << mem[n-1] << endl;
	}
	else{
		n=n-15;
		cout << (lli)mem[14] + (lli)n*(49LL) << endl;
	}
return 0;	
}
0

Did the same and got TLE in 4th test case. You can view my solution on my profile.

Screwed with 12th test case 3 times. I just simplified my expression (may be overflow) and got AC in last 7 minutes.

Thanks !

Tried 3 or 4 nations including USA too. But nothing error is same. It is generally expected that someone would have already used basic approaches before posting here.

same here

python is savage.

O(1) solution is possible for 810A. Link

0

What was the issue with problem C? I am unaware of it.