結果

問題 No.480 合計
ユーザー mkzkm
提出日時 2025-05-02 20:58:03
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,335 bytes
コンパイル時間 2,069 ms
コンパイル使用メモリ 192,164 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-05-02 20:58:06
合計ジャッジ時間 3,301 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define mod99 998244353
#define mod107 1000000007
#define endl "\n"
#define rep(i,n) for (int i = 0; (i) < (n); ++i)
#define prep(i,a,n) for (int i = (a); i < (n); ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; --i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(), a.rend()
#define si(x) ((int)(x).size())
//#define YN(bool) if(bool){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yn(bool) if(bool){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define PRE(x) cout << fixed << setprecision(x)
#define YES cout << "Yes\n"
#define NO cout << "No\n"
template <typename T> inline T gcd(T a,T b) {return (b==0)?a:gcd(b,a%b);}
template <typename T> inline T lcm(T a, T b) {return a/gcd(a,b)*b;}
template<class T>bool chmax(T &a, T b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, T b) { if (b<a) { a=b; return 1; } return 0; }
int dx[4]={1,0,-1,0};int dy[4]={0,1,0,-1};using ull = unsigned long long;
//string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
//string abc = "abcdefghijklmnopqrstuvwxyz";
bool issubsquence(string s,string t){
  ll i=0;
  for(char c:t){
    if(i<si(s)&&s[i]==c) i++;
   }
  return i==si(s);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n;cin >> n;
  cout << n*(n+1)/2 << endl;
}
0