forked from hamza-solutions/afcon
/
index.html
391 lines (368 loc) · 14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>AFCON Challenge</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.css"
/>
<link rel="stylesheet" type="text/css" href="./assets/style.css" />
<meta property="og:title" content="2024 AFCON Challenge" />
<meta property="og:url" content="http://afcon.pages.dev" />
<meta
property="og:image"
content="http://afcon.pages.dev/images/og_afcon.webp"
/>
<meta property="og:type" content="website" />
<meta
property="og:description"
content="AFCON Challenge: Egypt national football team is getting ready for the AFCON. Players are exerting much effort in the training to do their best in the following match. Coaches follow a weird strategy to choose the man of AFCON (Africa Cup of Nations). We are challenging you to help the Egyptian players to know the minimum number of goals each player needs to score to be the man of AFCON."
/>
</head>
<body>
<h2 class="ui header">
<img src="./images/afcon.png" />
<div class="content">
2024 Africa Cup of Nations
<div class="sub header">AFCON Challenge</div>
</div>
</h2>
<div class="ui stackable main grid">
<div
class="nine wide problem column"
style="padding-left: 0 !important; padding-right: 0 !important"
>
<div class="ui doubling twelve column grid players"></div>
<span class="ui medium grey text">
Players info and images credit
<a
href="https://www.filgoal.com/teams/18/players/%D9%85%D8%B5%D8%B1"
target="blank"
>@filgoal</a
>.
</span>
<h2 class="ui header">
<img
class="ui rounded image"
style="margin: 0"
src="./images/egypt.png"
/>
<div class="content">
Egypt @AFCON
<div class="sub header">Time limit per test: 1 second</div>
<div class="sub header">Memory limit per test: 128 megabytes</div>
</div>
</h2>
<div class="ui segment">
<p style="text-align: justify" class="ui red large text">
<i class="eg flag"></i> The Egyptian national football team is
getting ready to face <i class="gh flag"></i>Ghana this evening. The
players are putting in significant effort during training to deliver
their best performance in the upcoming match. Coaches have a unique
way of picking the best player a.k.a "man of AFCON" (Africa Cup of
Nations). A player is considered a <b>"PRIMO"</b> if the total
number of goals they've scored is a prime number. The coaches will
choose the <i>highest</i> <b>PRIMO</b> player as the man of
AFCON.<br /><br />
You are given <b>N</b>, the number of matches played so far,
followed by <i>N</i> match description. <br />
Each match description starts with <b>M</b>, the number of players
who scored at the match, followed by <i>M</i> lines.<br />
Each line consists of a string <b>P</b>, the player name, and
<b>G</b>, the number of goals scored by that player at this
match.<br />
Then you will be asked <b>K</b> queries. Each query (line) consists
of a player name. For each query you have to calculate the
<b>minimum</b> number of goals the player needs to score in the next
match to be the man of the AFCON.<br /><br />
The players are busy with their training, and we've heard you're a
<i>clever</i> developer. Can you help the Egyptian players know how
many goals they need to score to become the man of AFCON?
</p>
</div>
<h2 class="ui header">Input</h2>
<div class="ui segments">
<div class="ui segment">
<p>(1 ≤ N ≤ 100) — The number of matches played.</p>
</div>
<div class="ui segment">
<p>(1 ≤ M ≤ 25) — The number of players who scored at the match.</p>
</div>
<div class="ui segment">
<p>
(1 ≤ length(S) ≤ 100) — The name of the player. The name consists
of uppercase and lowercase English letters only. (No spaces in the
name)
</p>
</div>
<div class="ui segment">
<p>
(1 ≤ G ≤ 10) — The number of goals scored by a player at the
match.
</p>
</div>
<div class="ui segment">
<p>(1 ≤ K ≤ 15) — The number of queries.</p>
</div>
</div>
<h2 class="ui header">Output</h2>
<div class="ui segments">
<div class="ui segment">
<p>
The output should consist of <b>K</b> lines. Each line consists of
the number of goals the player needs to score in the next match to
be the man of AFCON.
</p>
</div>
</div>
<h2 class="ui header">Example</h2>
<div class="ui horizontal segments">
<div class="ui segment">
<h3 class="ui header">Input</h3>
<p>
3<br />
2<br />
Salah 2<br />
Trezeguet 4<br />
3<br />
AliGabr 3<br />
OmarMarmosh 1<br />
Hegazi 2<br />
2<br />
Elneny 1<br />
Salah 3<br />
3<br />
Trezeguet<br />
Salah<br />
AliGabr
</p>
</div>
<div class="ui segment">
<h3 class="ui header">Output</h3>
<p>
3<br />
0<br />
4<br />
</p>
</div>
</div>
<h2 class="ui header">Explanation</h2>
<div class="explanation">
<p>We have 3 matches.</p>
<div class="ui segments">
<div class="ui segment">
The 1<sup>st</sup> match
<span class="ui card"><img class="player10" /></span
><b>Salah</b> scored 2 goals and
<span class="ui card"><img class="player7" /></span
><b>Trezeguet</b> scored 4 goals.<br />
</div>
<div class="ui segment">
The 2<sup>nd</sup> match
<span class="ui card"><img class="player2" /></span
><b>Ali Gabr</b> scored 3 goals,
<span class="ui card"><img class="player22" /></span
><b>Omar Marmosh</b> scored 1 goal and
<span class="ui card"><img class="player6" /></span
><b>Hegazi</b> scored 2 goals.<br />
</div>
<div class="ui segment">
The 3<sup>rd</sup> match
<span class="ui card"><img class="player17" /></span
><b>Elneny</b> scored 1 goal, and
<span class="ui card"><img class="player10" /></span
><b>Salah</b> scored 3 goals.<br />
</div>
</div>
<p>So the final scores are</p>
<table class="ui celled table">
<tr>
<td class="four wide">
<span class="ui card"><img class="player10" /></span
><b>Salah</b> 5 goals
</td>
<td class="four wide">
<span class="ui card"><img class="player7" /></span
><b>Trezeguet</b> 4 goals
</td>
<td class="four wide">
<span class="ui card"><img class="player2" /></span
><b>Ali Gabr</b> 3 goals
</td>
</tr>
<tr>
<td>
<span class="ui card"><img class="player22" /></span
><b>Omar Marmosh</b> 1 goal
</td>
<td>
<span class="ui card"><img class="player6" /></span
><b>Hegazi</b> 2 goals
</td>
<td>
<span class="ui card"><img class="player17" /></span
><b>Elneny</b> 1 goal
</td>
</tr>
</table>
<p>
So far, <b>Salah</b> is the highest <b>PRIMO</b> and needs no more
goals to be the man of AFCON. But what about other players?
</p>
<table class="ui celled table">
<tr>
<td class="five wide">
<span class="ui card"><img class="player7" /></span
><b>Trezeguet</b> scored 4 goals
</td>
<td class="eight wide">
<p style="margin-left: 10px">
Needs 3 more goals to have 7 goals and exceed <b>Salah</b>
</p>
</td>
</tr>
<tr>
<td>
<span class="ui card"><img class="player10" /></span
><b>Salah</b> scored 5 goals
</td>
<td>
<p style="margin-left: 10px">
Needs no more goals, He is the highest <b>PRIMO</b>
<i class="ui yellow star icon"></i>
</p>
</td>
</tr>
<tr>
<td>
<span class="ui card"><img class="player2" /></span
><b>Ali Gabr</b> scored 3 goals
</td>
<td>
<p style="margin-left: 10px">
Needs 4 more goals to have 7 goals and exceed <b>Salah</b>
</p>
</td>
</tr>
</table>
</div>
<div class="ui section divider" style="margin-bottom: 10px"></div>
<h3 class="ui header credits" style="margin: 0">
<img
src="./images/footer.png"
class="ui rounded image"
style="margin: 0"
/>
<div class="content">
<div class="sub header">
<p>
Made with
<span class="ui red text">
<i class="heart icon"></i>
<a href="https://github.com/kerolloz" target="blank">
@Kerollos Magdy
</a>
</span>
<br />
UI was originally developed by
<a
href="https://www.linkedin.com/in/amr-salama/"
target="blank"
>
Amr Salama
</a>
for the
<a
href="https://hamza-solutions.github.io/afcon/"
target="blank"
>
2019 AFCON challenge
</a>
</p>
</div>
</div>
</h3>
</div>
<div
class="seven wide submission column"
style="padding-left: 0 !important; padding-right: 0 !important"
>
<div class="submission-content">
<h2 class="ui header">
<img
src="./images/cup.jpg"
class="ui rounded image"
style="margin: 0"
/>
<div class="content">
Submit Your Solution
<div class="sub header">
<p>The winners will be announced next Sunday</p>
</div>
</div>
</h2>
<div class="ui hidden message verdict"></div>
<div class="ui form">
<div class="required field">
<label for="name">Name</label>
<div class="ui icon input">
<input id="name" type="text" placeholder="Name" />
<i class="user icon"></i>
</div>
</div>
<div class="required field">
<label for="languageId">Programming Language</label>
<div class="ui search selection dropdown">
<input id="languageId" name="language" type="hidden" />
<i class="dropdown icon"></i>
<div class="default text">Programming Language</div>
<div class="menu" id="languages"></div>
</div>
</div>
<div class="required field">
<label for="sourceCode">Source Code</label>
<textarea id="sourceCode" placeholder="Source Code"></textarea>
</div>
<div class="ui fluid submit button">Submit</div>
<div class="ui error message"></div>
</div>
<div class="ui hidden icon success message successfully-submitted">
<i class="check icon"></i>
<div class="content">
<div class="header">Form Submitted</div>
<p>Your submission has been submitted successfully.</p>
</div>
</div>
<div class="ui section divider" style="margin-bottom: 10px"></div>
<iframe
src="https://afcon.betteruptime.com/badge"
width="250"
height="30"
frameborder="0"
scrolling="no"
></iframe>
<span class="ui grey text" style="display: block">
Facing any issues?<br />
Please let us know by opening an issue
</span>
<a
class="ui grey compact labeled icon button"
style="margin-top: 5px"
href="https://github.com/afcon-challenge/client/issues"
target="blank"
>
<i class="github icon"></i> GitHub
</a>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/fomantic-ui@2.9.3/dist/semantic.min.js"></script>
<script src="./assets/src.js"></script>
</body>
</html>