I came up with a good idea.

Literal

Good idea [subject-が] came-up-with.

思いつく ('to come up with, hit upon') is a compound: 思う + 付く ('attach, arrive') — literally 'thought-arrives.' An idiom for an idea suddenly occurring. The synonyms 浮かぶ ('floats up') and ふと (the adverb 'suddenly') sit nearby in the same conceptual space, each capturing a slightly different angle on the spontaneous emergence of an idea.