結果

問題 No.333 門松列を数え上げ
コンテスト
ユーザー mizunomi
提出日時 2016-01-25 14:25:26
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 173 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 178 ms
コンパイル使用メモリ 28,228 KB
最終ジャッジ日時 2026-02-23 20:23:52
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 4 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:17: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long int *’ [-Wformat=]
    6 |         scanf("%d %d",&a,&b);
      |                ~^     ~~
      |                 |     |
      |                 int * long int *
      |                %ld
main.c:6:20: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long int *’ [-Wformat=]
    6 |         scanf("%d %d",&a,&b);
      |                   ~^     ~~
      |                    |     |
      |                    int * long int *
      |                   %ld
main.c:12:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long int’ [-Wformat=]
   12 |         printf("%d\n",ans );
      |                 ~^    ~~~
      |                  |    |
      |                  int  long int
      |                 %ld
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |         scanf("%d %d",&a,&b);
      |         ^~~~~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

int main (void){
	long a,b;
	long ans;
	scanf("%d %d",&a,&b);
	if(a<b){
		ans = b-2;
	}else{
		ans= 2000000000-b-1;
	}
	printf("%d\n",ans );
	return 0;
}
0