QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#294333#4826. Find the Partsucup-team866#0 1ms5824kbC++141.3kb2023-12-30 12:28:522023-12-30 12:28:52

Judging History

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

  • [2023-12-30 12:28:52]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:5824kb
  • [2023-12-30 12:28:52]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef pair <int, int> pii;
int n, m, a[2005][2005], c[256], q, h, w, b[25][25]; char t[233]; pii pos[256][100005];
int main() {
//	freopen ("C.in", "r", stdin);
	scanf ("%s", t);
	if (t[0] == 'm') {
		cin >> n >> m;
		cout << 4 + (n / 10) * m << endl;
		printf ("%02X %02X %02X %02X", n & 255, n >> 8, m & 255, m >> 8);
		for (int i=1; i<=n; i++)
			for (int j=1; j<=m; j++) {
				int _; scanf ("%X ", &_);
				if (i % 10 == 1) printf (" %02X", _);
			}
	} else {
		int _; scanf ("%*d%X%X", &_, &n), (n <<= 8) |= _;
		scanf ("%X%X", &_, &m), (m <<= 8) |= _;
		for (int i=1; i<=n/10; i++)
			for (int j=1; j<=m; j++)
				scanf ("%X", &a[i][j]), pos[a[i][j]][++c[a[i][j]]] = pii (i, j);
		scanf ("%d", &q);
		while (q --) {
			scanf ("%d%d", &h, &w);
			for (int i=1; i<=h; i++)
				for (int j=1; j<=w; j++)
					scanf ("%X", &b[i][j]);
			for (int i=1; i<=10; i++)
				for (int j=1; j<=c[b[i][1]]; j++) {
					int x = pos[b[i][1]][j]. first, y = pos[b[i][1]][j]. second;
					if (x + h - i > n || y + w - 1 > m) continue;
					bool flag = 1;
					for (int k=2; k<=w; k++)
						if (b[i][k] ^ a[x][y+k-1])
							{ flag = 0; break; }
					if (flag) { printf ("%d %d\n", x * 10 - i - 8, y); goto E; }
				} assert (0);
			E : ;
		}
	}
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 5784kb

input:

message
20 24
33 39 73 4A 5A AA E0 86 96 4B 0B 83 A0 FA 82 9B B0 6E DC 03 1C B9 5B 81
86 3E 23 7B C9 38 77 82 7D 62 EA CE A8 DE 85 6C 36 B3 10 EE 85 6A D5 92
14 BD 58 74 20 7B 36 E1 89 B8 6F 4A F4 8F 17 2E 2F 0F 79 DD AA 9F 6F AD
85 21 B6 2F 58 37 87 7B 3F EE D9 7D 9A E6 AA 12 E0 B6 BB 3D 72 BD 34 A...

output:

52
14 00 18 00 33 39 73 4A 5A AA E0 86 96 4B 0B 83 A0 FA 82 9B B0 6E DC 03 1C B9 5B 81 EC C9 BE 91 3B DF 1C DC 61 5C 66 1C B3 26 1C 2E 11 0D 19 BD DC 08 1A 90

input:

parts
52
14 00 18 00 33 39 73 4A 5A AA E0 86 96 4B 0B 83 A0 FA 82 9B B0 6E DC 03 1C B9 5B 81 EC C9 BE 91 3B DF 1C DC 61 5C 66 1C B3 26 1C 2E 11 0D 19 BD DC 08 1A 90
2
10 10
39 73 4A 5A AA E0 86 96 4B 0B
3E 23 7B C9 38 77 82 7D 62 EA
BD 58 74 20 7B 36 E1 89 B8 6F
21 B6 2F 58 37 87 7B 3F EE D9
8A 73 E...

output:

1 2
6 5

result:

ok correct answer

Test #2:

score: 100
Accepted
time: 1ms
memory: 5752kb

input:

message
20 20
85 C4 91 58 77 23 A9 E5 44 8E 28 DC A2 51 13 AE 4E 3C 21 62
37 5A 41 45 8F CA C3 89 01 68 11 72 D8 75 72 ED EE 64 FA B0
05 45 6E F2 FD CE 9A AC 31 CA 88 83 34 D6 23 1F 8C 6D 9E 8C
42 40 7E 18 4C D1 D3 F2 02 20 51 20 14 0F 3D 27 0E 03 73 D7
C0 1F C3 1D D3 55 D9 AF 6E 76 77 28 24 1A 97 E...

output:

44
14 00 14 00 85 C4 91 58 77 23 A9 E5 44 8E 28 DC A2 51 13 AE 4E 3C 21 62 9D 33 62 48 62 6C AB B1 4C C0 11 B6 DE 71 C2 E9 7B C2 3E 00

input:

parts
44
14 00 14 00 85 C4 91 58 77 23 A9 E5 44 8E 28 DC A2 51 13 AE 4E 3C 21 62 9D 33 62 48 62 6C AB B1 4C C0 11 B6 DE 71 C2 E9 7B C2 3E 00
1
10 10
D0 0A D3 6D B9 31 31 76 54 15
CE 14 02 1A A2 8C 77 EB 8E 02
06 44 E4 F4 22 DB 66 F8 7E 38
C6 6A B7 5F E1 A0 0D F0 F5 8A
AC DB B0 FB 26 E6 12 36 37 F1
6...

output:

6 6

result:

ok correct answer

Test #3:

score: 100
Accepted
time: 1ms
memory: 5824kb

input:

message
20 20
12 4F 58 0D 8B AB 72 D1 55 0F FC 74 28 E3 B0 02 9E FA 18 C0
82 72 32 EB 29 EF 9D 70 E6 2D AC 15 37 31 40 A4 36 B6 58 2C
4E C2 4D AC C5 0F D1 A8 B2 2D 43 ED 00 63 7C 3B 3E C5 94 49
92 7D 2C 69 2B 6A 15 95 7C FD 67 E4 AC EE 01 F8 78 5F 46 57
54 7D 03 92 36 85 D0 C0 B1 14 22 70 9D 06 4E C...

output:

44
14 00 14 00 12 4F 58 0D 8B AB 72 D1 55 0F FC 74 28 E3 B0 02 9E FA 18 C0 18 AE 6C 74 6C 58 52 A4 19 00 61 07 33 D1 BE BA 3E 08 11 C9

input:

parts
44
14 00 14 00 12 4F 58 0D 8B AB 72 D1 55 0F FC 74 28 E3 B0 02 9E FA 18 C0 18 AE 6C 74 6C 58 52 A4 19 00 61 07 33 D1 BE BA 3E 08 11 C9
9
10 10
12 4F 58 0D 8B AB 72 D1 55 0F
82 72 32 EB 29 EF 9D 70 E6 2D
4E C2 4D AC C5 0F D1 A8 B2 2D
92 7D 2C 69 2B 6A 15 95 7C FD
54 7D 03 92 36 85 D0 C0 B1 14
A...

output:

1 1
11 11
1 11
11 1
1 1
11 1
1 1
1 11
1 1

result:

ok correct answer

Test #4:

score: 0
Wrong Answer on the first run

input:

message
43 37
EA A3 A3 FC CB 58 F5 40 43 D7 44 FA 09 74 25 84 25 7B 87 E4 98 7A 7F 9D 8D 73 46 AA F4 BF 73 DB EF 46 7D DA B5
7B C6 A2 A3 EF 7C 14 EE 10 1C DE 08 ED E8 2C BD F6 F7 2B 7D 82 B6 0D 0C 06 17 56 84 DD 96 29 77 C0 EE 70 EB 9F
16 A6 27 3A 32 52 AE 0E 31 A7 D2 1D B9 EC D2 20 3D 7D 84 12 4B 5...

output:

152
2B 00 25 00 EA A3 A3 FC CB 58 F5 40 43 D7 44 FA 09 74 25 84 25 7B 87 E4 98 7A 7F 9D 8D 73 46 AA F4 BF 73 DB EF 46 7D DA B5 3D 26 BD 80 99 4B D6 83 9A DC 4D D7 F4 BA DB 0D 2E 55 59 48 33 CC B4 FE 82 A8 B2 F8 D4 34 5B 0D E1 A0 95 ED 1B 3C B1 DC 41 80 49 5B B6 72 E5 FC C1 CF 9E 20 51 01 87 E9 60 A4...

input:


output:


result:

wrong output format Extra information in the output file