QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#234839#6652. 着色stcmuyi#AC ✓7ms3740kbC++20385b2023-11-01 23:36:532023-11-01 23:36:53

Judging History

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

  • [2023-11-01 23:36:53]
  • 评测
  • 测评结果:AC
  • 用时:7ms
  • 内存:3740kb
  • [2023-11-01 23:36:53]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int n;
int lowbit(int x) {
	return x & (-x);
}
int tz[1024];
int main() {
	cin >> n;
	for(int j = 0; j < 10; j++) {
		tz[(1 << j)] = j;
	}
	for(int i = 1; i < n; i++) {
		for(int j = i + 1; j <= n; j++) {
			cout << (char)('0' + tz[lowbit(i ^ j)]);
		}
		cout << endl;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2

output:

0

result:

ok Accepted.

Test #2:

score: 0
Accepted
time: 7ms
memory: 3740kb

input:

1000

output:

010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201030102010401020103010201070102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010301020104010201030102010801020103010201040102010301020105010201030102...

result:

ok Accepted.

Test #3:

score: 0
Accepted
time: 7ms
memory: 3720kb

input:

988

output:

010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201030102010401020103010201070102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010301020104010201030102010801020103010201040102010301020105010201030102...

result:

ok Accepted.

Test #4:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

104

output:

0102010301020104010201030102010501020103010201040102010301020106010201030102010401020103010201050102010
010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020105010201
010201030102010401020103010201050102010301020104010201030102010601020103010201040102010301020...

result:

ok Accepted.

Test #5:

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

input:

7

output:

010201
01020
0102
010
01
0

result:

ok Accepted.

Test #6:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

59

output:

0102010301020104010201030102010501020103010201040102010301
010201030102010401020103010201050102010301020104010201030
01020103010201040102010301020105010201030102010401020103
0102010301020104010201030102010501020103010201040102010
010201030102010401020103010201050102010301020104010201
010201030102010...

result:

ok Accepted.