You need to include a header file
#include <sys/resource.h>
and in the main() function you need to write these lines
rlimit R;
getrlimit(RLIMIT_STACK, &R);
R.rlim_cur = R.rlim_max;
setrlimit(RLIMIT_STACK, &R);
thanks(not this line).
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 156 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
9 | nor | 153 |
You need to include a header file
#include <sys/resource.h>
and in the main() function you need to write these lines
rlimit R;
getrlimit(RLIMIT_STACK, &R);
R.rlim_cur = R.rlim_max;
setrlimit(RLIMIT_STACK, &R);
thanks(not this line).
I cant find the Final scoreboard of tco13 final round. has it been published ?
EDITED:
I want to use a custom compare function written inside a class like this code.
class cl{
public:
string st;
int *pos;
cl(string s){
st=s;
pos=new int[s.size()];
for (int i = 0; i < (int)s.size(); i++){
pos[i]=i;
}
}
static int compare(int c1,int c2 ){
return st[c1]<st[c2];
}
void function_using_custom_compare_function(){
sort(pos,pos+st.size(),compare);
}
};
but i cant compile this code.
how to use the compare function inside a class ?
for running testcases in vim if first copy the test cases in a text file called 'in' and press F6
which runs the code by taking input from the 'in' text file.
i have
map <F6> :w<CR>:!g++ % -g && (ulimit -c unlimited; ./a.out < in) <CR>
in my .vimrc file.
IS IT POSSIBLE TO RUN THE CODE BY TAKING INPUT FROM THE SYSTEM CLIPBOARD ?
SHANGHAI JIAOTONG Mithril is champion in both Asia Jinhua Regional Contest site and dhaka site .... then why this team is not in world-final ... can anyone explain ?
I have a Bipartite Graph. I want the indeces of vertices that covers all the vertices. Cant't get it. any help .....
these two function calls seem same to me but they gives different outputs.
I tried a lot to understand the problem. but i failed.
Can anybody help please.
code:
sum1==row wise cumulative sum for each column
sum2==column wise cumulative sum for each row
here the fun(n-1,m-1) function call gives correct output.
int fun(int r,int c){
int t1=0,t2=0;
if(r==n-1&&c==m-1)return max(sum1[r][c],sum2[r][c]);
if(r==n||c==m)return 0;
int &ret=dp[r][c];
if(ret!=-1)return ret;
t1=fun(r+1,c)+sum1[r][c];
t2=fun(r,c+1)+sum2[r][c];
return ret=max(t1,t2);
}
fun(0,0);//this gives wrong output
int fun(int r,int c){
int t1=0,t2=0;
if(r==0&&c==0)return max(sum1[r][c],sum2[r][c]);
if(r<0||c<0)return 0;
int &ret=dp[r][c];
if(ret!=-1)return ret;
t1=fun(r-1,c)+sum1[r][c];
t2=fun(r,c-1)+sum2[r][c];
return ret=max(t1,t2);
}
fun(n-1,m-1);//this gives correct output
From yesterday i noticed that i cannot see other coder's submitted codes. Is there anyone facing this problem?
Name |
---|