Submission #844039

#TimeUsernameProblemLanguageResultExecution timeMemory
844039Darren0724Chessboard (IZhO18_chessboard)C++17
0 / 100
1 ms348 KiB
#include <bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n,k;cin>>n>>k; int ans=n*n; for(int i=1;i<n;i++){ if(n%i==0){ int p=n/i; if(p&1){ ans=min(ans,(p*p-1)/2*i*i); } else{ ans=max(ans,n*n/2); } } } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...