GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Java/moobuzz.java at master · javaarchive/Java
This repository was archived by the owner on Feb 29, 2024. It is now read-only.
Expand file tree/ Copy pathmoobuzz.javaMore file actions 33 lines (32 loc) · 938 Bytes / Copy pathmoobuzz.javaFile metadata and controls33 lines (32 loc) · 938 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 // Extremely Simple MooBuzz solution // Generates precalc lookup table // Utilizes/"exploits" fact that the moobuzz sequence will repeat! import java.io.*; import java.util.*; public class moobuzz { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new FileReader("moobuzz.in")); PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("moobuzz.out"))); int N = Integer.parseInt(f.readLine()) -1; int[] baseNumberTable = new int[9]; int x = 0; for(int i = 0; i < 9; i ++) { while(true) { x++; if(x % 3 == 0 || x % 5 == 0) { continue; }else { baseNumberTable[i] = x; break; } } } //System.out.println(Arrays.toString(baseNumberTable)); int num = N % 8; int base = baseNumberTable[num]; int offset = 15 * Math.floorDiv(N, 8); pw.println(base + offset); f.close(); pw.close(); } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |