結果
| 問題 |
No.1461 しあはせや歩みゆく?
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-02 21:54:42 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 5,136 bytes |
| コンパイル時間 | 5,885 ms |
| コンパイル使用メモリ | 404,160 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 19:11:46 |
| 合計ジャッジ時間 | 7,059 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 |
ソースコード
#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