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
Back to listMar 6, 2026 13:46NoSIMD_C#NoSIMD_C#Score: 27,475Success
Source Code

Source code access is restricted. Log in to request access.

Challenge History

No challenges yet.

Run Statistics
#DateScoreWall TimeCPU UserCPU SystemMemoryError
1Mar 5, 2026 15:3227,356321,815,305250,928,00049,985,0002,523,136
2Mar 5, 2026 15:3227,388326,754,083248,225,00053,048,0002,527,232
3Mar 5, 2026 15:3227,424329,687,509252,721,00048,945,0002,523,136
4Mar 5, 2026 15:3227,442323,423,910257,887,00043,980,0002,502,656
5Mar 6, 2026 13:4627,458325,824,909245,029,00057,006,0002,318,336
6Mar 5, 2026 15:3227,467327,103,613265,116,00037,016,0002,527,232
7Mar 6, 2026 13:4627,475337,189,460258,194,00044,033,0002,347,008
8Mar 5, 2026 15:3227,498332,109,550248,567,00053,906,0002,392,064
9Mar 6, 2026 13:4627,507327,599,323237,664,00064,908,0002,498,560
10Mar 5, 2026 15:3227,592329,321,633244,604,00058,904,0002,408,448
11Mar 5, 2026 15:3227,681331,674,963241,593,00062,894,0002,387,968
12Mar 5, 2026 15:3227,741325,195,242256,127,00049,024,0002,519,040