Last active
June 14, 2023 10:02
-
-
Save linnykoleh/5b702c4c3b8336054818ed7c97c7acb1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpeedUpTheCodePicture { | |
public static void main(String[] args) { | |
checkPicture(); | |
} | |
static boolean checkPicture() { | |
int n = 4096, count = 0; | |
var image = new byte[n][n]; | |
for (int r = 0; r < n; r++) { | |
for (int c = 0; c < n; c++) { | |
count += (image[r][c] & 0xFF) >>> 7; | |
} | |
} | |
return count < n * n / 2; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment