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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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 |
---|