code for some graph theory problem of ACM/OI