結果

問題 No.333 門松列を数え上げ
ユーザー a2011404a2011404
提出日時 2017-03-08 08:58:21
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1,545 ms / 2,000 ms
コード長 242 bytes
コンパイル時間 522 ms
コンパイル使用メモリ 23,632 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 01:50:10
合計ジャッジ時間 9,050 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1,545 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 946 ms
4,380 KB
testcase_04 AC 905 ms
4,376 KB
testcase_05 AC 1,541 ms
4,376 KB
testcase_06 AC 1,542 ms
4,380 KB
testcase_07 AC 72 ms
4,376 KB
testcase_08 AC 1,532 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>



int main(void) {

int A,B,i,c=0,sum=0;


scanf("%d%d",&A,&B);

if(A<B){
	for(i=(B-1);i>0;i--){
		if(i!=A)	sum++;
	}
}else if(A>B){
	for(i=(B+1);i<=2000000000;i++){
		if(i!=A)	sum++;
	}
}
	printf("%d",sum);
	return 0;

}
0