• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:22
CEST 06:22
KST 13:22
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
New 3v3 BGH Ladder (and more) on ShieldBattery!29Weekly Cups (August 17-23): Zerg dominate the week4Weekly Cups (August 10-16): SHIN doubles2GSTL Returns in 2026!45Weekly Cups (Aug 3-9): Protoss get shut out7
StarCraft 2
General
How would you feel about frequent/monthly balance patches for SC2? Starcraft2 player guess game is Coming~! Weekly Cups (August 17-23): Zerg dominate the week SC4ALL II: SC2 Player Announcement 6/8 - Maru PhD study /w SC2 - help with a survey!
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament 2026 GSTL Announcement IntoTheTV X SOOP SC2 League : Weekly & Monthly PIG STY FESTIVAL 8.0! (13 - 23 August) WORTEX 2026 - Hungarian SC2 Finals Budapest
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 540 Dodge This The PondCast: SC2 News & Results Mutation # 539 Thunder Dome Mutation # 538 Media Blackout
Brood War
General
New 3v3 BGH Ladder (and more) on ShieldBattery! [ASL22] Ro24 Preview: Siren's Call Farewell Beloved Starcraft (Youtube Videos) BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion
Tourneys
[ASL22] Ro24 Group F [ASL22] Ro24 Group E [ASL22] Ro24 Group D Small VOD Thread 2.0
Strategy
Game Theory for Starcraft Replay Review Process - What do you do? Odyssey Mineral Stack Saturation Fighting Spirit mining rates
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Anyone here play Quakeworld back in the day? Stormgate/Frost Giant Megathread EVE Corporation
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Dating: How's your luck? Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
The Creator Fan Club MarineLorD Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Young Players Exit Esports E…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Please support my new stand…
Peanutsc
Hello guys!
LIN1s
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4963 users

SC2 beta key contest

Blogs > forti
Post a Reply
forti
Profile Blog Joined April 2010
Singapore9 Posts
Last Edited: 2010-05-04 16:13:12
May 04 2010 15:42 GMT
#1
CONTEST OVER
vesperia won it!

Hello everyone, I got my beta key off one of these contests on TL and recently got my friend invites. I figured I should give it back to TL

The contest will be similar to the one I had to solve (mathematical) and you can either PM me or post in this thread the solution. First person (by time) to give me an acceptable solution will receive the key!

The question is:

Show that determining whether a directed graph G with vertice set V and edge set E contains a universal sink - a vertex with in-degree |V| -1 and out-degree 0 - can be determined in time O(V ), given an adjacency matrix for G.

You will require some basic graph theory and algorithm knowledge to solve this question

edit: Your answer just needs to describe a method/algorithm to obtain the answer and explain why it works, no actual code needed


Here are some useful links

+ Show Spoiler +

http://en.wikipedia.org/wiki/Adjacency_matrix
http://en.wikipedia.org/wiki/Graph_(mathematics)
http://en.wikipedia.org/wiki/Directed_graph#Indegree_and_outdegree
http://en.wikipedia.org/wiki/Asymptotic_upper_bound


Terranlisk
Profile Blog Joined February 2007
Singapore1404 Posts
May 04 2010 15:48 GMT
#2
damnit maths
aka myheronoob
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
May 04 2010 15:51 GMT
#3
Do you mean O(E) or really O(V)?
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 15:54 GMT
#4
O(V), O(E) is too easy ^^
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:01 GMT
#5
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)
bITt.mAN
Profile Blog Joined March 2009
Switzerland3693 Posts
May 04 2010 16:06 GMT
#6
Damm, why couldn't it be something simpler
BW4LYF . . . . . . PM me, I LOVE PMs. . . . . . Long live "NaDa's Body" . . . . . . Fantasy | Bisu/Best | Jaedong . . . . .
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:12 GMT
#7
On May 05 2010 01:01 Vesperia wrote:
Is this it?

Let Vij be an adjacency matrix (containing integers 0 and 1)
int hold = 0; // first vertex with vertices number 0..n-1
for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}
// check to see if candidate is a universal sink – it is the only possibility
boolean flag = true;
for (int j = 0; j < n; j++) {
if (j != hold && (V[j][hold] == 0 || V[hold][j] == 1) {
flag == false;
break;
}
}
if (flag)
System.out.println(“Vertex “, hold, “ is universal sink”);
else
System.out.println(“Graph contains no universal sink.”);
//both for-loops execute in O(|V|)


yup that's the solution i had in mind ^^ i'll PM you the key
Vesperia
Profile Joined April 2010
Canada30 Posts
May 04 2010 16:15 GMT
#8
YESSSSS! I finally got one!

Thanks so much forti!!!
forti
Profile Blog Joined April 2010
Singapore9 Posts
May 04 2010 16:33 GMT
#9
btw

for (int i = 1; i < n; i++) {
if (V[hold][i] == 1) // hold not a sink
hold = i; //make vertex i the new candidate
//else vertex i does not have in-degree |V| -1 and hold still a sink candidate
i++;
}

the 2nd i++ is wrong but the general method is correct ^^
yh8c4
Profile Blog Joined July 2009
108 Posts
May 04 2010 18:27 GMT
#10
nice to see that the key i gave to you spawned to another user
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
2026 GSTL: Main Stage Day 2
CranKy Ducklings144
Discussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
WinterStarcraft481
RuFF_SC2 191
ProTech120
StarCraft: Brood War
Rain 2399
GuemChi 1585
Leta 153
Bale 48
firebathero 0
Dota 2
monkeys_forever715
NeuroSwarm196
League of Legends
JimRising 660
Counter-Strike
summit1g5088
minikerr45
Super Smash Bros
hungrybox826
Mew2King107
Other Games
C9.Mang0203
Livibee125
ViBE124
Maynarde111
Organizations
Other Games
BasetradeTV58
[ Show 13 non-featured ]
StarCraft 2
• Berry_CruncH175
• practicex 5
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota29
League of Legends
• Lourlo1055
• Rush740
Upcoming Events
The PondCast
5h 38m
Replay Cast
19h 38m
Escore
1d 5h
IntoTheTV X SOOP
1d 6h
Korean StarCraft League
1d 21h
GSL
2 days
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Weekly
3 days
Afreeca Starleague
4 days
[ Show More ]
GSL
5 days
PiGosaur Cup
5 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Season 22: Qualifier 1
PiG Sty Festival 8.0
META DYMY #4

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL Season 22: Qualifier 2
RSL Revival: Season 6
Light Tournament 2026
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026

Upcoming

BSL 2026 LAN: Kraków
CSL 2026 AUTUMN (S22)
Acropolis #5
Acropolis #5 - TRS
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Calamity Invitational
Big Dog Cup 2026 Div 1
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.