两超时一错误
查看原帖
两超时一错误
1314279
MichaelMao楼主2024/6/23 12:54
#include<iostream>
using namespace std ;
int main ()
{
    long long y , t ;
    cin >> y >> t ;
    long long ans = 0 ;
    if (t == 0) ans = 1 ;
    else
    {
        long long mul = y ;
        for (int i = 1 ; i <= t ; i ++)
        {
            mul *= y ;
        }
        ans = mul ;
    }
    if (ans < 0) cout << "YES" ;
    else cout << "NO" ;
    cout << endl ;
    if (ans % 2 == 1) cout << "YES" ;
    else cout << "NO" ;
    return 0 ;
}
2024/6/23 12:54
加载中...