ZJANS

b836. kevin戀愛攻略系列題-2 說好的霸王花呢??

Medium Last Update: 2026/01/21
數學

解法一、數學

✅ 完整代碼

評分結果(參考) : AC (5ms, 348KB)

#include<bits/stdc++.h>
#define int long long
using namespace std;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    double n, m;
    while(cin >> n >> m){
        if(m == 0){
            cout << "Go Kevin!!\n";
            continue;
        }
        
        double k = (-(2-m)+sqrt((2-m)*(2-m)+4*m*2*n))/(2*m);
        if(k == (int)k) cout << "Go Kevin!!\n";
        else cout << "No Stop!!\n";
    }
    
    return 0;
}