Create test.cpp
This commit is contained in:
parent
6181542cff
commit
60f1f838d7
32
test.cpp
Normal file
32
test.cpp
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
// C++
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <array>
|
||||||
|
|
||||||
|
inline int gcd(int a, int b)
|
||||||
|
{
|
||||||
|
if (b > 0) return gcd(b, a % b);
|
||||||
|
else return a;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "test\n";
|
||||||
|
|
||||||
|
const int N = 1000;
|
||||||
|
std::array<int, N> A;
|
||||||
|
for (int i = 0; i < N; i++)
|
||||||
|
{
|
||||||
|
A[i] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
int ans = 0;
|
||||||
|
for (int i : A)
|
||||||
|
{
|
||||||
|
for (int j : A)
|
||||||
|
{
|
||||||
|
ans += gcd(i, j);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
std::cout << ans << std::endl;
|
||||||
|
}
|
Loading…
Reference in a new issue