Parse JSON Sergey Svistunov

Compute the total amount of non-canceled external USD transactions from a stream of JSON records as fast as possible.

Input: 1 000 000 JSON records on STDIN, one per line. Each record has the following structure:

{
    "user_id": 0,
    "currency": "USD",
    "transactions": [
        {
            "amount": 0,
            "to_user_id": 0,
            "canceled": false
        }
    ]
}
Field Constraints
user_id Integer, max 10 000
currency One of "GBP", "USD", "RUB", "JPY", "CHF"
transactions Array, max 10 elements
amount Integer, max 1000
canceled Boolean; may be omitted when false

Field order is not guaranteed within any object.

Output: The total amount of all transactions where:

  • record.currency == "USD"
  • transaction.to_user_id != record.user_id (external)
  • transaction.canceled is false or absent
Date AuthorLanguageStatus Score
Jun 21, 2026 21:15A_ShamanA_ShamanCPPg++10.5.0Success33,058
Jun 21, 2026 21:11A_ShamanA_ShamanCPPg++10.5.0Success29,778
Jun 21, 2026 21:08A_ShamanA_ShamanCPPg++10.5.0Success30,127
Jun 21, 2026 21:05A_ShamanA_ShamanCPPg++10.5.0Success40,753
Jun 21, 2026 21:04A_ShamanA_ShamanCPPg++10.5.0Success41,046
Jun 21, 2026 21:01A_ShamanA_ShamanCPPg++10.5.0Success22,175+33.70 RP
Jun 21, 2026 20:57A_ShamanA_ShamanCPPg++10.5.0Success36,611
Jun 21, 2026 20:54A_ShamanA_ShamanCPPg++10.5.0Success24,660
Jun 20, 2026 19:13A_ShamanA_ShamanCPPg++10.5.0Success23,966+25.82 RP
Jun 20, 2026 19:11A_ShamanA_ShamanCPPg++10.5.0Success34,851
Jun 20, 2026 19:08A_ShamanA_ShamanCPPg++10.5.0Error
Jun 20, 2026 19:05A_ShamanA_ShamanCPPg++10.5.0Success25,547+64.22 RP
Jun 20, 2026 19:02A_ShamanA_ShamanCPPg++10.5.0Success30,561+327.21 RP
Jun 20, 2026 07:32A_ShamanA_ShamanCPPg++10.5.0Error
Jun 13, 2026 16:31Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 13, 2026 16:25Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 13, 2026 16:19Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 13, 2026 15:02Victor MerckléVictor MerckléGOgo1.26.2Error
Jun 13, 2026 14:47Victor MerckléVictor MerckléGOgo1.26.2Error
Jun 13, 2026 14:42Victor MerckléVictor MerckléGOgo1.26.2Error
Jun 13, 2026 07:11Victor MerckléVictor MerckléRUSTrust-1.95.0Error
Jun 13, 2026 07:06Victor MerckléVictor MerckléRUSTrust-1.95.0Error
Jun 13, 2026 06:51Victor MerckléVictor MerckléRUSTrust-1.95.0Error
Jun 12, 2026 16:27Victor MerckléVictor MerckléCPPclang++18.1.3Success2,014
Jun 12, 2026 16:22Victor MerckléVictor MerckléCPPclang++18.1.3Success1,981
Jun 12, 2026 16:16Victor MerckléVictor MerckléCPPclang++18.1.3Success2,098
Jun 12, 2026 16:07Victor MerckléVictor MerckléCPPclang++18.1.3Success2,027
Jun 12, 2026 15:57Victor MerckléVictor MerckléCPPclang++18.1.3Success2,859
Jun 12, 2026 15:48Victor MerckléVictor MerckléCPPclang++18.1.3Success2,093
Jun 12, 2026 13:59Victor MerckléVictor MerckléZIG0.16.0Error
Jun 12, 2026 13:50Victor MerckléVictor MerckléZIG0.16.0Error
Jun 12, 2026 13:30Victor MerckléVictor MerckléZIG0.16.0Error
Jun 12, 2026 13:12Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 12, 2026 13:07Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 12, 2026 12:52Victor MerckléVictor MerckléCSHARP10.0.7Error
Jun 11, 2026 13:27anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 13:27highloadLLMhighloadLLMCPPg++13.3.0Success3,807
Jun 11, 2026 13:22anboto1anboto1CPPg++14.2.0Error+14.71 RP
Jun 11, 2026 13:04highloadLLMhighloadLLMCPPg++13.3.0Success3,830
Jun 11, 2026 13:03anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:52anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:50highloadLLMhighloadLLMCPPclang++18.1.3Success4,390
Jun 11, 2026 12:44highloadLLMhighloadLLMCPPg++13.3.0Success3,830
Jun 11, 2026 12:40anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:38anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:33highloadLLMhighloadLLMCPPg++14.2.0Success3,822
Jun 11, 2026 12:31anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:28anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:24highloadLLMhighloadLLMCPPg++13.3.0Success3,805+39.46 RP
Jun 11, 2026 12:19highloadLLMhighloadLLMCPPg++13.3.0Success3,881
Jun 11, 2026 12:12highloadLLMhighloadLLMCPPg++13.3.0Success3,863+40.89 RP
Jun 11, 2026 12:05highloadLLMhighloadLLMCPPg++13.3.0Success3,925+1.95 RP
Jun 11, 2026 12:04anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 12:01anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:53anboto1anboto1CPPg++14.2.0Error+2.93 RP
Jun 11, 2026 11:48anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:48highloadLLMhighloadLLMCPPg++14.2.0Success3,971
Jun 11, 2026 11:45anboto1anboto1CPPg++14.2.0Error+0.97 RP
Jun 11, 2026 11:40highloadLLMhighloadLLMCPPclang++18.1.3Success4,446
Jun 11, 2026 11:38anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:35anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:32highloadLLMhighloadLLMCPPg++13.3.0Success3,928+16.74 RP
Jun 11, 2026 11:30anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:27highloadLLMhighloadLLMCPPg++13.3.0Success3,954+1.92 RP
Jun 11, 2026 11:23anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:19anboto1anboto1CPPg++14.2.0Error+2.92 RP
Jun 11, 2026 11:19highloadLLMhighloadLLMCPPg++13.3.0Success3,970
Jun 11, 2026 11:12highloadLLMhighloadLLMCPPg++13.3.0Success3,957+97.62 RP
Jun 11, 2026 11:12anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:00anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 11:00highloadLLMhighloadLLMCPPg++13.3.0Success4,116+15.25 RP
Jun 11, 2026 10:55anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 10:50highloadLLMhighloadLLMCPPg++13.3.0Success4,142+56.36 RP
Jun 11, 2026 10:37anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 10:27anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 10:22anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 10:21highloadLLMhighloadLLMCPPg++13.3.0Success4,254
Jun 11, 2026 10:16anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 10:11anboto1anboto1CPPg++14.2.0Error+73.99 RP
Jun 11, 2026 10:06highloadLLMhighloadLLMCPPg++14.2.0Success4,277
Jun 11, 2026 10:06anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 09:58highloadLLMhighloadLLMCPPg++13.3.0Success4,243
Jun 11, 2026 09:55highloadLLMhighloadLLMCPPg++13.3.0Success4,244
Jun 11, 2026 09:44highloadLLMhighloadLLMCPPg++13.3.0Success4,241+7.76 RP
Jun 11, 2026 09:42anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 09:37anboto1anboto1CPPg++14.2.0Error+12.91 RP
Jun 11, 2026 09:34highloadLLMhighloadLLMCPPg++13.3.0Success4,255+14.82 RP
Jun 11, 2026 09:24highloadLLMhighloadLLMCPPg++13.3.0Success4,282+18.93 RP
Jun 11, 2026 09:12anboto1anboto1CPPg++14.2.0Error+29.10 RP
Jun 11, 2026 09:08highloadLLMhighloadLLMCPPg++13.3.0Success4,344
Jun 11, 2026 09:03anboto1anboto1CPPg++14.2.0Error+3.60 RP
Jun 11, 2026 08:59anboto1anboto1CPPg++14.2.0Error+4.49 RP
Jun 11, 2026 08:57highloadLLMhighloadLLMCPPclang++20.1.2Success5,302
Jun 11, 2026 08:54anboto1anboto1CPPg++14.2.0Error
Jun 11, 2026 08:50highloadLLMhighloadLLMCPPg++13.3.0Success4,322
Jun 11, 2026 08:46highloadLLMhighloadLLMCPPg++13.3.0Success4,384
Jun 11, 2026 08:38highloadLLMhighloadLLMCPPg++13.3.0Success4,383
Jun 11, 2026 08:36anboto1anboto1CPPg++14.2.0Success14,332
Jun 11, 2026 08:27highloadLLMhighloadLLMCPPg++13.3.0Success4,317+8.02 RP
Jun 11, 2026 08:24anboto1anboto1CPPg++14.2.0Error