Submission #342596

# Submission time Handle Problem Language Result Execution time Memory
342596 2021-01-02T12:19:45 Z koketsu Chessboard (IZhO18_chessboard) C++14
0 / 100
1 ms 364 KB
#include <bits/stdc++.h>
#define pb push_back
#define LL long long
#define Kultivator ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

using namespace std;

const LL Mxn = 1e6 + 7;
const LL Mod = 1e9 + 7;
const LL Inf = 1e14 + 7;

int Get(int N){
    int Ans = 1;
    for(int i = 2; i <= sqrt(N); i++){
        if(N % i == 0){
            Ans = max(Ans, i);
            if(N / i != i){
                Ans = max(Ans, N / i);
            }
        }
    }
    return Ans;
}

int main(){
    Kultivator;
    int N, K;
    cin >> N >> K;
    int Del = Get(N);
    if(N == 2){
        cout << 2;
    }
    else if(Del > 1){
        cout << Del * N;
    } else {
        cout << ((N - 1) / 2 * (N / 2 + 1)) + ((N + 1) / 2 * (N / 2));
    }

}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 364 KB Output is correct
2 Incorrect 1 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -