|
|
Show all threads Hide all threads Show all messages Hide all messages | Why this solution get WA1? | Buzmakov Dmitriy | 2031. Overturned Numbers | 17 Aug 2019 00:31 | 2 | #include <bits/stdc++.h> string c[4] = {"88", "68", "06", "16"}; int main() { cin >> n; if (n > 4) { cout << "Glupenky Pierre" << endl; return 0; } for (int i = n - 1; i >= 0; i--) cout << c[i] << " "; } "68 88" is good, isn't? There are many more combinations. You also forgot 9 | C++ AC | D4nick | 2031. Overturned Numbers | 3 Jan 2019 06:56 | 1 | C++ AC D4nick 3 Jan 2019 06:56 the main difficulty here was to understand that you need to use <string> #include <iostream> #include <string> using namespace std; int main() { int n; string arr[4] = { "16", "06", "68", "88" }; cin >> n; if (n <= 4) for (int i = 0; i < n; i++) { cout << arr[i] << " "; } else cout << "Glupenky Pierre"; } | nvm | netufantazii | 2031. Overturned Numbers | 25 Oct 2018 21:21 | 1 | nvm netufantazii 25 Oct 2018 21:21 Edited by author 26.10.2018 11:42 Edited by author 26.10.2018 11:42 | One digit numbers | mouse_wireless2 | 2031. Overturned Numbers | 25 Jan 2018 22:07 | 1 | Text says "Pierre intends to use one-digit integers supplemented with a leading zero and two-digit integers only." but it seems like you cannot have one digit numbers in the original sequence. For example, for test case 2, if you output "10 00" (which would translate to sequence 01 00, which ARE two consecutive numbers), you'll get wrong answer. Moral of the story, start checking for numbers from 10. | What is wrong? WA#4 | jack | 2031. Overturned Numbers | 2 Dec 2017 15:40 | 2 | import java.util.Scanner; public class ex2031 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int n=sc.nextInt(); if(n==1){ System.out.println("11"); }else{ if(n==2){ System.out.println("11"+" "+"01"); }else{ if(n==3){ System.out.println("001"+" "+"66"+" "+"86"); }else{ if(n==4){ System.out.println("16"+" "+"06"+" "+"68"+" "+"88"); }else{ System.out.println("Glupenky Pierre"); } } } } } } Он не может использовать трёхзначные числа | Why WA1? | ahmetov14 | 2031. Overturned Numbers | 7 Nov 2016 22:26 | 1 | int n = in.nextInt(); int l = 0; if (n > 24) { out.print("Glupenky Pierre"); } else { for (int i = 1; i <= n; i++) { if (i / 5 == 0) l = 0; if (i / 5 == 1) l = 1; if (i / 5 == 2) l = 8; if (i / 5 == 3) l = 6; if (i / 5 == 4) l = 9; if (i % 5 == 0) l = l * 10; if (i % 5 == 1) l = l * 10 + 1; if (i % 5 == 2) l = l * 10 + 8; if (i % 5 == 3) l = l * 10 + 6; if (i % 5 == 4) l = l * 10 + 9; if (l/10==0) out.print("0"); out.print(l); out.print(" "); } } Edited by author 07.11.2016 22:26 Edited by author 07.11.2016 22:27 | No subject | Bahodir | TUIT of IT | | 2031. Overturned Numbers | 14 Dec 2015 12:56 | 6 | No subject Bahodir | TUIT of IT | 23 Jan 2015 23:49 Edited by author 27.01.2015 16:39 import java.util.Scanner; /** * Created by Coder on 23.01.2015. */ public class OverturnedNumbers2031_ { public static void main(String[] args) { Scanner x = new Scanner(System.in); int n = x.nextInt(); if (n == 1) { System.out.println("01"); } else if (n == 2) { System.out.println("11 01"); } else if (n == 4) { System.out.println("16 06 68 88"); } else { System.out.println("Glupenky Pierre"); } } } You did not write a case of n=3.. Thanks a lot of.I got it. n = 3 -> "16 06 68"; Edited by author 14.02.2015 22:43 The best solution ever xD Why only 4 cases ?? Not all these are ok ?? "11", "01", "08", "06", "09", "10", "18", "16", "19", "80", "81", "86", "88", "89", "60", "68", "61", "66", "69", "90", "91", "98", "96", "99" | Easy | Nodir NAZAROV Komilijonovich [TUIT-Karshi] | 2031. Overturned Numbers | 5 Dec 2014 19:28 | 1 | Easy Nodir NAZAROV Komilijonovich [TUIT-Karshi] 5 Dec 2014 19:28 only 4 cases Edited by author 05.12.2014 19:38 Edited by author 05.12.2014 19:39 |
|
|
|