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
Dec 4, 2026 00:29janwwwjanwwwCPPclang++18.1.3Success2,306+309.13 RP
Dec 3, 2026 23:55janwwwjanwwwCPPclang++18.1.3Error
Dec 2, 2026 14:54Dominique GarmierDominique GarmierZIG0.15.1Success3,925
Dec 2, 2026 14:23Dominique GarmierDominique GarmierZIG0.15.1Success3,906+36.19 RP
Dec 2, 2026 14:02Dominique GarmierDominique GarmierZIG0.15.1Success3,962+17.08 RP
Dec 2, 2026 13:45Dominique GarmierDominique GarmierZIG0.15.1Success3,989+157.82 RP
Dec 2, 2026 07:26Dominique GarmierDominique GarmierZIG0.15.1Success4,257+52.86 RP
Dec 2, 2026 04:56Kenny LimKenny LimCPPg++14.2.0Success4,186+60.08 RP
Dec 2, 2026 03:47Kenny LimKenny LimCPPg++14.2.0Success4,294+1'559.84 RP
Dec 2, 2026 03:33Kenny LimKenny LimCPPg++14.2.0Success13,004+768.99 RP
Dec 1, 2026 23:47Dominique GarmierDominique GarmierZIG0.15.1Success4,355+39.38 RP
Dec 1, 2026 23:34Dominique GarmierDominique GarmierZIG0.15.1Success4,431+78.18 RP
Dec 1, 2026 23:17Dominique GarmierDominique GarmierZIG0.15.1Success4,590+193.73 RP
Dec 1, 2026 23:09Dominique GarmierDominique GarmierZIG0.15.1Success5,038+53.29 RP
Dec 1, 2026 09:39Dominique GarmierDominique GarmierZIG0.15.1Success5,177+107.14 RP
Dec 1, 2026 07:26Dominique GarmierDominique GarmierZIG0.15.1Success5,481+67.32 RP
Dec 1, 2026 00:07Dominique GarmierDominique GarmierGOgo1.26.2Success5,810
Dec 1, 2026 00:06Dominique GarmierDominique GarmierRUSTrust-1.95.0Success5,721
Dec 1, 2026 00:06Dominique GarmierDominique GarmierCPPclang++20.1.2Success5,881
Nov 30, 2026 23:58Dominique GarmierDominique GarmierCSHARP9.0.15Success5,821
Nov 30, 2026 23:54Dominique GarmierDominique GarmierZIG0.15.1Success5,691+10.44 RP
Nov 30, 2026 23:50Dominique GarmierDominique GarmierGOgo1.26.2Success9,791
Nov 30, 2026 23:47Dominique GarmierDominique GarmierRUSTrust-1.95.0Success9,778
Nov 30, 2026 23:45Dominique GarmierDominique GarmierZIG0.15.1Success9,678
Nov 30, 2026 22:13Dominique GarmierDominique GarmierCPPclang++20.1.2Success5,725+233.18 RP
Nov 30, 2026 20:58Dominique GarmierDominique GarmierCPPclang++20.1.2Success6,607+139.16 RP
Nov 30, 2026 14:30janwwwjanwwwCPPclang++18.1.3Success2,483+309.91 RP
Nov 28, 2026 18:12Joshua MontrossJoshua MontrossCPPg++10.5.0Success60,362+165.67 RP
Nov 27, 2026 09:16Andrew TsibinAndrew TsibinRUSTrust-1.95.0Success2,372+1'245.55 RP
Nov 26, 2026 16:37LeighAtkinsLeighAtkinsGOgo1.26.2Success26,430+60.34 RP
Nov 26, 2026 16:28LeighAtkinsLeighAtkinsGOgo1.26.2Success31,445+318.02 RP
Nov 26, 2026 13:18Andrew TsibinAndrew TsibinRUSTrust-1.95.0Success3,361+467.78 RP
Nov 24, 2026 08:14MaximMaximCPPg++10.5.0Success60,402+165.56 RP
Nov 5, 2026 00:50AkhileshAkhileshCPPg++10.5.0Success60,348+165.71 RP
Nov 2, 2026 19:39Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success1,985+2.54 RP
Nov 2, 2026 19:37Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success55,862
Nov 2, 2026 19:33Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success24,877
Nov 2, 2026 19:26Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success244,827
Nov 2, 2026 19:19Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success11,383
Nov 2, 2026 19:18Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success32,657
Nov 2, 2026 19:16Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success1,986+118.83 RP
Nov 2, 2026 19:14Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success17,475
Nov 2, 2026 19:13Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success2,034+90.17 RP
Nov 2, 2026 19:09Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success25,504
Nov 2, 2026 19:07Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success41,870
Nov 2, 2026 19:03Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success2,072+142.41 RP
Nov 2, 2026 19:03Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success43,003
Nov 2, 2026 19:02Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success2,135+32.68 RP
Nov 2, 2026 19:00Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success34,065
Nov 2, 2026 18:56Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success43,662
Nov 2, 2026 18:41Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success50,271
Nov 2, 2026 18:35Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success2,150+15.09 RP
Nov 2, 2026 18:32Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success45,918
Nov 2, 2026 18:23Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success270,599
Nov 2, 2026 18:08Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success64,967
Nov 2, 2026 17:59Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success37,719
Nov 2, 2026 17:51Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success46,572
Nov 2, 2026 17:46Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success76,429
Nov 2, 2026 17:43Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success51,126
Nov 2, 2026 17:37Andrew EpsteinAndrew EpsteinCPPg++13.3.0Success2,181
Nov 2, 2026 17:37Andrew EpsteinAndrew EpsteinCPPg++14.2.0Success43,894
Oct 25, 2026 14:33Nao MinamiNao MinamiCPPg++10.5.0Success6,196
Oct 25, 2026 12:52Nao MinamiNao MinamiCPPg++10.5.0Success5,842+1'545.81 RP
Oct 25, 2026 12:06Nao MinamiNao MinamiCPPg++10.5.0Success60,266+165.93 RP
Oct 19, 2026 08:08highload-churnerhighload-churnerCPPg++13.3.0Success1,834
Oct 19, 2026 07:55highload-churnerhighload-churnerCPPg++13.3.0Success1,818+183.30 RP
Oct 19, 2026 07:12highload-churnerhighload-churnerCPPg++13.3.0Success1,868+59.51 RP
Oct 19, 2026 06:38highload-churnerhighload-churnerCPPg++13.3.0Success1,889+16.76 RP
Oct 19, 2026 06:33highload-churnerhighload-churnerCPPg++13.3.0Success11,070
Oct 19, 2026 06:20highload-churnerhighload-churnerCPPg++13.3.0Success14,159
Oct 19, 2026 04:37highload-churnerhighload-churnerCPPg++14.2.0Success1,906
Oct 19, 2026 04:18highload-churnerhighload-churnerCPPg++14.2.0Success8,530
Oct 19, 2026 04:14highload-churnerhighload-churnerCPPg++12.4.0Success8,577
Oct 19, 2026 04:07zayd-ansari-codezayd-ansari-codeCPPg++10.5.0Success60,377+165.63 RP
Oct 19, 2026 04:02highload-churnerhighload-churnerCPPg++13.3.0Success12,185
Oct 19, 2026 03:34highload-churnerhighload-churnerCPPg++13.3.0Success1,895+22.18 RP
Oct 19, 2026 03:26highload-churnerhighload-churnerCPPg++13.3.0Success1,903+11.02 RP
Oct 19, 2026 03:22highload-churnerhighload-churnerCPPg++13.3.0Success1,907+70.53 RP
Oct 19, 2026 03:13highload-churnerhighload-churnerCPPg++13.3.0Success12,244
Oct 19, 2026 02:32highload-churnerhighload-churnerCPPg++13.3.0Success10,517
Oct 17, 2026 13:54highload-churnerhighload-churnerCPPg++13.3.0Success1,933+21.32 RP
Oct 17, 2026 13:17highload-churnerhighload-churnerCPPg++13.3.0Success1,941+21.15 RP
Oct 17, 2026 12:31highload-churnerhighload-churnerCPPg++13.3.0Success1,949+143.31 RP
Oct 17, 2026 11:27highload-churnerhighload-churnerCPPg++13.3.0Success2,006
Oct 17, 2026 09:53KacpxerKacpxerCPPclang++20.1.2Success2,768+3'612.72 RP
Oct 17, 2026 09:41highload-churnerhighload-churnerCPPg++13.3.0Success2,008
Oct 17, 2026 09:05highload-churnerhighload-churnerCPPg++13.3.0Success2,005+24.75 RP
Oct 17, 2026 08:23highload-churnerhighload-churnerCPPg++13.3.0Success2,021
Oct 17, 2026 07:33highload-churnerhighload-churnerCPPg++13.3.0Success2,018
Oct 17, 2026 07:03highload-churnerhighload-churnerCPPg++13.3.0Success2,018
Oct 17, 2026 06:33highload-churnerhighload-churnerCPPg++13.3.0Success2,017
Oct 17, 2026 04:59highload-churnerhighload-churnerCPPg++13.3.0Success2,015+2.46 RP
Oct 17, 2026 04:58highload-churnerhighload-churnerCPPg++13.3.0Success2,016+9.82 RP
Oct 17, 2026 04:58izotoffizotoffGOgo1.26.2Success7,829
Oct 17, 2026 03:17izotoffizotoffGOgo1.26.2Success7,770+72.52 RP
Oct 17, 2026 02:42izotoffizotoffGOgo1.26.2Success8,234+222.12 RP
Oct 17, 2026 02:32izotoffizotoffGOgo1.26.2Success10,255
Oct 17, 2026 01:14izotoffizotoffGOgo1.26.2Success10,077+31.37 RP
Oct 16, 2026 23:45izotoffizotoffGOgo1.26.2Success10,406+672.73 RP
Oct 16, 2026 23:10izotoffizotoffGOgo1.26.2Success35,214