Tue, 29 Jan 2019 16:14:04 +0800
parent
b9c960a337
commit
1af8954e8a
@ -1,414 +0,0 @@
|
||||
.file "B.cpp"
|
||||
.intel_syntax noprefix
|
||||
.text
|
||||
.section .rodata
|
||||
.type _ZStL19piecewise_construct, @object
|
||||
.size _ZStL19piecewise_construct, 1
|
||||
_ZStL19piecewise_construct:
|
||||
.zero 1
|
||||
.type _ZStL13allocator_arg, @object
|
||||
.size _ZStL13allocator_arg, 1
|
||||
_ZStL13allocator_arg:
|
||||
.zero 1
|
||||
.type _ZStL6ignore, @object
|
||||
.size _ZStL6ignore, 1
|
||||
_ZStL6ignore:
|
||||
.zero 1
|
||||
.local _ZStL8__ioinit
|
||||
.comm _ZStL8__ioinit,1,1
|
||||
.align 4
|
||||
.type _ZN9__gnu_cxxL21__default_lock_policyE, @object
|
||||
.size _ZN9__gnu_cxxL21__default_lock_policyE, 4
|
||||
_ZN9__gnu_cxxL21__default_lock_policyE:
|
||||
.long 2
|
||||
.type _ZStL10defer_lock, @object
|
||||
.size _ZStL10defer_lock, 1
|
||||
_ZStL10defer_lock:
|
||||
.zero 1
|
||||
.type _ZStL11try_to_lock, @object
|
||||
.size _ZStL11try_to_lock, 1
|
||||
_ZStL11try_to_lock:
|
||||
.zero 1
|
||||
.type _ZStL10adopt_lock, @object
|
||||
.size _ZStL10adopt_lock, 1
|
||||
_ZStL10adopt_lock:
|
||||
.zero 1
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL5icaseE, @object
|
||||
.size _ZNSt15regex_constantsL5icaseE, 4
|
||||
_ZNSt15regex_constantsL5icaseE:
|
||||
.long 1
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL6nosubsE, @object
|
||||
.size _ZNSt15regex_constantsL6nosubsE, 4
|
||||
_ZNSt15regex_constantsL6nosubsE:
|
||||
.long 2
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL8optimizeE, @object
|
||||
.size _ZNSt15regex_constantsL8optimizeE, 4
|
||||
_ZNSt15regex_constantsL8optimizeE:
|
||||
.long 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL7collateE, @object
|
||||
.size _ZNSt15regex_constantsL7collateE, 4
|
||||
_ZNSt15regex_constantsL7collateE:
|
||||
.long 8
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL10ECMAScriptE, @object
|
||||
.size _ZNSt15regex_constantsL10ECMAScriptE, 4
|
||||
_ZNSt15regex_constantsL10ECMAScriptE:
|
||||
.long 16
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL5basicE, @object
|
||||
.size _ZNSt15regex_constantsL5basicE, 4
|
||||
_ZNSt15regex_constantsL5basicE:
|
||||
.long 32
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL8extendedE, @object
|
||||
.size _ZNSt15regex_constantsL8extendedE, 4
|
||||
_ZNSt15regex_constantsL8extendedE:
|
||||
.long 64
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL3awkE, @object
|
||||
.size _ZNSt15regex_constantsL3awkE, 4
|
||||
_ZNSt15regex_constantsL3awkE:
|
||||
.long 128
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL4grepE, @object
|
||||
.size _ZNSt15regex_constantsL4grepE, 4
|
||||
_ZNSt15regex_constantsL4grepE:
|
||||
.long 256
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL5egrepE, @object
|
||||
.size _ZNSt15regex_constantsL5egrepE, 4
|
||||
_ZNSt15regex_constantsL5egrepE:
|
||||
.long 512
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL12__polynomialE, @object
|
||||
.size _ZNSt15regex_constantsL12__polynomialE, 4
|
||||
_ZNSt15regex_constantsL12__polynomialE:
|
||||
.long 1024
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13match_defaultE, @object
|
||||
.size _ZNSt15regex_constantsL13match_defaultE, 4
|
||||
_ZNSt15regex_constantsL13match_defaultE:
|
||||
.zero 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13match_not_bolE, @object
|
||||
.size _ZNSt15regex_constantsL13match_not_bolE, 4
|
||||
_ZNSt15regex_constantsL13match_not_bolE:
|
||||
.long 1
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13match_not_eolE, @object
|
||||
.size _ZNSt15regex_constantsL13match_not_eolE, 4
|
||||
_ZNSt15regex_constantsL13match_not_eolE:
|
||||
.long 2
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13match_not_bowE, @object
|
||||
.size _ZNSt15regex_constantsL13match_not_bowE, 4
|
||||
_ZNSt15regex_constantsL13match_not_bowE:
|
||||
.long 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13match_not_eowE, @object
|
||||
.size _ZNSt15regex_constantsL13match_not_eowE, 4
|
||||
_ZNSt15regex_constantsL13match_not_eowE:
|
||||
.long 8
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL9match_anyE, @object
|
||||
.size _ZNSt15regex_constantsL9match_anyE, 4
|
||||
_ZNSt15regex_constantsL9match_anyE:
|
||||
.long 16
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL14match_not_nullE, @object
|
||||
.size _ZNSt15regex_constantsL14match_not_nullE, 4
|
||||
_ZNSt15regex_constantsL14match_not_nullE:
|
||||
.long 32
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL16match_continuousE, @object
|
||||
.size _ZNSt15regex_constantsL16match_continuousE, 4
|
||||
_ZNSt15regex_constantsL16match_continuousE:
|
||||
.long 64
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL16match_prev_availE, @object
|
||||
.size _ZNSt15regex_constantsL16match_prev_availE, 4
|
||||
_ZNSt15regex_constantsL16match_prev_availE:
|
||||
.long 128
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL14format_defaultE, @object
|
||||
.size _ZNSt15regex_constantsL14format_defaultE, 4
|
||||
_ZNSt15regex_constantsL14format_defaultE:
|
||||
.zero 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL10format_sedE, @object
|
||||
.size _ZNSt15regex_constantsL10format_sedE, 4
|
||||
_ZNSt15regex_constantsL10format_sedE:
|
||||
.long 256
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL14format_no_copyE, @object
|
||||
.size _ZNSt15regex_constantsL14format_no_copyE, 4
|
||||
_ZNSt15regex_constantsL14format_no_copyE:
|
||||
.long 512
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL17format_first_onlyE, @object
|
||||
.size _ZNSt15regex_constantsL17format_first_onlyE, 4
|
||||
_ZNSt15regex_constantsL17format_first_onlyE:
|
||||
.long 1024
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13error_collateE, @object
|
||||
.size _ZNSt15regex_constantsL13error_collateE, 4
|
||||
_ZNSt15regex_constantsL13error_collateE:
|
||||
.zero 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_ctypeE, @object
|
||||
.size _ZNSt15regex_constantsL11error_ctypeE, 4
|
||||
_ZNSt15regex_constantsL11error_ctypeE:
|
||||
.long 1
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL12error_escapeE, @object
|
||||
.size _ZNSt15regex_constantsL12error_escapeE, 4
|
||||
_ZNSt15regex_constantsL12error_escapeE:
|
||||
.long 2
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL13error_backrefE, @object
|
||||
.size _ZNSt15regex_constantsL13error_backrefE, 4
|
||||
_ZNSt15regex_constantsL13error_backrefE:
|
||||
.long 3
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_brackE, @object
|
||||
.size _ZNSt15regex_constantsL11error_brackE, 4
|
||||
_ZNSt15regex_constantsL11error_brackE:
|
||||
.long 4
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_parenE, @object
|
||||
.size _ZNSt15regex_constantsL11error_parenE, 4
|
||||
_ZNSt15regex_constantsL11error_parenE:
|
||||
.long 5
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_braceE, @object
|
||||
.size _ZNSt15regex_constantsL11error_braceE, 4
|
||||
_ZNSt15regex_constantsL11error_braceE:
|
||||
.long 6
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL14error_badbraceE, @object
|
||||
.size _ZNSt15regex_constantsL14error_badbraceE, 4
|
||||
_ZNSt15regex_constantsL14error_badbraceE:
|
||||
.long 7
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_rangeE, @object
|
||||
.size _ZNSt15regex_constantsL11error_rangeE, 4
|
||||
_ZNSt15regex_constantsL11error_rangeE:
|
||||
.long 8
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_spaceE, @object
|
||||
.size _ZNSt15regex_constantsL11error_spaceE, 4
|
||||
_ZNSt15regex_constantsL11error_spaceE:
|
||||
.long 9
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL15error_badrepeatE, @object
|
||||
.size _ZNSt15regex_constantsL15error_badrepeatE, 4
|
||||
_ZNSt15regex_constantsL15error_badrepeatE:
|
||||
.long 10
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL16error_complexityE, @object
|
||||
.size _ZNSt15regex_constantsL16error_complexityE, 4
|
||||
_ZNSt15regex_constantsL16error_complexityE:
|
||||
.long 11
|
||||
.align 4
|
||||
.type _ZNSt15regex_constantsL11error_stackE, @object
|
||||
.size _ZNSt15regex_constantsL11error_stackE, 4
|
||||
_ZNSt15regex_constantsL11error_stackE:
|
||||
.long 12
|
||||
.align 8
|
||||
.type _ZNSt8__detailL19_S_invalid_state_idE, @object
|
||||
.size _ZNSt8__detailL19_S_invalid_state_idE, 8
|
||||
_ZNSt8__detailL19_S_invalid_state_idE:
|
||||
.quad -1
|
||||
.align 4
|
||||
.type _ZL1N, @object
|
||||
.size _ZL1N, 4
|
||||
_ZL1N:
|
||||
.long 200050
|
||||
.section .text._ZNK1v4timeEv,"axG",@progbits,_ZNK1v4timeEv,comdat
|
||||
.align 2
|
||||
.weak _ZNK1v4timeEv
|
||||
.type _ZNK1v4timeEv, @function
|
||||
_ZNK1v4timeEv:
|
||||
.LFB8241:
|
||||
.cfi_startproc
|
||||
push rbp
|
||||
.cfi_def_cfa_offset 16
|
||||
.cfi_offset 6, -16
|
||||
mov rbp, rsp
|
||||
.cfi_def_cfa_register 6
|
||||
mov QWORD PTR -8[rbp], rdi
|
||||
mov rax, QWORD PTR -8[rbp]
|
||||
mov edx, DWORD PTR 4[rax]
|
||||
mov rax, QWORD PTR -8[rbp]
|
||||
mov eax, DWORD PTR [rax]
|
||||
sub edx, eax
|
||||
mov eax, edx
|
||||
add eax, 1
|
||||
pop rbp
|
||||
.cfi_def_cfa 7, 8
|
||||
ret
|
||||
.cfi_endproc
|
||||
.LFE8241:
|
||||
.size _ZNK1v4timeEv, .-_ZNK1v4timeEv
|
||||
.globl a
|
||||
.bss
|
||||
.align 32
|
||||
.type a, @object
|
||||
.size a, 2400600
|
||||
a:
|
||||
.zero 2400600
|
||||
.section .rodata
|
||||
.LC0:
|
||||
.string "%d%d"
|
||||
.LC1:
|
||||
.string "%d%d%d"
|
||||
.LC2:
|
||||
.string "%d"
|
||||
.text
|
||||
.globl main
|
||||
.type main, @function
|
||||
main:
|
||||
.LFB8242:
|
||||
.cfi_startproc
|
||||
push rbp
|
||||
.cfi_def_cfa_offset 16
|
||||
.cfi_offset 6, -16
|
||||
mov rbp, rsp
|
||||
.cfi_def_cfa_register 6
|
||||
sub rsp, 32
|
||||
mov rax, QWORD PTR fs:40
|
||||
mov QWORD PTR -8[rbp], rax
|
||||
xor eax, eax
|
||||
lea rdi, a[rip]
|
||||
call _ZNK1v4timeEv
|
||||
mov DWORD PTR -16[rbp], eax
|
||||
lea rdx, -28[rbp]
|
||||
lea rax, -32[rbp]
|
||||
mov rsi, rax
|
||||
lea rdi, .LC0[rip]
|
||||
mov eax, 0
|
||||
call scanf@PLT
|
||||
mov DWORD PTR -24[rbp], 0
|
||||
.L5:
|
||||
mov eax, DWORD PTR -32[rbp]
|
||||
cmp DWORD PTR -24[rbp], eax
|
||||
jge .L4
|
||||
mov eax, DWORD PTR -24[rbp]
|
||||
movsx rdx, eax
|
||||
mov rax, rdx
|
||||
add rax, rax
|
||||
add rax, rdx
|
||||
sal rax, 2
|
||||
lea rdx, a[rip]
|
||||
add rax, rdx
|
||||
lea rcx, 8[rax]
|
||||
mov eax, DWORD PTR -24[rbp]
|
||||
movsx rdx, eax
|
||||
mov rax, rdx
|
||||
add rax, rax
|
||||
add rax, rdx
|
||||
sal rax, 2
|
||||
lea rdx, a[rip]
|
||||
add rax, rdx
|
||||
lea rsi, 4[rax]
|
||||
mov eax, DWORD PTR -24[rbp]
|
||||
movsx rdx, eax
|
||||
mov rax, rdx
|
||||
add rax, rax
|
||||
add rax, rdx
|
||||
sal rax, 2
|
||||
lea rdx, a[rip]
|
||||
add rax, rdx
|
||||
mov rdx, rsi
|
||||
mov rsi, rax
|
||||
lea rdi, .LC1[rip]
|
||||
mov eax, 0
|
||||
call scanf@PLT
|
||||
add DWORD PTR -24[rbp], 1
|
||||
jmp .L5
|
||||
.L4:
|
||||
mov DWORD PTR -12[rbp], -1
|
||||
mov DWORD PTR -20[rbp], 0
|
||||
.L7:
|
||||
mov eax, DWORD PTR -32[rbp]
|
||||
cmp DWORD PTR -20[rbp], eax
|
||||
jge .L6
|
||||
add DWORD PTR -20[rbp], 1
|
||||
jmp .L7
|
||||
.L6:
|
||||
mov eax, DWORD PTR -12[rbp]
|
||||
mov esi, eax
|
||||
lea rdi, .LC2[rip]
|
||||
mov eax, 0
|
||||
call printf@PLT
|
||||
mov eax, 0
|
||||
mov rcx, QWORD PTR -8[rbp]
|
||||
xor rcx, QWORD PTR fs:40
|
||||
je .L9
|
||||
call __stack_chk_fail@PLT
|
||||
.L9:
|
||||
leave
|
||||
.cfi_def_cfa 7, 8
|
||||
ret
|
||||
.cfi_endproc
|
||||
.LFE8242:
|
||||
.size main, .-main
|
||||
.type _Z41__static_initialization_and_destruction_0ii, @function
|
||||
_Z41__static_initialization_and_destruction_0ii:
|
||||
.LFB9545:
|
||||
.cfi_startproc
|
||||
push rbp
|
||||
.cfi_def_cfa_offset 16
|
||||
.cfi_offset 6, -16
|
||||
mov rbp, rsp
|
||||
.cfi_def_cfa_register 6
|
||||
sub rsp, 16
|
||||
mov DWORD PTR -4[rbp], edi
|
||||
mov DWORD PTR -8[rbp], esi
|
||||
cmp DWORD PTR -4[rbp], 1
|
||||
jne .L12
|
||||
cmp DWORD PTR -8[rbp], 65535
|
||||
jne .L12
|
||||
lea rdi, _ZStL8__ioinit[rip]
|
||||
call _ZNSt8ios_base4InitC1Ev@PLT
|
||||
lea rdx, __dso_handle[rip]
|
||||
lea rsi, _ZStL8__ioinit[rip]
|
||||
mov rax, QWORD PTR _ZNSt8ios_base4InitD1Ev@GOTPCREL[rip]
|
||||
mov rdi, rax
|
||||
call __cxa_atexit@PLT
|
||||
.L12:
|
||||
nop
|
||||
leave
|
||||
.cfi_def_cfa 7, 8
|
||||
ret
|
||||
.cfi_endproc
|
||||
.LFE9545:
|
||||
.size _Z41__static_initialization_and_destruction_0ii, .-_Z41__static_initialization_and_destruction_0ii
|
||||
.type _GLOBAL__sub_I_a, @function
|
||||
_GLOBAL__sub_I_a:
|
||||
.LFB9568:
|
||||
.cfi_startproc
|
||||
push rbp
|
||||
.cfi_def_cfa_offset 16
|
||||
.cfi_offset 6, -16
|
||||
mov rbp, rsp
|
||||
.cfi_def_cfa_register 6
|
||||
mov esi, 65535
|
||||
mov edi, 1
|
||||
call _Z41__static_initialization_and_destruction_0ii
|
||||
pop rbp
|
||||
.cfi_def_cfa 7, 8
|
||||
ret
|
||||
.cfi_endproc
|
||||
.LFE9568:
|
||||
.size _GLOBAL__sub_I_a, .-_GLOBAL__sub_I_a
|
||||
.section .init_array,"aw"
|
||||
.align 8
|
||||
.quad _GLOBAL__sub_I_a
|
||||
.hidden __dso_handle
|
||||
.ident "GCC: (Ubuntu 8.2.0-7ubuntu1) 8.2.0"
|
||||
.section .note.GNU-stack,"",@progbits
|
||||
@ -1,23 +1,46 @@
|
||||
#define _SILENCE_CXX17_C_HEADER_DEPRECATION_WARNING
|
||||
#include <bits/stdc++.h>
|
||||
using namespace std;
|
||||
const int N = 2e5 + 50;
|
||||
#define f first
|
||||
#define s second
|
||||
pair<int, int> comp[N], sock[N];
|
||||
multimap<int, int> comps;
|
||||
pair<int, int> sock[N];
|
||||
//#define nxt(x) (((~(decltype(x))0) << 1 & x) << 1)
|
||||
#define nxt(x) ((x | 1) << 1)
|
||||
//#define nxt(x) ((x | 1) << 1)
|
||||
#define nxt(x) ((x + 1) >> 1)
|
||||
int a[N], b[N], c, u;
|
||||
int main()
|
||||
{
|
||||
for (int i = 0; i < 20; i++)
|
||||
printf("%d %d\n", i, nxt(i));
|
||||
int n, m;
|
||||
scanf("%d%d", &n, &m);
|
||||
for (int i = 0; i < n; i++)
|
||||
scanf("%d", &comp[i].f), comp[i].s = i;
|
||||
for (int i = 0; i < m; i++)
|
||||
for (int i = 1, x; i <= n; i++)
|
||||
scanf("%d", &x), comps.insert(make_pair(x, i));
|
||||
for (int i = 1; i <= m; i++)
|
||||
scanf("%d", &sock[i].f), sock[i].s = i;
|
||||
sort(comp, comp + n);
|
||||
sort(sock, sock + m);
|
||||
|
||||
sort(sock + 1, sock + m + 1);
|
||||
for (int i = 1; i <= m && comps.size(); i++)
|
||||
{
|
||||
int x = sock[i].f;
|
||||
int y = comps.begin()->first;
|
||||
for (int cnt = 0; x >= y; x = nxt(x), cnt++)
|
||||
{
|
||||
auto ite = comps.find(x);
|
||||
if (ite != comps.end())
|
||||
{
|
||||
a[sock[i].s] = cnt;
|
||||
b[ite->second] = sock[i].s;
|
||||
c++, u += cnt;
|
||||
comps.erase(ite);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%d %d\n", c, u);
|
||||
for (int i = 1; i <= m; i++)
|
||||
printf("%d ", a[i]);
|
||||
putchar('\n');
|
||||
for (int i = 1; i <= n; i++)
|
||||
printf("%d ", b[i]);
|
||||
return 0;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_FLAGS "/Zc:__cplusplus")
|
||||
include_directories("D:\\PortableApps\\MSYS2\\mingw64\\include\\c++\\8.2.1\\x86_64-w64-mingw32")
|
||||
add_executable("A" "A.cpp")
|
||||
add_executable("B" "B.cpp")
|
||||
add_executable("C" "C.cpp")
|
||||
Loading…
Reference in new issue