結果

問題 No.111 あばばばば
コンテスト
ユーザー mai
提出日時 2016-02-05 21:15:06
言語 C90
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 189 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 162 ms
コンパイル使用メモリ 28,996 KB
最終ジャッジ日時 2026-02-23 20:32:56
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%lld",&l);
      |     ^~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

int main(){
    long long l;
    scanf("%lld",&l);
    l=(l-1)/2;
    if (l<=0)
        printf("1");
    else
        printf("%lld",l*(l+1)/2+l*(l-1)/2);
    return 0;
}
0