結果
| 問題 |
No.1462 最弱WEAKER
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-03 02:03:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 731 bytes |
| コンパイル時間 | 1,732 ms |
| コンパイル使用メモリ | 165,388 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-24 02:22:12 |
| 合計ジャッジ時間 | 2,483 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
//ethan_h
#include<bits/stdc++.h>
using namespace std;
#define ll long long
/*void test(){
ll n,t;cin>>n>>t;
ll s=0;
//string s;cin>>s;
vector<ll>a(n);
for(ll i=0;i<n;i++){
cin>>a[i];
s+=a[i];}
if(s/t){
int p;
p=s/t;
t-=(p*t);
for(ll i=0;i<n;i++){
if(t>=a[i]){
p++;
t-=a[i];
}
}
cout<<p<<endl;
}
else{
int p=0;
for(ll i=0;i<n;i++){
if(t>=a[i]){
p++;
t-=a[i];
}
}
cout<<p<<endl;
}
*/
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
ll n;
cin>>n;
ll c=0;
while(n){
//c++;
ll p=log(n)/log(3);
ll k=pow(3,p);
n-=k;
//cout<<n<<" ";
c++;
}
if(c&1){
cout<<"NO";
}
else{
cout<<"YES";
}
return 0;}