이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, k, x, y, xx, yy;
ll d;
int main()
{
cin >> n >> k;
for ( int i = 1; i <= k; i ++ ) {
cin >> x >> y >> xx >> yy;
}
for ( int i = n-1; i >= 1; i -- ){
if ( n % i == 0 ) {
d = i;
break;
}
}
if ( d == 1 ) {
cout << (n*n) / 2;
}
else {
if ( n % 2 == 1 ) {
cout << ( d*d ) * ((n/d)+1);
}
else {
cout << (d*d) * (n/d);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |