diff options
author | Anthony Wang | 2020-09-01 12:30:28 -0500 |
---|---|---|
committer | Anthony Wang | 2020-09-01 12:30:28 -0500 |
commit | 60f1f838d7f8980aca48e6f7c13c815def87acd7 (patch) | |
tree | e293283782785faccb0853844c64796e34bf8927 | |
parent | 6181542cff3b49b1ff42caae2973d5bcfd369c2f (diff) |
Create test.cpp
-rw-r--r-- | test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..dd4cb91 --- /dev/null +++ b/test.cpp @@ -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; +} |