public int minRounds(int a, int b, int c) {
int ans = 0;
while(b < c) {
++ans;
b += b - a;
}
return ans;
}
int getScore(int len) {
return len * min(len, 26);
}
for(int i = 0; i < len; ++i)
s += (char) ('a' + i % 26);
return s;
}
public String[] findAny
(int K
) { List<Integer> taken = new ArrayList<Integer>();
while(K > 0) {
int n = 1;
while (getScore(n + 1) <= K && n + 1 <= 50)
++n;
K -= getScore(n);
taken.add(n);
}
for(int i = 0; i < taken.size(); ++i)
ans[i] = getString(taken.get(i));
System.
out.
println(ans.
length); return ans;
}
final int mod = 1000 * 1000 * 1000 + 7;
int add(int a, int b) { return (a + b) % mod; }
int subtract(int a, int b) { return (a + mod - b) % mod; }
int multiply(int a, int b) { return (int) ((long) a * b % mod); }
int[][] outside;
int GLOBAL_N;
boolean ok(int i, int j) {
return 0 <= i && i <= j && j < GLOBAL_N;
}
int f_outside(int i, int j) {
return ok(i, j) ? outside[i][j] : 1;
}
int n = s.length();
GLOBAL_N = n;
outside = new int[n][n];
for (int i = 0; i < n; ++i)
for (int j = n - 1; j > i; --j) {
outside[i][j] = add(f_outside(i - 1, j), f_outside(i, j + 1));
if (s.charAt(i) != s.charAt(j))
outside[i][j] = subtract(outside[i][j], f_outside(i - 1, j + 1));
}
int[] ans = new int[n];
for (int i = 0; i < n; ++i)
ans[i] = f_outside(i - 1, i + 1);
write(ans);
int X = 0;
for(int i = 0; i < n; ++i)
X ^= multiply(ans[i], i + 1);
return X;
}
cHVibGljIGludCBtaW5Sb3VuZHMoaW50IGEsIGludCBiLCBpbnQgYykgewoJaW50IGFucyA9IDA7Cgl3aGlsZShiIDwgYykgewoJCSsrYW5zOwoJCWIgKz0gYiAtIGE7Cgl9CglyZXR1cm4gYW5zOwp9CgoKCmludCBnZXRTY29yZShpbnQgbGVuKSB7CglyZXR1cm4gbGVuICogbWluKGxlbiwgMjYpOwp9ClN0cmluZyBnZXRTdHJpbmcoaW50IGxlbikgewoJU3RyaW5nIHMgPSAiIjsKCWZvcihpbnQgaSA9ID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ZlKFN0cmluZyBzKSB7CglpbnQgbiA9IHMubGVuZ3RoKCk7CglHTE9CQUxfTiA9IG47CglvdXRzaWRlID0gbmV3IGludFtuXVtuXTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKQoJCWZvciAoaW50IGogPSBuIC0gMTsgaiA+IGk7IC0taikgewoJCQlvdXRzaWRlW2ldW2pdID0gYWRkKGZfb3V0c2lkZShpIC0gMSwgaiksIGZfb3V0c2lkZShpLCBqICsgMSkpOwoJCQlpZiAocy5jaGFyQXQoaSkgIT0gcy5jaGFyQXQoaikpCgkJCQlvdXRzaWRlW2ldW2pdID0gc3VidHJhY3Qob3V0c2lkZVtpXVtqXSwgZl9vdXRzaWRlKGkgLSAxLCBqICsgMSkpOwoJCX0KCglpbnRbXSBhbnMgPSBuZXcgaW50W25dOwoJZm9yIChpbnQgaSA9IDA7IGkgPCBuOyArK2kpCgkJYW5zW2ldID0gZl9vdXRzaWRlKGkgLSAxLCBpICsgMSk7Cgl3cml0ZShhbnMpOwoJaW50IFggPSAwOwoJZm9yKGludCBpID0gMDsgaSA8IG47ICsraSkKCQlYIF49IG11bHRpcGx5KGFuc1tpXSwgaSArIDEpOwoJcmV0dXJuIFg7Cn0=
Main.java:1: error: class, interface, or enum expected
public int minRounds(int a, int b, int c) {
^
Main.java:3: error: class, interface, or enum expected
while(b < c) {
^
Main.java:5: error: class, interface, or enum expected
b += b - a;
^
Main.java:6: error: class, interface, or enum expected
}
^
Main.java:8: error: class, interface, or enum expected
}
^
Main.java:14: error: class, interface, or enum expected
}
^
Main.java:17: error: class, interface, or enum expected
for(int i = 0; i < len; ++i)
^
Main.java:17: error: class, interface, or enum expected
for(int i = 0; i < len; ++i)
^
Main.java:17: error: class, interface, or enum expected
for(int i = 0; i < len; ++i)
^
Main.java:19: error: class, interface, or enum expected
return s;
^
Main.java:20: error: class, interface, or enum expected
}
^
Main.java:21: error: class, interface, or enum expected
public String[] findAny(int K) {
^
Main.java:23: error: class, interface, or enum expected
while(K > 0) {
^
Main.java:25: error: class, interface, or enum expected
while (getScore(n + 1) <= K && n + 1 <= 50)
^
Main.java:27: error: class, interface, or enum expected
K -= getScore(n);
^
Main.java:28: error: class, interface, or enum expected
taken.add(n);
^
Main.java:29: error: class, interface, or enum expected
}
^
Main.java:31: error: class, interface, or enum expected
for(int i = 0; i < taken.size(); ++i)
^
Main.java:31: error: class, interface, or enum expected
for(int i = 0; i < taken.size(); ++i)
^
Main.java:31: error: class, interface, or enum expected
for(int i = 0; i < taken.size(); ++i)
^
Main.java:33: error: class, interface, or enum expected
System.out.println(ans.length);
^
Main.java:34: error: class, interface, or enum expected
return ans;
^
Main.java:35: error: class, interface, or enum expected
}
^
Main.java:39: error: class, interface, or enum expected
final int mod = 1000 * 1000 * 1000 + 7;
^
Main.java:40: error: class, interface, or enum expected
int add(int a, int b) { return (a + b) % mod; }
^
Main.java:40: error: class, interface, or enum expected
int add(int a, int b) { return (a + b) % mod; }
^
Main.java:41: error: class, interface, or enum expected
int subtract(int a, int b) { return (a + mod - b) % mod; }
^
Main.java:42: error: class, interface, or enum expected
int multiply(int a, int b) { return (int) ((long) a * b % mod); }
^
Main.java:44: error: class, interface, or enum expected
int GLOBAL_N;
^
Main.java:45: error: class, interface, or enum expected
boolean ok(int i, int j) {
^
Main.java:47: error: class, interface, or enum expected
}
^
Main.java:50: error: class, interface, or enum expected
}
^
Main.java:51: error: class, interface, or enum expected
public int solve(String s) {
^
Main.java:53: error: class, interface, or enum expected
GLOBAL_N = n;
^
Main.java:54: error: class, interface, or enum expected
outside = new int[n][n];
^
Main.java:55: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:55: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:55: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:56: error: class, interface, or enum expected
for (int j = n - 1; j > i; --j) {
^
Main.java:56: error: class, interface, or enum expected
for (int j = n - 1; j > i; --j) {
^
Main.java:58: error: class, interface, or enum expected
if (s.charAt(i) != s.charAt(j))
^
Main.java:60: error: class, interface, or enum expected
}
^
Main.java:63: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:63: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:63: error: class, interface, or enum expected
for (int i = 0; i < n; ++i)
^
Main.java:65: error: class, interface, or enum expected
write(ans);
^
Main.java:66: error: class, interface, or enum expected
int X = 0;
^
Main.java:67: error: class, interface, or enum expected
for(int i = 0; i < n; ++i)
^
Main.java:67: error: class, interface, or enum expected
for(int i = 0; i < n; ++i)
^
Main.java:67: error: class, interface, or enum expected
for(int i = 0; i < n; ++i)
^
Main.java:69: error: class, interface, or enum expected
return X;
^
Main.java:70: error: class, interface, or enum expected
}
^
52 errors