git reimport
This commit is contained in:
47
archive/2018.10/2018.10.15 - SNCKQL19/CHEFPRMS.java
Normal file
47
archive/2018.10/2018.10.15 - SNCKQL19/CHEFPRMS.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package chelper;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import misc.SimpleSavingChelperSolution;
|
||||
import misc.Stuff;
|
||||
|
||||
|
||||
public class CHEFPRMS extends SimpleSavingChelperSolution {
|
||||
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
wrapSolve(testNumber, in, out);
|
||||
}
|
||||
|
||||
|
||||
List<Integer> primes = Stuff.generatePrimes(1000);
|
||||
Set<Integer> semiprimes = new HashSet<>();
|
||||
Set<Integer> sums = new HashSet<>();
|
||||
|
||||
{
|
||||
for (int i = 0; i < primes.size(); i++) {
|
||||
for (int j = i + 1; j < primes.size(); j++) {
|
||||
int sp = primes.get(i) * primes.get(j);
|
||||
if (sp < 1000) {
|
||||
semiprimes.add(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i : semiprimes) {
|
||||
for (int j : semiprimes) {
|
||||
sums.add(i + j);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
int n = in.nextInt();
|
||||
|
||||
out.println(sums.contains(n) ? "YES" : "NO");
|
||||
}
|
||||
}
|
34
archive/2018.10/2018.10.15 - SNCKQL19/CHEFPRMS.json
Normal file
34
archive/2018.10/2018.10.15 - SNCKQL19/CHEFPRMS.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name" : "CHEFPRMS",
|
||||
"testType" : "MULTI_NUMBER",
|
||||
"input" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "input.txt"
|
||||
},
|
||||
"output" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "output.txt"
|
||||
},
|
||||
"tests" : [ {
|
||||
"input" : "3\n30\n45\n62",
|
||||
"output" : "YES\nYES\nNO",
|
||||
"index" : 0,
|
||||
"active" : true
|
||||
} ],
|
||||
"location" : "src/chelper",
|
||||
"vmArgs" : "-Xmx256m -Xss64m",
|
||||
"mainClass" : "Main",
|
||||
"taskClass" : "chelper.CHEFPRMS",
|
||||
"checkerClass" : "net.egork.chelper.checkers.TokenChecker",
|
||||
"checkerParameters" : "",
|
||||
"testClasses" : [ ],
|
||||
"date" : "2018.10.15",
|
||||
"contestName" : "SNCKQL19",
|
||||
"truncate" : true,
|
||||
"inputClass" : "io.InputReader",
|
||||
"outputClass" : "io.OutputWriter",
|
||||
"includeLocale" : false,
|
||||
"failOnOverflow" : false,
|
||||
"interactive" : false,
|
||||
"interactor" : "net.egork.chelper.tester.Interactor"
|
||||
}
|
25
archive/2018.10/2018.10.15 - SNCKQL19/HS08TEST.java
Normal file
25
archive/2018.10/2018.10.15 - SNCKQL19/HS08TEST.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package chelper;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import misc.SimpleSavingChelperSolution;
|
||||
|
||||
|
||||
public class HS08TEST extends SimpleSavingChelperSolution {
|
||||
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
wrapSolve(testNumber, in, out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
int x = in.nextInt();
|
||||
double y = in.nextDouble();
|
||||
|
||||
if (x + 0.5 > y || x % 5 != 0) {
|
||||
out.println(y);
|
||||
} else {
|
||||
out.println(y - x - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
44
archive/2018.10/2018.10.15 - SNCKQL19/HS08TEST.json
Normal file
44
archive/2018.10/2018.10.15 - SNCKQL19/HS08TEST.json
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name" : "HS08TEST",
|
||||
"testType" : "SINGLE",
|
||||
"input" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "input.txt"
|
||||
},
|
||||
"output" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "output.txt"
|
||||
},
|
||||
"tests" : [ {
|
||||
"input" : "30 120.00",
|
||||
"output" : "89.50",
|
||||
"index" : 0,
|
||||
"active" : true
|
||||
}, {
|
||||
"input" : "42 120.00",
|
||||
"output" : "120.00",
|
||||
"index" : 1,
|
||||
"active" : true
|
||||
}, {
|
||||
"input" : "300 120.00",
|
||||
"output" : "120.00",
|
||||
"index" : 2,
|
||||
"active" : true
|
||||
} ],
|
||||
"location" : "src/chelper",
|
||||
"vmArgs" : "-Xmx256m -Xss64m",
|
||||
"mainClass" : "Main",
|
||||
"taskClass" : "chelper.HS08TEST",
|
||||
"checkerClass" : "net.egork.chelper.checkers.TokenChecker",
|
||||
"checkerParameters" : "",
|
||||
"testClasses" : [ ],
|
||||
"date" : "2018.10.15",
|
||||
"contestName" : "SNCKQL19",
|
||||
"truncate" : true,
|
||||
"inputClass" : "io.InputReader",
|
||||
"outputClass" : "io.OutputWriter",
|
||||
"includeLocale" : false,
|
||||
"failOnOverflow" : false,
|
||||
"interactive" : false,
|
||||
"interactor" : "net.egork.chelper.tester.Interactor"
|
||||
}
|
42
archive/2018.10/2018.10.15 - SNCKQL19/TaskA.java
Normal file
42
archive/2018.10/2018.10.15 - SNCKQL19/TaskA.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package chelper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
|
||||
import io.InputReader;
|
||||
import io.OutputWriter;
|
||||
import misc.SimpleSavingChelperSolution;
|
||||
|
||||
|
||||
public class TaskA extends SimpleSavingChelperSolution {
|
||||
|
||||
public void solve(int testNumber, InputReader in, OutputWriter out) {
|
||||
wrapSolve(testNumber, in, out);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void solve(int testNumber) {
|
||||
int n = in.nextInt();
|
||||
int k = in.nextInt();
|
||||
|
||||
List<Integer> teams = new ArrayList<>();
|
||||
for (int i = 0; i < n; i++) {
|
||||
teams.add(in.nextInt());
|
||||
}
|
||||
|
||||
teams.sort((o1, o2) -> -Integer.compare(o1, o2));
|
||||
|
||||
int res = 0;
|
||||
int cutoff = teams.get(k - 1);
|
||||
|
||||
for (Integer team : teams) {
|
||||
if (team >= cutoff) {
|
||||
res++;
|
||||
}
|
||||
}
|
||||
|
||||
out.println(res);
|
||||
}
|
||||
}
|
34
archive/2018.10/2018.10.15 - SNCKQL19/TaskA.json
Normal file
34
archive/2018.10/2018.10.15 - SNCKQL19/TaskA.json
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name" : "TaskA",
|
||||
"testType" : "MULTI_NUMBER",
|
||||
"input" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "input.txt"
|
||||
},
|
||||
"output" : {
|
||||
"type" : "STANDARD",
|
||||
"fileName" : "output.txt"
|
||||
},
|
||||
"tests" : [ {
|
||||
"input" : "2\n5 1\n3 5 2 4 5\n6 4\n6 5 4 3 2 1",
|
||||
"output" : "2\n4",
|
||||
"index" : 0,
|
||||
"active" : true
|
||||
} ],
|
||||
"location" : "src/chelper",
|
||||
"vmArgs" : "-Xmx256m -Xss64m",
|
||||
"mainClass" : "Main",
|
||||
"taskClass" : "chelper.TaskA",
|
||||
"checkerClass" : "net.egork.chelper.checkers.TokenChecker",
|
||||
"checkerParameters" : "",
|
||||
"testClasses" : [ ],
|
||||
"date" : "2018.10.15",
|
||||
"contestName" : "SNCKQL19",
|
||||
"truncate" : true,
|
||||
"inputClass" : "io.InputReader",
|
||||
"outputClass" : "io.OutputWriter",
|
||||
"includeLocale" : false,
|
||||
"failOnOverflow" : false,
|
||||
"interactive" : false,
|
||||
"interactor" : "net.egork.chelper.tester.Interactor"
|
||||
}
|
Reference in New Issue
Block a user