TouchStone
  Please Login
Login Sign Up
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P4742
  • Problem
  • P4742「2018 集训队互测 Day 1」完美的队列
    Limits : Time Limit : - MS   Memory Limit : 262144 KB
    Judgment Tips : 5000ms, 256M
    Description

    Input Format

    Output Format

    Sample Input

    3 3
    1 2 3
    1 2 1
    2 3 2
    1 3 3

    Sample Output

    1
    2
    2

    Hint