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 boolean isPermutation(String str1, String str2) { | |
| if (str1.length() != str2.length()) | |
| return false; | |
| int[] charMap = new int[256]; | |
| for (char c : str1.toCharArray()) { | |
| charMap[c]++; | |
| } | |
| for (char c: str2.toCharArray()) { | |
| charMap[c]--; |
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
| boolean dfs(int xor, int depth) { | |
| //1. 再帰を抜ける条件 | |
| if (depth == N) { | |
| return xor == 0; | |
| } | |
| //2. 全探索できるように再帰する | |
| for (int i = 0; i < K; i++) { | |
| if (dfs(xor ^ questions[depth][i], depth + 1)) | |
| return true; |
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
| //ある点から左上の点(1, 1)までの範囲の美味しさの合計を算出 | |
| void sumTastesOfScuareCreatedByOrigin() { | |
| for (int i = 1; i <= N; i++) { | |
| for (int j = 1; j <= N; j++) { | |
| board[i][j] += board[i-1][j] + board[i][j-1] - board[i-1][j-1]; | |
| } | |
| } | |
| } |
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
| import java.util.Scanner; | |
| public class Main { | |
| public static void main(String[] args) { | |
| GoodTakoyaki gt = new GoodTakoyaki(); | |
| gt.run(); | |
| } | |
| } | |
| class GoodTakoyaki { | |
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
| class ArrayCreater { | |
| int[] arr; | |
| int N; | |
| int k; | |
| public ArrayCreater() { | |
| Scanner scan = new Scanner(System.in); | |
| this.N = Integer.parseInt(scan.next()); |
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
| keitakeitakeitasnasnsa;ksjna;eksjn;ak |
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
| keitakeitakeita |
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
| aaaaaa |
NewerOlder