結果

問題 No.111 あばばばば
ユーザー stone_725
提出日時 2015-09-05 18:44:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 168 ms / 5,000 ms
コード長 192 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 22,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 03:53:25
合計ジャッジ時間 1,018 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:7:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |   scanf("%d", &l);
      |   ~~~~~^~~~~~~~~~

ソースコード

diff #

#include <cstdio>

using namespace std;

int main(){
  int l;
  scanf("%d", &l);
  long long ans = 0;
  for(int i = 1; i < l; i += 2){
    ans += i;
  }
  printf("%lld\n", ans);
  return 0;
}
0