QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#572221 | #9308. World Cup | daring | AC ✓ | 126ms | 56688kb | Java11 | 2.4kb | 2024-09-18 13:06:02 | 2024-09-18 13:06:02 |
Judging History
answer
import java.io.*;
import java.util.*;
public class Main {
private static void solve() {
int []a=new int[33];
int dev=0;
for(int i=0;i<32;i++){
a[i]=sc.nextInt();
if(a[i]<=a[0])
dev++;
}
if(dev==32)
out.println(1);
else if (dev>=28)
out.println(2);
else if(dev>=14)
out.println(4);
else if(dev>=7)
out.println(8);
else if(dev>=3)
out.println(16);
else out.println(32);
}
public static void main(String[] args) {
int T = sc.nextInt();
while (T-- > 0) {
solve();
}
out.flush();
out.close();
}
static Kattio sc = new Kattio();
static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
static class Kattio {
static BufferedReader r;
static StringTokenizer st;
public Kattio() {
r = new BufferedReader(new InputStreamReader(System.in));
}
public String next() {
try {
while (st == null || !st.hasMoreTokens()) {
st = new StringTokenizer(r.readLine());
}
return st.nextToken();
} catch (Exception e) {
return null;
}
}
public int nextInt() {
char[] str = next().toCharArray();
int i = 0;
boolean neg = false;
if (str[0] == '-') {
i = 1;
neg = true;
}
int ans = 0;
for (; i < str.length; i++) ans = ans * 10 + (str[i] - '0');
return neg ? -ans : ans;
}
public long nextLong() {
char[] str = next().toCharArray();
int i = 0;
boolean neg = false;
if (str[0] == '-') {
i = 1;
neg = true;
}
long ans = 0;
for (; i < str.length; i++) ans = ans * 10 + (str[i] - '0');
return neg ? -ans : ans;
}
public double nextDouble() {
return Double.parseDouble(next());
}
}
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 51ms
memory: 48872kb
input:
1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
output:
1
result:
ok 1 number(s): "1"
Test #2:
score: 0
Accepted
time: 49ms
memory: 55816kb
input:
32 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 2 1 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 3 1 2 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 4 1 2 3 5 6 7 8 9 10 11 12 13 14 15 ...
output:
32 32 16 16 16 16 8 8 8 8 8 8 8 4 4 4 4 4 4 4 4 4 4 4 4 4 4 2 2 2 2 1
result:
ok 32 numbers
Test #3:
score: 0
Accepted
time: 126ms
memory: 56688kb
input:
1000 158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202 971407775 628894325 731963982 822804784 450968417 430302156 982631932 161735902 880895728 923078537 707723857 189330739 910286918 802329211 404539679 303238506 317063340 492686568 773361868 125660...
output:
16 4 1 4 1 4 4 2 4 2 4 32 4 2 4 4 8 4 32 1 4 4 2 4 2 16 2 8 4 8 8 1 2 4 8 4 16 4 4 2 4 4 2 16 8 4 2 16 4 8 8 4 4 4 4 16 16 2 1 4 4 8 1 4 4 2 4 8 16 4 4 8 4 32 32 8 8 8 1 4 4 4 4 4 32 8 4 4 8 32 4 4 16 2 8 32 16 8 8 4 1 4 4 16 32 4 4 4 4 4 8 4 4 8 4 4 4 8 16 4 4 8 2 4 4 16 2 8 16 4 4 16 2 32 8 16 4 3...
result:
ok 1000 numbers
Extra Test:
score: 0
Extra Test Passed