結果
| 問題 |
No.2937 Sigma Plus Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-19 16:08:28 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 563 bytes |
| コンパイル時間 | 6,068 ms |
| コンパイル使用メモリ | 335,344 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-19 16:08:37 |
| 合計ジャッジ時間 | 7,079 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 3 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using mint = modint998244353;
random_device rnd;
mt19937 mt(rnd());
int RandInt(int a, int b) {
return a + mt() % (b - a + 1);
}
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
int main(){
ll n;
cin>>n;
ll ans;
if(n%2==1){
ans=(1+n)/2*n;
}else{
ans=n/2*(1+n);
}
cout<<ans<<endl;
return 0;
}