generated from OPCODE-Open-Spring-Fest/template
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
496a47e
commit ac8845f
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Alice shuffled a set of cards, each containing a number from 1 to n, with four cards for each number. | ||
After removing one card, she handed you the remaining stack. The i-th card in the stack (where i ranges from 1 to 4n−1) has a number Ai written on it. | ||
Your task is to determine which number Alice took from the original set. | ||
|
||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
Input: | ||
First line of input contains an integer n (1 <= n <= 10^5). | ||
Second line of input conatains 4n-1 integers. | ||
|
||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
Output: | ||
Print the missing number. | ||
|
||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
Time Limit: 2 sec | ||
Memory Limit: 1024 MB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Sample Input 1: | ||
3 | ||
1 3 2 3 3 2 2 1 1 1 2 | ||
|
||
Sample Output 1: | ||
3 | ||
|
||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
Sample Input 2: | ||
1 | ||
1 1 1 | ||
|
||
Sample Output 2: | ||
1 | ||
|
||
---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ||
|
||
Sample Input 3: | ||
4 | ||
3 2 1 1 2 4 4 4 4 3 1 3 2 1 3 | ||
|
||
Sample Output 3: | ||
2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// Write your code here. |