結果
| 問題 |
No.480 合計
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-27 16:10:11 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 12 ms / 2,000 ms |
| コード長 | 2,169 bytes |
| コンパイル時間 | 1,981 ms |
| コンパイル使用メモリ | 197,640 KB |
| 最終ジャッジ日時 | 2025-02-15 02:37:47 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all> //atcoder
// using namespace atcoder; //atcoder
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<long long>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vd = vector<double>;
using vld = vector<long double>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long long>>;
using vvc = vector<vector<char>>;
using vvs = vector<vector<string>>;
using vvb = vector<vector<bool>>;
using vvd = vector<vector<double>>;
using vvld = vector<vector<long double>>;
using Graph = vector<vector<int>>;
using Nodes = pair<int,int>;
using primax = priority_queue<ll>; //最大値
// using primin = priority_queue<ll, vector<ll>, greater<ll>>; //最小値
#define _GLIBCXX_DEBUG
#define endl "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int INF = 1e9;
const int MININF = -1e9;
const ll LINF = 1e18;
const ll MINLINF = -1e18;
const int MOD = 1e9 + 7;
const int MODD = 998244353;
const char MARU = 'o';
const char BATU = 'x';
// 8方向(4方向ならN=4で止め。)
vi vx={0, 1, 0, -1, 1, 1, -1, -1};
vi vy={1, 0, -1, 0, 1, -1, -1, 1};
// a<bならaをbに更新
template <class T>
bool chmax(T &a, const T& b){
if(a < b){
a = b;
return true;
}
return false;
}
// a>bならaをbに更新
template <typename T>
bool chmin(T &a, const T& b){
if(a > b){
a = b;
return true;
}
return false;
}
// 最大公約数
template<typename T>
T gcd(T A, T B){
if(B == 0)return A;
return gcd(B, A % B);
}
// 最小公倍数
template<typename T>
T lcm(T A, T B){
return A / gcd(A, B) * B;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin>>N;
cout<<N*(N+1)/2<<endl;
}