結果

問題 No.126 2基のエレベータ
ユーザー ぴろずぴろず
提出日時 2015-01-14 00:24:15
言語 Whitespace
(0.4)
結果
WA  
実行時間 -
コード長 1,609 bytes
コンパイル時間 86 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,592 KB
最終ジャッジ日時 2023-09-04 12:35:57
合計ジャッジ時間 1,672 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,468 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 WA -
testcase_06 AC 3 ms
4,384 KB
testcase_07 WA -
testcase_08 AC 3 ms
4,432 KB
testcase_09 AC 3 ms
4,376 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 3 ms
4,436 KB
testcase_12 AC 3 ms
4,480 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 AC 3 ms
4,496 KB
testcase_15 AC 3 ms
4,484 KB
testcase_16 AC 3 ms
4,428 KB
testcase_17 AC 3 ms
4,444 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 3 ms
4,592 KB
testcase_21 AC 3 ms
4,392 KB
testcase_22 AC 3 ms
4,376 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 3 ms
4,476 KB
testcase_27 AC 3 ms
4,484 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 3 ms
4,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

asm("mark\soutchar;outchar;push\s0;return");
asm("mark\soutnum;outnum;push\s0;return"); asm("mark\sreadchar;push\s0;dup;readchar;retrieve;return");	asm("mark\sreadnum;push\s0;dup;readnum;retrieve;return");	asm("mark\snextInt;push\s0;mark\snextIntloop;push\s0;dup;readchar;retrieve;push\s48;sub;dup;jneg\snextIntend;dup;push\s9;swap;sub;jneg\snextIntend;swap;push\s10;mul;add;jump\snextIntloop;mark\snextIntend;disc;return"); def	main() {
var
a
=
nextInt();
var b =	nextInt(); var s	= nextInt();
outnum(solve(a,b,s));	outchar('\n');
} def solve(a,b,s) { var la =
abs(a-s);
var	lb
=
abs(b-s); if (la	<= lb) { return
la	+
s; }else{	return min(lb + abs(a-s) +
a,
lb	+
(s-1)
+ a); }	} def	abs(n)	{ if
(n < 0) { return
-n; }
return n;	}
def	min(a,b) {	if	(a	<
b)	{
return
a; } return	b; }	 	
    
 
 	
					
	

   
    

  			 
    
 
 	
	 			   		    
	  	 
 
			 
 
    	  	
 
		  	
			 
 
	   	 	 
	  
	   
 
			 

  	 
 


	

  	 	 

 	 

 	 

 	 
 
  	  	 
 	  	  

 		 	  

 		   
 

   	 	 

 		  	 
 

 	
 	 
 

    

	

  	 	  
 
  	  		
	  	
 		
 	  	 
 	  	  
	  	
 		
 	  	
 	  	
 
		  	
				
   	

 
	  

  		
    

  	  

	 	 	
 	  	
 	  	 	
	    	
 	 	

	
 


 
		 

  	 	
 
  	  	 	
   	
	  		    	  		
	    	  	
 	  	  
 	  			
	  	
 		
	    	  	  
	   
 		  		
 	
 	 	

	
 


  		 
 

 

    
 	
 		

	

  	
 
     
	  	
					
    

 
	  	

  			
   	

  	  	

	 	 		
 
   	-	
	  
 
	 


	
 


 
		 	

  	 		

  		 	
 
  
	 


	
 

    
 
	 


	

  	  		
 
  	  	 
	  	
						
    

 
	    

  				
   	

  	    

	 		  
 
  	
 	 

	
 


 
	   	

  		  

  	   	
 	  	
 	
 	 

	
 

    
 	
 	 

	
0