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
Apr 23, 2026 00:00olliecrowolliecrowCSHARP9.0.15Error
Apr 22, 2026 23:59olliecrowolliecrowCSHARP9.0.14Error
Apr 22, 2026 23:58olliecrowolliecrowCSHARP9.0.15Error
Apr 22, 2026 23:44olliecrowolliecrowGOgo1.26.1Error
Apr 22, 2026 20:53olliecrowolliecrowCSHARP9.0.15Success23,028
Apr 22, 2026 20:46olliecrowolliecrowCSHARP9.0.15Error
Apr 22, 2026 20:20olliecrowolliecrowGOgo1.26.2Error
Apr 22, 2026 20:02olliecrowolliecrowCPPg++10.5.0Error
Apr 22, 2026 20:00olliecrowolliecrowCPPg++13.3.0Error
Apr 22, 2026 16:20Charles CabergsCharles CabergsCPPg++13.3.0Success7,419
Apr 22, 2026 14:56olliecrowolliecrowCSHARP9.0.15Error
Apr 22, 2026 14:40olliecrowolliecrowGOgo1.26.2Success45,607
Apr 22, 2026 14:38olliecrowolliecrowGOgo1.26.2Success20,119
Apr 22, 2026 14:37olliecrowolliecrowGOgo1.26.2Success19,170
Apr 22, 2026 14:16olliecrowolliecrowCPPg++13.3.0Success3,203
Apr 22, 2026 14:15olliecrowolliecrowCPPclang++20.1.2Success3,532
Apr 22, 2026 14:13olliecrowolliecrowCPPg++13.3.0Success3,212
Apr 22, 2026 12:31Dominique GarmierDominique GarmierCPPg++13.3.0Success7,831
Apr 22, 2026 12:24Dominique GarmierDominique GarmierCPPg++13.3.0Success7,981
Apr 22, 2026 12:20BenBenCPPclang++20.1.2Success18,274
Apr 22, 2026 12:17BenBenCPPg++14.2.0Success23,738
Apr 22, 2026 11:43Dominique GarmierDominique GarmierCPPg++13.3.0Success16,686
Apr 22, 2026 11:18olliecrowolliecrowZIG0.15.1Success3,963+1'964.81 RP
Apr 22, 2026 11:05olliecrowolliecrowRUSTrust-1.94.0Success13,739
Apr 22, 2026 11:02olliecrowolliecrowRUSTrust-1.94.0Success31,292
Apr 22, 2026 10:37olliecrowolliecrowCSHARP9.0.15Success18,444
Apr 22, 2026 10:34olliecrowolliecrowCSHARP9.0.15Success18,020
Apr 22, 2026 10:18olliecrowolliecrowCPPg++10.5.0Success3,265
Apr 22, 2026 05:31olliecrowolliecrowGOgo1.26.1Error
Apr 22, 2026 01:56olliecrowolliecrowZIG0.15.1Error
Apr 22, 2026 01:44olliecrowolliecrowRUSTrust-1.94.0Error
Apr 22, 2026 01:11olliecrowolliecrowCPPg++13.3.0Error
Apr 22, 2026 01:07olliecrowolliecrowCPPg++13.3.0Error
Apr 21, 2026 20:56olliecrowolliecrowCPPg++13.3.0Error
Apr 21, 2026 19:25olliecrowolliecrowCPPg++13.3.0Success3,209
Apr 21, 2026 17:24BenBenCPPg++14.2.0Success20,776
Apr 21, 2026 09:50olliecrowolliecrowCPPg++13.3.0Error
Apr 21, 2026 05:30Charles CabergsCharles CabergsCPPg++13.3.0Success6,876
Apr 21, 2026 04:44olliecrowolliecrowCPPg++13.3.0Error
Apr 20, 2026 23:55Taylor DettlingTaylor DettlingRUSTrust-1.95.0Success29,910+334.34 RP
Apr 20, 2026 23:51Taylor DettlingTaylor DettlingRUSTrust-1.95.0Error
Apr 20, 2026 18:05Charles CabergsCharles CabergsCPPg++13.3.0Success6,697
Apr 20, 2026 16:28BenBenCPPg++14.2.0Success17,790
Apr 20, 2026 16:27BenBenCPPg++10.5.0Success17,810
Apr 20, 2026 16:24BenBenCPPg++14.2.0Success17,742+0.13 RP
Apr 20, 2026 16:20BenBenCPPg++10.5.0Success17,859
Apr 20, 2026 16:07BenBenCPPg++14.2.0Success20,987
Apr 20, 2026 16:04Dominique GarmierDominique GarmierCPPg++13.3.0Success7,733
Apr 20, 2026 15:19BenBenCPPg++14.2.0Success17,746+28.58 RP
Apr 20, 2026 15:19BenBenCPPg++13.3.0Success18,062
Apr 20, 2026 15:19BenBenCPPclang++18.1.3Success18,604
Apr 20, 2026 15:19BenBenCPPclang++20.1.2Success18,620
Apr 20, 2026 13:59BenBenCPPg++13.3.0Error
Apr 20, 2026 13:59BenBenCPPclang++18.1.3Error
Apr 20, 2026 13:58BenBenCPPclang++18.1.3Success20,548+82.80 RP
Apr 20, 2026 13:58BenBenCPPg++14.2.0Success18,694+48.27 RP
Apr 20, 2026 13:58BenBenCPPg++13.3.0Success19,020
Apr 20, 2026 13:39BenBenCPPclang++18.1.3Success26,775
Apr 20, 2026 13:37BenBenCPPg++13.3.0Success48,029
Apr 20, 2026 13:32BenBenCPPg++13.3.0Success24,761+403.86 RP
Apr 20, 2026 13:29olliecrowolliecrowCPPg++13.3.0Success3,196
Apr 20, 2026 12:16olliecrowolliecrowCPPg++13.3.0Success3,199
Apr 19, 2026 08:53Charles CabergsCharles CabergsCPPg++13.3.0Success6,733
Apr 19, 2026 07:01olliecrowolliecrowCPPg++13.3.0Success3,196
Apr 19, 2026 06:59olliecrowolliecrowCPPclang++18.1.3Success3,461
Apr 19, 2026 06:56olliecrowolliecrowCPPclang++18.1.3Success3,469
Apr 19, 2026 06:53olliecrowolliecrowCPPclang++18.1.3Success3,472
Apr 19, 2026 05:00olliecrowolliecrowCPPclang++18.1.3Success3,534
Apr 19, 2026 04:57olliecrowolliecrowCPPclang++18.1.3Success13,402
Apr 19, 2026 04:56olliecrowolliecrowCPPclang++18.1.3Success13,371
Apr 19, 2026 03:11olliecrowolliecrowCPPclang++18.1.3Success13,417
Apr 19, 2026 03:05olliecrowolliecrowCPPclang++18.1.3Success13,393
Apr 19, 2026 01:51Charles CabergsCharles CabergsCPPg++13.3.0Success6,683+124.78 RP
Apr 18, 2026 23:32Charles CabergsCharles CabergsCPPg++13.3.0Success7,291+251.61 RP
Apr 18, 2026 21:08Charles CabergsCharles CabergsCPPg++13.3.0Success9,279
Apr 18, 2026 19:05Charles CabergsCharles CabergsCPPg++13.3.0Success8,929+186.68 RP
Apr 18, 2026 16:59Charles CabergsCharles CabergsCPPg++13.3.0Success10,715+376.14 RP
Apr 18, 2026 14:47Charles CabergsCharles CabergsCPPg++13.3.0Success17,949+143.18 RP
Apr 18, 2026 13:49olliecrowolliecrowZIG0.14.0Success17,941
Apr 18, 2026 13:18olliecrowolliecrowGOgo1.26.1Error
Apr 18, 2026 12:32Charles CabergsCharles CabergsCPPg++13.3.0Success24,157+22.63 RP
Apr 18, 2026 04:48olliecrowolliecrowZIG0.14.0Success17,904+59.16 RP
Apr 18, 2026 04:23olliecrowolliecrowGOgo1.26.1Error
Apr 17, 2026 22:43Charles CabergsCharles CabergsCPPg++13.3.0Success25,554+166.91 RP
Apr 17, 2026 21:46Charles CabergsCharles CabergsCPPg++13.3.0Success97,951
Apr 17, 2026 20:02Charles CabergsCharles CabergsCPPg++13.3.0Success44,560+10.98 RP
Apr 17, 2026 17:16Charles CabergsCharles CabergsCPPg++13.3.0Success46,853+213.43 RP
Apr 17, 2026 01:19olliecrowolliecrowGOgo1.26.1Error
Apr 17, 2026 00:05olliecrowolliecrowRUSTrust-1.94.0Success3,272
Apr 16, 2026 19:17olliecrowolliecrowCSHARP9.0.14Error
Apr 16, 2026 19:10olliecrowolliecrowGOgo1.26.1Error
Apr 16, 2026 19:07olliecrowolliecrowCPPclang++18.1.3Success13,361
Apr 16, 2026 19:03olliecrowolliecrowZIG0.14.0Error
Apr 16, 2026 17:22olliecrowolliecrowCSHARP9.0.14Success129,202
Apr 16, 2026 17:05olliecrowolliecrowCSHARP9.0.14Error
Apr 16, 2026 17:00olliecrowolliecrowCSHARP9.0.14Error
Apr 16, 2026 16:56olliecrowolliecrowCSHARP9.0.14Error
Apr 16, 2026 16:28olliecrowolliecrowCSHARP9.0.14Error
Apr 16, 2026 09:39limanjun99limanjun99CPPg++13.3.0Success4,737+10.20 RP
Apr 16, 2026 09:38limanjun99limanjun99CPPg++13.3.0Success4,863