結果

問題 No.126 2基のエレベータ
ユーザー ぴろずぴろず
提出日時 2015-01-13 23:40:52
言語 Whitespace
(0.4)
結果
WA  
実行時間 -
コード長 1,710 bytes
コンパイル時間 83 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 4,660 KB
最終ジャッジ日時 2023-09-04 06:08:34
合計ジャッジ時間 1,374 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 3 ms
4,520 KB
testcase_02 WA -
testcase_03 AC 3 ms
4,412 KB
testcase_04 AC 3 ms
4,528 KB
testcase_05 AC 3 ms
4,452 KB
testcase_06 AC 3 ms
4,452 KB
testcase_07 AC 3 ms
4,452 KB
testcase_08 AC 3 ms
4,392 KB
testcase_09 AC 3 ms
4,500 KB
testcase_10 AC 3 ms
4,464 KB
testcase_11 AC 3 ms
4,400 KB
testcase_12 WA -
testcase_13 AC 3 ms
4,432 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 3 ms
4,572 KB
testcase_18 AC 3 ms
4,472 KB
testcase_19 AC 3 ms
4,508 KB
testcase_20 WA -
testcase_21 AC 3 ms
4,484 KB
testcase_22 AC 3 ms
4,388 KB
testcase_23 AC 3 ms
4,564 KB
testcase_24 AC 3 ms
4,388 KB
testcase_25 AC 3 ms
4,400 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

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);	var ans =	0;
if	(a
== 0)	{ if (la <= lb)
{
return	la
+
s; }else{ return	lb	+ s +	1;
} }else{ if (la <=
lb) {
return la	+
s;	}else{ return	lb	+	abs(a-b)
+	a;
}
} } def	abs(n)	{ if (n <
0) { return -n; }
return n;
} 	
					
	

   
    

  			 
    
 
 	
	 			   		    
	  	 
 
			 
 
    	  	
 
		  	
			 
 
	   	 	 
	  
	   
 
			 

  	 
 


	

  		

 	 

 	 

 	 
 
  	  	 
 	  	  

 		 			

 		  	
 

   	 	 

 		 	  
 

 	
 	 
 

    

	

  	 			
 
  	  		
	  	
 		
 	  	 
 	  	  
	  	
 		
    
 	  		
    
	  	
	 	  
    

 
	 	

  	  
   	

  	 	

	 	 		
 	  	 
 	  	 
 
		  	
				 
   	

 
			

  		 
    

  			

	 	   
 	  	 
 	  		 
	    	
 		 

	
 


 
	 	 

  	   
 	  	
 	  		 
	      	
	    	
 		 

	
 


  	 	 

 
	   	

  	 		
 	  	 
 	  	 
 
		  	
				  
   	

 
		 	

  		  
    

  		 	

	 				
 	  	 
 	  		 
	    	
 		 

	
 


 
	  	 

  				
 	  	
 	  	  
 	  		 
	  	
 		
	    	  	  
	    	
 		 

	
 


  	  	 

  	   	
 	
 	 
 

    
 	
 		

	

  	
 
     
	  	
			    
    

 
	 	 	

  	    
   	

  	 	 	

	 	  		
 
   	-	
	  
 
	 


	
 


 
	 		 

  	  		

  	 		 
 
  
	 


	
 

    
 
	 


	
0