結果
問題 |
No.1146 土偶Ⅰ
|
ユーザー |
![]() |
提出日時 | 2022-03-14 20:45:13 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 8 ms / 2,000 ms |
コード長 | 381 bytes |
コンパイル時間 | 2,026 ms |
コンパイル使用メモリ | 206,008 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 14:35:53 |
合計ジャッジ時間 | 2,905 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!ulong.gcdImpl`
ソースコード
import std; void main() { long n; readf("%d\n", n); auto a = new long[](n); foreach (i; 0 .. n) readf("%d\n", a[i]); long res; foreach (i; 0 .. n-2) { foreach (j; i+1 .. n-1) { long g = gcd(a[i], a[j]); foreach (k; j+1 ..n) { if (gcd(g, a[k]) == 1) ++res; } } } res.writeln; }