| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 2048 MB | 16 | 13 | 12 | 80.000% |
You are playing the Greatest Common Divisor Deck-Building Card Game (GCDDCG). There are $N$ cards (numbered from 1ドル$ to $N$). Card $i$ has the value of $A_i,ドル which is an integer between 1ドル$ and $N$ (inclusive).
The game consists of $N$ rounds (numbered from 1ドル$ to $N$). Within each round, you need to build two non-empty decks, deck 1ドル$ and deck 2ドル$. A card cannot be inside both decks, and it is allowed to not use all $N$ cards. In round $i,ドル the greatest common divisor (GCD) of the card values in each deck must equal $i$.
Your creativity point during round $i$ is the product of $i$ and the number of ways to build two valid decks. Two ways are considered different if one of the decks contains different cards.
Find the sum of creativity points across all $N$ rounds. Since the sum can be very large, calculate the sum modulo 998ドル,円 244,円 353$.
The first line consists of an integer $N$ (2ドル ≤ N ≤ 200,円 000$).
The second line consists of $N$ integers $A_i$ (1ドル ≤ A_i ≤ N$).
Output a single integer representing the sum of creativity points across all $N$ rounds modulo 998ドル,円 244,円 353$.
3 3 3 3
36
The creativity point during each of rounds 1ドル$ and 2ドル$ is 0ドル$.
During round 3ドル,ドル there are 12ドル$ ways to build both decks. Denote $B$ and $C$ as the set of card numbers within deck 1ドル$ and deck 2ドル,ドル respectively. The 12ドル$ ways to build both decks are:
4 2 2 4 4
44
For rounds 1ドル,ドル 2ドル,ドル 3ドル$ and 4ドル,ドル there are 0ドル,ドル 18ドル,ドル 0ドル,ドル and 2ドル$ ways to build both decks, respectively.
9 4 2 6 9 7 7 7 3 3
10858