Need rewriting the code from C++ to Python and Java

Imekamilika Ilichapishwa Miaka 2 iliyopita Kulipwa wakati wa kujifungua
Imekamilika Kulipwa wakati wa kujifungua

I've got a written code in C++ but I need it rewritten in Java and Python ASAP. I don't really know those languages, mind taking a look? I'll give you the description what program does, so you can understand it better. There are N cards on the table. On each card there are two numbers (type double): one at the front and one at the back. Cards are placed front side up. The Great Illusionist wants to show his magic trick. In order to do this, the sequence of numbers must be in non-decreasing order. In that case, the Great Illusionist may have to flip some of the cards to their back side. Illusionist's trick requires someone from the audience. Some of the guests are his enemies, so when they approach the table, they swap two cards spots. After every swap, the Illusionist can flip some of the cards, but he still may not be able to do the trick. The program has to tell, whether the Great Illusionist can do the trick after each swap.

Input:

In the first verse of input there is integer n (2<=n<=200000), representing how many cards are on the table. In the next n lines there are cards (one per line), in the order that they lay on the table. Integer xi represents the number on the front of the card, integer yi the number on the back of the card (0<=xi,yi<=10^7). The starting cards can't let the Illusionist do the trick. Next line is integer m (1<=m<=1000000), representing the number of card swaps. In the next m lines there are card swaps (one per line). Integer aj represents one card, integer bj the other card to swap.

Output:

Program outputs m lines, each with one word: YES or NO. YES - the Illusionist can do the trick. NO - the Illusionist can't do the trick.

Example:

Input:

4

2 5

3 4

6 3

2 7

2

3 4

1 3

Output:

NO

YES

C++ file attached.

Python Java C Programming Uprogramu C++ Software Architecture

Kitambulisho cha Mradi: #32654672

Kuhusu mradi

9 mapendekezo Mradi wa mbali Ipo mtandaoni %project.latestActivity_relativeTime|badilisha%

Imetuzwa kwa:

TsehelnykAlona

Hi, I am getting interest in your porting job. I will make out it for you. Java & Python It's a piece of cake. Thanks

$20 USD kwa siku 1
(Maoni 0)
0.0

9 wafanyakazi huru wanazabuni wastani wa $29 kwa kazi hii

theatasolution1

Good day, I've complete Phd Software Engineering. I've 5-Year experience in Java development and algorithm implementation. My Core Expertise in Java - C++ - C - object-oriented - Data Structure - Swing - OpenGL - JavaF Zaidi

$18 USD kwa siku 1
(Maoni 62)
5.3
dominicnzioka197

HELLO DEAR EMPLOYER, First receive warm greetings, and hoping you are good, i welcome you to the home of Amazing services and quality. EXPERT IN NAMED SKILLS, OVER 18 YEARS OF EXPERIENCE, After KEENLY reading your des Zaidi

$100 USD kwa siku 1
(Maoni 9)
3.4
yuriikvachuk5

ONE OF THE BEST C++,PYTHON EXPERT Hi, Client. I have deep knowledge and experience of C/C++, Python, JavaScript, Matlab/simulink , embeded C, Control theory, Electronics and optimization algorithm. I was awarded the Zaidi

$30 USD kwa siku 1
(Maoni 3)
2.6
rizwankhan85

Hi there, My name is Rizwan Ul Ahmad Khan and I have more than 13 years of experience in writing C / C++, Python and Java programs. I have gone through your code and I can easily rewrite it in Python and Java. I assu Zaidi

$15 USD kwa siku 2
(Maoni 2)
1.7
pkgodda

I have extensive experience in working with projects of python, java and c++. I can do it in a day.

$25 USD kwa siku 1
(Maoni 0)
0.0
abhinav8465

Hey I understand that you need the rewriting of code from C++ to Python and Java and i can assure you full gurantee of satisfaction by working with me. Below are the reasons why you should give the project to me : * Zaidi

$18 USD kwa siku 7
(Maoni 0)
0.0
Mohan7819

Hello sir, I can retype your data with good eyes on details. Assurance of quality output. Kindly send me a message so that we can discuss further. Looking forward to working with you. Thanks and Regards

$18 USD kwa siku 7
(Maoni 0)
0.0