結果

問題 No.8114 Prime Checker+1
ユーザー くらげ
提出日時 2026-04-17 17:53:43
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,269 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,011 ms
コンパイル使用メモリ 331,448 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-17 17:53:46
合計ジャッジ時間 3,238 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using pll = pair<ll,ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;0<=i;i--)
#define REP(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(), a.end()
#define sort(a) sort(all(a))
#define rev(a) reverse(all(a))
char el = '\n';
void YN(bool f){cout<<(f?"Yes":"No")<<"\n";}
template<typename T> bool chmin(T& x,T y){if(x>y){x=y;return true;}return false;}
template<typename T> bool chmax(T& x,T y){if(x<y){x=y;return true;}return false;}
template<typename T> istream &operator>>(istream &is,pair<T,T> &v){is>>v.first>>v.second;return is;}
template<typename T> istream &operator>>(istream &is,vector<T> &v){for(T &in:v)is>>in;return is;}
template<typename T> ostream &operator<<(ostream &os,pair<T,T> &v){os<<v.first<<" "<<v.second;return os;}
template<typename T> ostream &operator<<(ostream &os,vector<T> &v){rep(i,v.size())os<<v[i]<<(i+1==v.size()?"":" ");return os;}

int main(){
    string n; cin >> n;
    rev(n);
    if(n=="2" || n=="3"){
        cout << 0 << el;
        YN(1);
    }
    else if((n[0]-'0')%2==0){
        cout << 0 << el;
        YN(0);
    }
    else{
        cout << 1 << el;
        YN(0);
    }
}
0