Submission details
Task:Vuodet
Sender:TapaniS
Submission time:2025-09-06 10:18:46 +0300
Language:Java
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED100
Test results
testverdicttime
#1ACCEPTED0.18 sdetails
#2ACCEPTED0.17 sdetails
#3ACCEPTED0.17 sdetails

Code

import java.util.*;

public class vuodet {

	public static void main(String[] args) {

		Scanner input = new Scanner(System.in);

		// int qty = input.nextInt();
        int a = input.nextInt();
        int b = input.nextInt();

		int qty = 0;
		int maxqty = b-a;

		int[] ans = new int[maxqty+1];

		int leet = 1337;
		int test = 0;
		int a1 = 0;
		int pos = 0;
		
		String txta1 = "";
		String rest = "";
		
		char target = '1';

		for (int i = 0; i <= maxqty; i++) {
			
			a1 =  a + i;
			test = (a + i) * leet;

			rest = test + "";
			txta1 = a1+ "";
			
			for (int i2 = 0; i2 < 4; i2++) {
				target = txta1.charAt(i2);

				pos = rest.indexOf(target);
				
				if (pos < 0) {break;}
					
				if (i2 == 3) {
					
					ans[qty] = a + i;
					qty++;
					break;
				}
				
				rest = rest.substring(pos + 1);

			}


		}
		
		


		input.close(); 
		
		
		System.out.println(qty);
		
		for (int i3 = 0; i3 < qty; i3++) {
			System.out.println(ans[i3]);
		}
		
    }
}

Test details

Test 1

Verdict: ACCEPTED

input
1600 2400

correct output
6
1625
2000
2025
2050
...

user output
6
1625
2000
2025
2050
...

Test 2

Verdict: ACCEPTED

input
1773 1773

correct output
0

user output
0

Test 3

Verdict: ACCEPTED

input
2025 2025

correct output
1
2025

user output
1
2025