結果

問題 No.333 門松列を数え上げ
ユーザー Ysmr_Ry
提出日時 2016-03-03 11:32:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 215 bytes
コンパイル時間 392 ms
コンパイル使用メモリ 32,868 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 13:42:49
合計ジャッジ時間 931 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf( "%d%d", &A, &B );
      |         ~~~~~^~~~~~~~~~~~~~~~~~

ソースコード

diff #

// yukicoder 333 (http://yukicoder.me/problems/935)
#include<cstdio>
#include<algorithm>

int A, B;

int main()
{
	scanf( "%d%d", &A, &B );

	printf( "%d\n", A>B?(2000000000-A)+(A-B-1):(A-1)+(B-A-1) );

	return 0;
}
0