Account
Draft saved on this device
▤ DescriptionOriginal CppValley problem
HFT SystemsEasy

Detect A Crossed Or Locked Market

Classify each quote: CROSSED if bid is greater than ask, LOCKED if bid equals ask, otherwise NORMAL.

Classify each quote: CROSSED if bid is greater than ask, LOCKED if bid equals ask, otherwise NORMAL. Every line is independently evaluated.

Input format

First line N; next N lines bid ask.

Output format

Print N lines containing CROSSED, LOCKED, or NORMAL.

Examples

Example 1
Input
3
101 100
100 100
99 101
Expected output
CROSSED
LOCKED
NORMAL

Constraints

  • 1 ≤ N ≤ 100000
  • 0 ≤ bid, ask ≤ 10^9

Related concepts

Quotes

This early-access exercise uses standard input/output. More advanced concurrency challenges will use specialized class interfaces, instrumentation, and stress tests once the judging infrastructure is ready.

⌘ CodeC++17
GNU C++17 · main.cpp

Loading Monaco C++ editor…

Checking judge...

Checking whether the external C++ judge is available.

⌁ Test cases & resultsPublic samples: 1
Input
3
101 100
100 100
99 101
Expected output
CROSSED
LOCKED
NORMAL
Execution requires a secure external judge.