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
Mar 9, 2026 18:21Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success6,963+19.13 RP
Mar 9, 2026 18:19Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Error
Mar 9, 2026 17:45Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success7,057+124.88 RP
Mar 9, 2026 17:41Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success7,739+771.68 RP
Mar 9, 2026 17:38Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success21,637
Mar 9, 2026 17:22Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Error
Mar 9, 2026 17:20Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success19,213+5.97 RP
Mar 9, 2026 16:48Daniel MastalerzDaniel MastalerzCPPclang++18.1.3Success19,436+188.53 RP
Mar 7, 2026 16:47Mohammad Anas KhanMohammad Anas KhanCPPg++13.3.0Success614,417+16.28 RP
Mar 7, 2026 14:59NoSIMD_C#NoSIMD_C#CSHARP9.0.13Error
Mar 7, 2026 14:55NoSIMD_C#NoSIMD_C#CSHARP9.0.13Error
Mar 7, 2026 14:33NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success28,541
Mar 7, 2026 14:27NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success28,265
Mar 7, 2026 14:21NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success28,415
Mar 7, 2026 14:20NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success57,136
Mar 7, 2026 14:03NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success55,826
Mar 7, 2026 13:55NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success27,674
Mar 6, 2026 13:48NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success27,748
Mar 6, 2026 13:46NoSIMD_C#NoSIMD_C#CSHARP9.0.13Success27,475+0.41 RP
Mar 6, 2026 01:26Sergey SerebryakovSergey SerebryakovCPPg++13.3.0Success5,097+1'961.94 RP
Mar 4, 2026 02:22Josu San MartinJosu San MartinCSHARP9.0.13Success3,925+349.49 RP
Mar 4, 2026 02:09Josu San MartinJosu San MartinCSHARP9.0.13Error
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,124
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,413
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,459
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,186
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,121
Feb 19, 2026 03:26Josu San MartinJosu San MartinCPPg++13.3.0Success3,188
Feb 19, 2026 03:25Josu San MartinJosu San MartinCPPg++13.3.0Success3,457
Feb 19, 2026 03:25Josu San MartinJosu San MartinCPPg++13.3.0Success3,122
Feb 19, 2026 03:24Josu San MartinJosu San MartinCPPg++13.3.0Success3,127
Feb 19, 2026 03:24Josu San MartinJosu San MartinCPPg++13.3.0Error
Feb 19, 2026 03:23Josu San MartinJosu San MartinCPPg++13.3.0Success3,183
Feb 19, 2026 03:23Josu San MartinJosu San MartinCPPg++13.3.0Success3,169
Feb 19, 2026 03:23Josu San MartinJosu San MartinCPPg++13.3.0Success3,137
Feb 19, 2026 03:07Josu San MartinJosu San MartinCPPg++13.3.0Success3,167
Feb 19, 2026 02:58Josu San MartinJosu San MartinCPPg++13.3.0Success3,171
Feb 19, 2026 02:52Josu San MartinJosu San MartinCPPclang++18.1.3Success3,289
Feb 19, 2026 02:51Josu San MartinJosu San MartinCPPg++13.3.0Success3,400
Feb 19, 2026 02:40Josu San MartinJosu San MartinCPPg++13.3.0Success3,147
Feb 19, 2026 02:39Josu San MartinJosu San MartinCPPg++13.3.0Success3,130
Feb 19, 2026 02:38Josu San MartinJosu San MartinCPPg++13.3.0Success3,137
Feb 19, 2026 02:35Josu San MartinJosu San MartinCPPg++13.3.0Success3,273
Feb 19, 2026 02:30Josu San MartinJosu San MartinCPPg++13.3.0Success3,170
Feb 19, 2026 02:29Josu San MartinJosu San MartinCPPg++13.3.0Success3,118+105.22 RP
Feb 19, 2026 02:28Josu San MartinJosu San MartinCPPg++13.3.0Success3,192
Feb 19, 2026 02:27Josu San MartinJosu San MartinCPPg++13.3.0Success3,196
Feb 19, 2026 02:25Josu San MartinJosu San MartinCPPg++13.3.0Success3,315
Feb 19, 2026 02:23Josu San MartinJosu San MartinCPPg++13.3.0Success3,775
Feb 19, 2026 02:21Josu San MartinJosu San MartinCPPg++13.3.0Success3,170+35.59 RP
Feb 19, 2026 02:20Josu San MartinJosu San MartinCPPg++13.3.0Success3,226
Feb 19, 2026 02:17Josu San MartinJosu San MartinCPPg++13.3.0Success3,583
Feb 19, 2026 02:16Josu San MartinJosu San MartinCPPg++13.3.0Success3,195+50.12 RP
Feb 19, 2026 02:14Josu San MartinJosu San MartinCPPg++13.3.0Success3,370
Feb 19, 2026 02:11Josu San MartinJosu San MartinCPPg++13.3.0Success3,356
Feb 19, 2026 02:10Josu San MartinJosu San MartinCPPg++13.3.0Success3,247+47.63 RP
Feb 19, 2026 02:07Josu San MartinJosu San MartinCPPg++13.3.0Success3,298+48.85 RP
Feb 19, 2026 01:52Josu San MartinJosu San MartinCPPg++13.3.0Success3,512
Feb 19, 2026 01:52Josu San MartinJosu San MartinCPPg++13.3.0Success3,352+127.78 RP
Feb 19, 2026 01:46Josu San MartinJosu San MartinCPPg++13.3.0Success3,505
Feb 19, 2026 01:46Josu San MartinJosu San MartinCPPg++13.3.0Success3,571
Feb 19, 2026 01:27Josu San MartinJosu San MartinCPPg++13.3.0Success3,502+13.79 RP
Feb 19, 2026 01:23Josu San MartinJosu San MartinCPPg++13.3.0Success3,878
Feb 19, 2026 01:10Josu San MartinJosu San MartinCPPclang++18.1.3Success3,721
Feb 19, 2026 01:08Josu San MartinJosu San MartinCPPg++13.3.0Success3,780
Feb 19, 2026 00:56Josu San MartinJosu San MartinCPPg++13.3.0Success3,533
Feb 19, 2026 00:54Josu San MartinJosu San MartinCPPg++13.3.0Success3,783
Feb 19, 2026 00:48Josu San MartinJosu San MartinCPPg++13.3.0Success3,800
Feb 19, 2026 00:46Josu San MartinJosu San MartinCPPg++13.3.0Success3,741
Feb 19, 2026 00:40Josu San MartinJosu San MartinCPPg++13.3.0Success3,766
Feb 19, 2026 00:29Josu San MartinJosu San MartinCPPg++13.3.0Success3,853
Feb 19, 2026 00:11Josu San MartinJosu San MartinCPPg++13.3.0Success3,871
Feb 18, 2026 23:59Josu San MartinJosu San MartinCPPg++13.3.0Success3,902
Feb 18, 2026 23:49Josu San MartinJosu San MartinCPPg++13.3.0Success3,769
Feb 14, 2026 08:52olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:43olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:34olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:21olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:15olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:09olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 08:02olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 07:57olliecrowolliecrowCPPg++13.3.0Success3,204
Feb 14, 2026 07:48olliecrowolliecrowCPPg++13.3.0Success3,181+7.90 RP
Feb 14, 2026 07:35olliecrowolliecrowCPPg++13.3.0Success3,185+15.74 RP
Feb 14, 2026 07:26olliecrowolliecrowCPPg++13.3.0Success3,204
Feb 14, 2026 07:20olliecrowolliecrowCPPg++13.3.0Success3,301
Feb 14, 2026 07:15olliecrowolliecrowCPPg++13.3.0Success3,193+149.36 RP
Feb 14, 2026 07:09olliecrowolliecrowCPPg++13.3.0Success3,312
Feb 14, 2026 06:56olliecrowolliecrowCPPg++13.3.0Success3,271+31.62 RP
Feb 14, 2026 06:46olliecrowolliecrowCPPg++13.3.0Success3,367
Feb 14, 2026 06:37olliecrowolliecrowCPPg++13.3.0Success3,288+425.70 RP
Feb 14, 2026 05:55olliecrowolliecrowCPPg++13.3.0Success3,581
Feb 14, 2026 05:36olliecrowolliecrowCPPclang++18.1.3Success3,821
Feb 14, 2026 05:28olliecrowolliecrowCPPg++13.3.0Success3,555
Feb 14, 2026 05:18olliecrowolliecrowCPPg++13.3.0Error
Feb 14, 2026 05:05olliecrowolliecrowCPPg++13.3.0Success3,587
Feb 14, 2026 04:52olliecrowolliecrowCPPg++13.3.0Success3,552+5.54 RP
Feb 14, 2026 04:43olliecrowolliecrowCPPg++13.3.0Success3,581
Feb 14, 2026 04:27olliecrowolliecrowCPPg++13.3.0Success3,560
Feb 14, 2026 04:19olliecrowolliecrowCPPg++13.3.0Success3,559