Warning: session_start(): open(/tmp/sess_ab76e1788bdc63a6dd28df51965a626a, O_RDWR) failed: No space left on device (28) in /data/wiki/inc/init.php on line 239

Warning: session_start(): Failed to read session data: files (path: ) in /data/wiki/inc/init.php on line 239

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/auth.php on line 430
Writing /data/wiki/data/cache/8/8fe637ac40e9dfa91f93fbcd08d065e4.captchaip failed

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/inc/actions.php on line 38

Warning: Cannot modify header information - headers already sent by (output started at /data/wiki/inc/init.php:239) in /data/wiki/lib/tpl/dokuwiki/main.php on line 12
2020-2021:teams:bigbros:jerydeak:sps1 [CVBB ACM Team]

用户工具

站点工具


2020-2021:teams:bigbros:jerydeak:sps1

到此差别页面的链接

两侧同时换到之前的修订记录 前一修订版
2020-2021:teams:bigbros:jerydeak:sps1 [2020/05/17 20:20]
jerydeak
2020-2021:teams:bigbros:jerydeak:sps1 [2020/05/17 20:21] (当前版本)
jerydeak
行 102: 行 102:
  
 int ansf(int step,int x1,int x2){ int ansf(int step,int x1,int x2){
- //​printf("​\nCall:​step=%d,​x1=%d,​x2=%d;​\n",​step,​x1,​x2);​ 
  if(step==0)return map[0][0];  if(step==0)return map[0][0];
  if(ansflag[step][x1][x2]>​0){  if(ansflag[step][x1][x2]>​0){
行 116: 行 115:
  if(y1>0 && y2>0 && x1!=x2) temp=max(temp,​ansf(step-1,​x1,​x2));​  if(y1>0 && y2>0 && x1!=x2) temp=max(temp,​ansf(step-1,​x1,​x2));​
   
- //​printf("​\nPoint 1:​step=%d,​x1=%d,​x2=%d;​temp=%d;​map1=%d,​map2=%d;​\n",​step,​x1,​x2,​temp,​map[x1][y1],​map[x2][y2]);​ 
  ans[step][x1][x2]=temp+map[y1][x1]+map[y2][x2];//​*condition(x1==x2,​0,​1);​  ans[step][x1][x2]=temp+map[y1][x1]+map[y2][x2];//​*condition(x1==x2,​0,​1);​
  ansflag[step][x1][x2]=1;​  ansflag[step][x1][x2]=1;​
   
- //​printf("​\nAfter calculating:​step=%d,​x1=%d,​x2=%d;​Value=%d;​\n",​step,​x1,​x2,​ans[step][x1][x2]);​ 
  return ans[step][x1][x2];​  return ans[step][x1][x2];​
 } }
行 135: 行 132:
  for(int j=0;​j<​n;​j++)  for(int j=0;​j<​n;​j++)
  scanf("​%d",&​map[i][j]);​  scanf("​%d",&​map[i][j]);​
-  
- /* 
- printf("​\n"​);​ 
- for(int i=0;​i<​m;​i++){ 
- for(int j=0;​j<​n;​j++){ 
- printf("​%d ",​map[i][j]);​ 
- } 
- printf("​\n"​);​ 
- }printf("​\n"​);​ 
- */ 
  printf("​%d",​ansf(m+n-2,​n-1,​n-1));​  printf("​%d",​ansf(m+n-2,​n-1,​n-1));​
   
- /* +
- for(int step=0;​step<​m+n-1;​step++){ +
- printf("​\n-----\nStep=%d:​\n",​step);​ +
- for(int x1=0;​x1<​n;​x1++){ +
- printf("​\n"​);​ +
- for(int x2=0;​x2<​n;​x2++){ +
- printf("​%d ",​ans[step][x1][x2]);​ +
-+
-+
-+
- */ +
- /* +
- while(true){ +
- printf("​\n--------------\n"​);​ +
- char c; +
- scanf("​%c",&​c);​ +
- if(c=='​a'​){ +
- int step,​x1,​x2;​ +
- scanf("​%d%d%d",&​step,&​x1,&​x2);​ +
- //​printf("​%d\n",​ansf(step,​x1,​x2));​ +
- printf("​%d\n",​ans[step][x1][x2]);​ +
- printf("​\n--------------\n"​);​ +
-+
- else if(c=='​m'​){ +
- int x,y; +
- scanf("​%d%d",&​x,&​y);​ +
- printf("​%d\n",​map[x][y]);​ +
- printf("​\n--------------\n"​);​ +
-  +
-+
- }*/+
 } }
  
 </​codedoc>​ </​codedoc>​
 </​hidden>​ </​hidden>​
2020-2021/teams/bigbros/jerydeak/sps1.1589718030.txt.gz · 最后更改: 2020/05/17 20:20 由 jerydeak