QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#574307#9308. World CupstarWA 0ms3664kbC++171.2kb2024-09-18 21:29:372024-09-18 21:29:37

Judging History

你现在查看的是最新测评结果

  • [2024-09-18 21:29:37]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3664kb
  • [2024-09-18 21:29:37]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=100;
int a[N],b[N],c[N];

void slove(){
  for(int i=1;i<=32;i++){
    cin>>a[i];
  }
  int p=a[1];
  int idx=0,tot=0;
  for(int i=1;i<=8;i++){
    for(int j=1;j<=4;j++){
        int k1=(i-1)*4+j;
        sort(a+k1,a+k1+4,greater<int>());
        b[++tot]=a[k1];
        b[++tot]=a[k1+1];
    }
  }
  if(b[1]!=p&&b[2]!=p){
    cout<<32<<'\n';
    return;
  }
  for(int i=1;i<=4;i++){
    int k=(i-1)*4;
    c[++idx]=max(b[k+1],b[k+4]);
    c[++idx]=max(b[k+2],b[k+3]);
  }
  if(c[1]!=p&&c[2]!=p){
    cout<<16<<'\n';
    return;
  }
  tot=0;
  for(int i=1;i<=4;i++){
    int k=(i-1)*4;
    b[++tot]=max(c[i*2-1],c[i*2]);
  }
  if(b[1]!=p){
     cout<<8<<'\n';
    return;
  }
  idx=0;
  for(int i=1;i<=2;i++){
    c[++idx]=max(b[i*2-1],b[i*2]);
  }
   if(c[1]!=p){
     cout<<4<<'\n';
    return;
  }
  int x=max(c[1],c[2]);
  if(x==c[1]){
    cout<<1<<'\n';
    return;
  }
  else{
    cout<<2<<'\n';
    return;
  }
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        slove();
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3664kb

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: -100
Wrong Answer
time: 0ms
memory: 3632kb

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
8
4
4
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

result:

wrong answer 4th numbers differ - expected: '16', found: '8'