Computer Science, asked by gsivaanandini, 9 months ago

Salma has been tracking the price of the Edyst company stock over a long time, collecting day by day data on what the Edyst stock value was on that day. Now that she has all this data, she wants to find out a way in which she could have made a profit buying and selling this stock. However, her father has restricted her to purchasing and holding only 1 unit of the stock at any given time, which means she cannot buy until she sells the unit stock that she already has. Write a program to help her find on which days she should have bought Edyst stock and on which day she should have sold it so that at the end of it all, she would make the most profit. For example, suppose she tracked the price for 7 days: [100, 180, 260, 310, 40, 535, 695]. To make the maximum profit, she should first buy on day 0, and sell on day 3. Again buy on day 4 and sell on day 6. This way, she makes a profit of (310-100) + (695-40) = 865. If Salma can't make any profit, print Can't make a profit! Input Format: First line is an integer N N integers follow in the second line. Output Format: Print the indexes of days on which to buy/sell as shown in the examples below. Else, print Can't make a profit!. Sample Input 1: 5 5 4 3 2 1 Output: Can't make a profit! Example Input: 6 1 5 3 6 7 8 Output: 0 1 2 5 This means that Salma should buy on day 0, sell on day 1. Then buy on day 2 and sell on day 5.

Answers

Answered by chocolatelover01
0

&lt;!DOCTYPE html&gt;</p><p></p><p>&lt;html lang="en"&gt;</p><p></p><p>&lt;head&gt;</p><p></p><p>&lt;title&gt;Shinchan&lt;/title&gt;</p><p></p><p>&lt;/head&gt;</p><p></p><p>&lt;body&gt;</p><p></p><p>&lt;div class="face"&gt; </p><p>&lt;div class="forhead"&gt;&lt;/div&gt;</p><p>&lt;div class="cheeks"&gt;&lt;/div&gt;</p><p>&lt;div class="ear"&gt;&lt;/div&gt;</p><p>&lt;div class="eyebrow left"&gt;&lt;/div&gt;</p><p>&lt;div class="eyebrow right"&gt;&lt;/div&gt;</p><p>&lt;div class="eye left"&gt;&lt;/div&gt;</p><p>&lt;div class="eye right"&gt;&lt;/div&gt;</p><p>&lt;div class="mouth"&gt;&lt;/div&gt;</p><p>&lt;div class="shy"&gt;&lt;/div&gt;</p><p>&lt;div class="shy right"&gt;&lt;/div&gt;</p><p>&lt;/div&gt;</p><p>&lt;style&gt;</p><p>body {</p><p>background:#3e505e</p><p>}</p><p>.face {</p><p>height: 600px;</p><p>width: 350px;</p><p>position: relative;</p><p>margin: auto;</p><p>}</p><p>.face:before {</p><p>content:'';</p><p>background:black;</p><p>height:122px;</p><p>width:95px;</p><p>position:absolute;</p><p>z-index:6;</p><p>left:210px;</p><p>top:29px;</p><p>border-radius:100% 190% 100% 0%;</p><p>transform: rotate(-20deg);</p><p>}</p><p>.face:after {</p><p>content:'';</p><p>width:230px;</p><p>height:180px;</p><p>background:black;</p><p>content:'';</p><p>transform: rotate(-8deg);</p><p>position:absolute;</p><p>border-radius:100% 160% 100% 0%;</p><p>left:70px;</p><p>bottom:-14px;</p><p>top:10px;</p><p>z-index:5;</p><p>}</p><p>.forhead, .forhead:after {</p><p>content: '';</p><p>width: 220px;</p><p>height: 181px;</p><p>background: #fbc6a3;</p><p>content: '';</p><p>transform: rotate(-3deg);</p><p>position: absolute;</p><p>border-radius: 60% 120% 50% 0%;</p><p>left: 67px;</p><p>bottom: -14px;</p><p>top: 21px;</p><p>z-index: 6;</p><p>}</p><p>.forhead:after {</p><p>width: 160px;</p><p>height: 150px;</p><p>border-radius: 150% 174% 159% 100%;</p><p>transform: rotate(-20deg);</p><p>top: 13px;</p><p>left: 59px;</p><p>border-top: 15px solid #fbc6a3;</p><p>}</p><p>.forhead:before{</p><p>background:#fbc6a3;</p><p>width:60px;</p><p>height:10px;</p><p>content:'';</p><p>position:absolute;</p><p>z-index:7;</p><p>left:105px;</p><p>top:9px;</p><p>transform: rotate(13deg);</p><p>border-radius:100%</p><p>}</p><p>.ear {</p><p>width:60px;</p><p>height:50px;</p><p>background:#fbc6a3;</p><p>z-index:7;</p><p>position:absolute;</p><p>border-radius:300% 190% 200% 100%;</p><p>transform: rotate(-20deg);</p><p>top:110px;</p><p>left:285px</p><p>}</p><p>.cheeks {</p><p>background: #fbc6a3;</p><p>width: 280px;</p><p>height: 100px;</p><p>border-radius: 50px 0px 50px 40px;</p><p>transform: rotate(-3deg);</p><p>position: relative;</p><p>content: 'a';</p><p>top: 108px;</p><p>left:10px</p><p>}</p><p>.cheeks:after {</p><p>width: 297px;</p><p>height: 100px;</p><p>background: #fbc6a3;</p><p>content: '';</p><p>transform: rotate(-3deg);</p><p>position: absolute;</p><p>border-radius: 100% 100% 100% 100%;</p><p>left: 1px;</p><p>bottom: -14px;</p><p>}</p><p>.eye {</p><p>width:40px;</p><p>height:40px;</p><p>position:relative;</p><p>background:black;</p><p>border-radius:100%;</p><p>animation: close-eye 4s none .2s infinite;</p><p>}</p><p>.eye:after {</p><p>content:'';</p><p>position:absolute;</p><p>background:white;</p><p>width:15px;</p><p>height:15px;</p><p>border-radius:100%;</p><p>left:17px;</p><p>top:12px;</p><p>}</p><p>.eye:before {</p><p>content:'';</p><p>position:absolute;</p><p>width:70px;</p><p>height:60px;</p><p>border-radius:100%;</p><p>border-top:2px solid black;</p><p>left:-20px;</p><p>margin-top:-20px;</p><p>}</p><p>.eye.left,.eye.right {</p><p>position:absolute;</p><p>top:80px;</p><p>left:100px;</p><p>z-index:10;</p><p></p><p>}</p><p>.eye.right {</p><p>left:190px;</p><p>top:90px;</p><p>}</p><p>.eyebrow {</p><p>animation: eyebroani 2s linear .2s infinite;</p><p>}</p><p>.eyebrow,.eyebrow:after {</p><p>position:absolute;</p><p>width:20px;</p><p>height:60px;</p><p>background:black;</p><p>z-index:8;</p><p>border-radius:15px;</p><p>transform: rotate(40deg);</p><p>top:10px;</p><p>left:90px;</p><p></p><p>}</p><p>.eyebrow:after {</p><p>content:'';</p><p>transform: rotate(-100deg);</p><p>left:19px;</p><p>margin-top:-23px;</p><p>top:auto;</p><p>}</p><p>.eyebrow.right {</p><p>left:180px;</p><p>top:8px;</p><p>transform: rotate(50deg);</p><p>}</p><p>.mouth {</p><p>position:absolute;</p><p>width:40px;</p><p>height:40px;</p><p>background:#76322f;</p><p>border-radius:100%;</p><p>top:180px;</p><p>left:50px;</p><p>z-index:8;</p><p>}</p><p>.shy {</p><p>position:absolute;</p><p>width:0px;</p><p>height:0px;</p><p>border-radius:100%;</p><p>opacity:0;</p><p>box-shadow: 0px 0px 40px 20px red;</p><p>z-index:8;</p><p>left:35px;</p><p>top:160px;</p><p>animation: shy 10s linear .2s infinite;</p><p>}</p><p>.shy.right {</p><p>left:170px;</p><p>top:180px;</p><p>}</p><p>@keyframes eyebroani {</p><p>0% {margin-top:auto}</p><p>10% {margin-top:-10px}</p><p>20% {margin-top:auto}</p><p>30% {margin-top:-10px}</p><p>40% {margin-top:auto}</p><p>100% {margin-top:auto}</p><p>}</p><p>@keyframes shy {</p><p>0% {opacity:0}</p><p>10% {opacity:0.2}</p><p>90% {opacity:0.2}</p><p>100% {opacity:0}</p><p>}</p><p></p><p>@keyframes close-eye {</p><p>0% {</p><p>height: 40px;</p><p>margin-top: auto;</p><p>overflow: auto;</p><p>}</p><p>5% {</p><p>height: 2px;</p><p>margin-top: 20px;</p><p>overflow: hidden;</p><p>}</p><p>5.1% {</p><p>height: 40px;</p><p>margin-top:0;</p><p>overflow:visible;</p><p>}</p><p>}</p><p></p><p>&lt;/style&gt;</p><p>&lt;/body&gt;</p><p>&lt;/html&gt;

Similar questions