結果

問題 No.3821 Powers of 17
コンテスト
ユーザー okkuu
提出日時 2026-11-22 09:48:07
言語 C++23(gnu拡張gcc16)
(gcc 16.2.0 + boost 1.92.0 + ACL)
コンパイル:
g++-16 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc16.so -lm -std=gnu++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 0µs
コード長 1,115 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 8,325 ms
コンパイル使用メモリ 488,084 KB
実行使用メモリ 9,864 KB
最終ジャッジ日時 2026-11-22 12:45:18
合計ジャッジ時間 9,254 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

//*
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//*/
#include<bits/extc++.h>
using namespace std;
//using namespace __gnu_cxx;
//using namespace __gnu_pbds;
//*
#include<atcoder/all>
using namespace atcoder;
using mint=modint998244353;
using Mint=modint1000000007;
//*/
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using P=pair<int,int>;
using Pl=pair<ll,ll>;
constexpr int mod=998244353;
constexpr int Mod=1e9+7;
constexpr int inf=Mod;
constexpr ll linf=(ll)inf*inf;
constexpr int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
constexpr int Dx[]={1,1,1,0,0,-1,-1,-1},Dy[]={1,0,-1,1,-1,1,0,-1};
struct initio{
	initio(){
		cin.tie(0)->sync_with_stdio(0);
		cout<<fixed<<setprecision(20);
	};
}iio;
template<class T>
bool chmax(T&a,const T&b){
	if(a<b){
		a=b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T&a,const T&b){
	if(a>b){
		a=b;
		return 1;
	}
	return 0;
}
int fl2(ll n){
	return 63-__builtin_clzll(n);
}
int main(){
	int n;
	cin>>n;
	int k=round(log(n)/log(17));
	if(n==pow(17,k))
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
}
0