結果
問題 |
No.1146 土偶Ⅰ
|
ユーザー |
![]() |
提出日時 | 2020-08-08 18:02:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 20 ms / 2,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 957 ms |
コンパイル使用メモリ | 73,136 KB |
最終ジャッジ日時 | 2025-01-12 18:52:11 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
#include<iostream> #include<vector> #include<numeric> using namespace std; int main() { int n; cin >> n; vector<int> a; for (int i = 0; i < n; i++) { int t; cin >> t; a.push_back(t); } int c = 0; for (int i = 0; i < n; i++) for (int j = 0; j < i; j++) for (int k = 0; k < j; k++) if (gcd(gcd(a[i], a[j]), a[k]) == 1) c++; cout << c << endl; return 0; }