結果
| 問題 |
No.1822 Keima of Shogi
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2022-01-29 18:58:04 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 371 bytes |
| コンパイル時間 | 316 ms |
| コンパイル使用メモリ | 38,272 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2025-01-02 13:23:37 |
| 合計ジャッジ時間 | 956 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:25:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 1822.cc: No.1822 Keima of Shogi - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
/* typedef */
typedef long long ll;
/* global variables */
/* subroutines */
/* main */
int main() {
int n;
scanf("%d", &n);
int k = (n + 1) / 2;
printf("%lld\n", (ll)k * (k + 1) / 2);
return 0;
}
tnakao0123