結果

問題 No.1461 しあはせや歩みゆく?
ユーザー LithopsLithops
提出日時 2021-04-02 21:54:42
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 5,136 bytes
コンパイル時間 6,290 ms
コンパイル使用メモリ 417,784 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-25 12:06:08
合計ジャッジ時間 7,883 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,372 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,372 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,372 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,372 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,372 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,372 KB
testcase_20 AC 2 ms
4,372 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,372 KB
testcase_24 AC 2 ms
4,372 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 1 ms
4,372 KB
testcase_27 AC 2 ms
4,372 KB
testcase_28 AC 1 ms
4,376 KB
testcase_29 AC 1 ms
4,372 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,372 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#if !__INCLUDE_LEVEL__
#include __FILE__
/*------------------ここからが本質!!------------------*/
Cyanmond is so cute Cyanmond is so cute Cyanmond is so cute;
void Main(){
    int N;cin>>N;
    if(N<=3)cout<<N<<endl;
    else cout<<5*(N-2)-2<<endl;
}
signed main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(16);
  Main();
  return 0;
}
#else
/*--------------------------end------------------------*/
/*-------------必要なときに使うもの------------------*/
//#define _GLIBCXX_DEBUG
/*#pragma GCC target("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")*/
/*-------------------end-----------------------------*/
#include<bits/stdc++.h>
using namespace std;
/*------------------ACL----------------------------*/
#if __has_include(<atcoder/all>)
#include<atcoder/all>
using namespace atcoder;
using mint=modint1000000007;
using MINT=modint998244353;
#endif
/*-----------------------end-------------------------*/
/*----------------------boost-----------------------*/
#if __has_include(<boost/multiprecision/cpp_int.hpp>)
#include<boost/multiprecision/cpp_int.hpp>
using Bint = boost::multiprecision::cpp_int;
#endif
/*-----------------------end-------------------------*/

/*---------------------マクロ-------------------------*/
#define int long long
#define rep(i, n) for (int i = 0; i < (long long)(n); i++)
#define stoi stoll
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define debug(x) cout<<#x<<" : "<<x<<endl
#define endl '\n'
#define Cyanmond
#define is
#define so
#define cute
/*------------------------end---------------------------*/

/*-----------------------型エイリアス--------------------*/
using ll = long long;
using lint=long long;
using P=pair<long long,long long>;
using vi=vector<long long>;
using vvi=vector<vi>;
using vb=vector<bool>;
using vc=vector<char>;
using vvc=vector<vc>;
using vs=vector<string>;
using vd=vector<double>;
/*------------------------end---------------------------*/

/* ----------------よく使う数字や配列-------------------- */
constexpr long long INF = LLONG_MAX/3;
constexpr long long dx[]={1,0,-1,0},dy[]={0,1,0,-1};
constexpr long long mod = 1e9 + 7;
constexpr long long MOD=998244353;
constexpr long double pi = 3.141592653589793238462643383279;
constexpr double EPS=1e-14;
/* ----------------------end-------------------------------*/

/*---------------------関数---------------------------------*/
template<class T>inline bool chmin(T& a,T b){
  if(a>b){a=b;return true;}
  return false;
}

template<class T>inline bool chmax(T& a,T b){
  if(a<b){a=b;return true;}
  return false;
}

template<class T>inline void mainend(T x){cout<<x<<endl;exit(0);}
#define maiend mainend //よく間違えるので

long long ketasum(long long n){
  string ns=to_string(n);
  long long ret=0;
  for(char c:ns)ret+=c-'0';
  return ret;
}
    
bool isprime(long long n){
  if(n<2)return false;
  if(n==2)return true;
  if(n%2==0)return false;
  for(int i=3;i<=sqrt(n);i+=2){
    if(n%i==0)return false;
  }
  return true;
}

vector<long long>divisor(int n){
  vector<long long>ret;
  for(int i=1;i<=sqrt(n);i++){
    if(n%i==0){
      ret.push_back(i);
      if(i*i!=n)ret.push_back(n/i);
    }
  }
  sort(ret.begin(),ret.end());
  return ret;
}

vector<long long>pf(long long n){
  vector<long long>ret;
  for(int i=2;i<=sqrt(n);i++){
    if(n%i==0){
      while(n%i==0)n/=i;
      ret.push_back(i);
    }
  }
  if(n!=1)ret.push_back(n);
  return ret;
}
/*----------------------end--------------------------------*/

/*---------------------構造体-------------------------------*/
template<class T>
struct segment_tree{
  int node_siz;
  vector<T>data;
  T ie;
  function<T(T,T)>operation;
  function<T(T,T)>change;
  segment_tree(int n,T _ie,function<T(T,T)>_operation,function<T(T,T)>_change)
    :ie(_ie),operation(_operation),change(_change){
      node_siz=1;
      while(node_siz<n){
        node_siz*=2;
      }
      data=vector<T>(node_siz*2-1,ie);
    }
  void update(int i,T x){
    i+=node_siz-1;
    data[i]=change(data[i],x);
    while(i>0){
      i=(i-1)/2;
      data[i]=operation(data[i*2+1],data[i*2+2]);
    }
  }
  T _query(int a,int b,int k,int l,int r){
    if(r<=a||b<=l)return ie;
    else if(a<=l&&r<=b)return data[k];
    else{
      T vl=_query(a,b,k*2+1,l,(l+r)/2);
      T vr=_query(a,b,k*2+2,(l+r)/2,r);
      return operation(vl,vr);
    }
  }
  T query(int a,int b){return _query(a,b,0,0,node_siz);}
  T operator[](int i){return data[i];}
};

struct UnionFind {
  vector<int> par, siz;
  UnionFind(int n){
    par.resize(n);
    siz.assign(n,1);
    iota(par.begin(),par.end(),0);
  }
  int root(int x) {
    if (par[x] == x) return x;
    else return par[x] = root(par[x]);
  }
  bool same(int x, int y){return root(x) == root(y);}
  bool unite(int x, int y) {
    x = root(x);y = root(y);
    if (x == y) return false; 
    if (siz[x] < siz[y]) swap(x, y);
    par[y] = x;
    siz[x] += siz[y];
    return true;
  }
  int size(int x){return siz[root(x)];}
};
/*--------------------end----------------------------*/
#endif
0