1 条题解

  • -1
    @ 2026-8-23 10:31:26

    #include #include #include #include using namespace std;

    long long a, b; bool c = 0;

    int main() { cin >> a >> b; long long cf = a; for (int i = 2; i <= b; i++) { if (a == 1) { cout << "1"; c = 1; break; } cf *= a; if (cf > 1e9) { cout << "-1"; c = 1; break; } } if (c == 0) { cout << cf; } return 0; }

    • 1

    信息

    ID
    12973
    时间
    500ms
    内存
    128MiB
    难度
    1
    标签
    递交数
    418
    已通过
    49
    上传者