Contest #1
Difference between en2 and en3, changed 1246 character(s)
## A. Still Typing↵
↵
<spoiler summary="Hint 1 (English)
Hello **ICPC-O6U** Community!↵
↵
Thank you all for participating in **Contest #1**! We hope you enjoyed the problems and learned something new. Below is the official editorial containing progressive hints, explanations, and reference C++ solutions for all problems.↵
↵
[cut]↵
↵
## A. Still Typing↵
↵
<spoiler summary="Hint 1
">↵
Store the 10 names in a fixed array in the exact same order given in the problem statement.↵
</spoiler>↵
↵
<spoiler summary="Hint 2
 (English)">↵
Find the index $i$ ($0 \le i < 10$) that has the maximum typing speed, then print the name at index $i$.↵
</spoiler>↵
↵
<spoiler summary="Editorial
 (English)">↵
We are given the names of $10$ participants in a fixed order, followed by $10$ integers representing their typing speeds.↵
↵
1. Store the names in an array of strings `names` of size $10$ matching the order in the statement.↵
2. Read the $10$ speeds into an array `arr`
 (or process them on the fly).↵
3. Track the maximum speed `mx` found so far and its corresponding index `idx`.↵
4. Finally, output `names[idx]`.↵
↵
* **Time Complexity:** $\mathcal{O}(1)$ (since the number of participants is fixed at $10$).↵
* **Space Complexity:** $\mathcal{O}(1)$.↵
</spoiler>↵
↵
---↵
↵
<spoiler summary="تلميح 1 (عربي)">↵
خزّن أسماء الـ 10 متسابقين في Array ثابتة بنفس الترتيب المذكور في نص المسألة بالظبط.↵
</spoiler>↵
↵
<spoiler summary="تلميح 2 (عربي)">↵
دوّر على الـ Index صاحب أكبر سرعة كتابة، وبعدين اطبع الاسم الموجود في نفس الـ Index.↵
</spoiler>↵
↵
<spoiler summary="الشرح (عربي)">↵
المسألة بتدينا أسماء $10$ متسابقين بترتيب ثابت، وبعدها بتدينا $10$ أرقام بيمثلوا سرعة كل واحد فيهم بالترتيب.↵
↵
1. هنعمل Array من نوع `string` نحط فيها الأسماء بنفس الترتيب المكتوب في المسألة.↵
2. هنستقبل الـ $10$ أرقام ونعدي عليهم بـ Loop عشان نجيب أكبر رقم (`mx`) ونحتفظ بمكانه (`idx`).↵
3. في الآخر هنطبع الاسم اللي في المكان ده `names[idx]`.↵
↵
* **التعقيد الزمني (Time Complexity):** $\mathcal{O}(1)$ لأن عدد العناصر ثابت وهو $10$.↵
* **مساحة الذاكرة (Space Complexity):** $\mathcal{O}(1)$.↵
</spoiler>↵
↵
<spoiler summary="Solution Code (C++)">↵
```
Solution Code (C++)">↵
~~~
cpp↵
#include <bits/stdc++.h>↵
using namespace std;↵
#define int long long↵
#define endl "\n"↵
signed main() {↵
    ios_base::sync_with_stdio(false);↵
    cin.tie(nullptr);↵
↵
 ↵
    string ans[]={"Andrew","Moaz","Hani","Dabour","Seif","Omar","Hadeer","Mariam","Mai","Basant"};↵
   int arr[10];↵
   for(int i=0;i<10;i++)cin>>arr[i];↵
    int mx=0;↵
    int idx=-1;↵
  for(int i=0;i<10;i++){↵
     if(arr[i]>mx){↵
        mx=arr[i];↵
        idx=i;↵
     }↵
  }↵
  cout<<ans[idx]<<endl;↵
}↵
[cut]~~~↵
</spoiler>↵
↵
---

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English AndrewHazem 2026-11-27 02:03:16 1246
en2 English AndrewHazem 2026-11-27 02:01:47 253
en1 English AndrewHazem 2026-11-27 01:58:50 2557 Initial revision (published)