QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#283059#6652. 着色one_god_and_two_dogs#WA 19ms7736kbC++14821b2023-12-13 18:46:482023-12-13 18:46:49

Judging History

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

  • [2023-12-13 18:46:49]
  • 评测
  • 测评结果:WA
  • 用时:19ms
  • 内存:7736kb
  • [2023-12-13 18:46:48]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int M=1005;
int op[M];
int res[M][M],ans[15][15];
void solve(int l,int r){
    if(r-l+1<=5){
        for(int i=l;i<r;i++){
            for(int j=i+1;j<=r;j++)res[i][j]=ans[i-l][j-l];
        }
        return ;
    }
    int mid=l+r>>1;
    solve(l,mid),solve(mid+1,r);
    int O=0;
    for(int i=mid+1;i<=r;i++){
        int op=0;
        for(int j=l;j<=mid;j++){
            while(O==op)op=(op+1)%5;
            res[j][i]=ans[O][op];
            op=(op+1)%5;
        }
    }
}
int main() {
    int cnt=0;
    for(int i=0;i<=4;i++)for(int j=i+1;j<=4;j++)ans[i][j]=ans[j][i]=cnt++;
    int n;cin>>n;
    solve(1,n);
    for(int i=1;i<=n;i++){
        for(int j=i+1;j<=n;j++)printf("%d",res[i][j]);
        puts("");
    }
    return 0;
}

详细

Test #1:

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

input:

2

output:

0


result:

ok Accepted.

Test #2:

score: -100
Wrong Answer
time: 19ms
memory: 7736kb

input:

1000

output:

012000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

FAIL There is a 3-cycle with the same color.