算法与数据结构多选难度 3真题改编 · 2024
2. 在一个城市中,每个交叉路口之间有一段道路连接,每条道路有不同的行驶距离,可以用带权连通无向图 $G=(V,E)$ 表示道路网络,其中 $V=\{u,v,w,x,y,z\}$ , $E=\{(u,v)7,(u,w)3,(v,x)9,(v,y)6,(w,x)1,(x,y)4,(y,z)8,(z,u)16\}$ (注:顶点偶对括号外的数据表示边上的权值),从源点 $u$ 到顶点 $z$ 的最短路径上经过的顶点序列是()。
练习本题 ›
编程语言多选难度 3真题改编 · 2024
16. 在 C++11 中,以下注释处哪几行代是码合法的()
#include <iostream>
#include <unordered_map>
#include <map>
typedef long long ll;
using namespace std;
int main() {
unordered_map<ll, pair<ll, ll>> un;
un.insert(1, 2, 3); // 1
un.insert(make_pair(1, std::make_pair(2, 3))); // 2
un.emplace(1, 2, 3); // 3
un.emplace(1, make_pair(2, 3)); // 4
return 0;
}
练习本题 ›
综合知识iOS单选难度 3真题改编 · 2024
48. 当下面TestView视图以宽200高200正常显示后,下面描述正确的是()
class TestView: UIView {
lazy var controlView: UIControl = {
let v = UIControl(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
v.addTarget(self, action: #selector(clickView(view:)), for: UIControl.Event.touchUpInside)
return v
}()
override init(frame: CGRect){
super.init(frame: frame)
self.addSubview(controlView)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc func clickView(view: UIControl){
print("i am control")
}
public override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? {
let stationPoint = self.controlView.convert(point, from: self)
if !self.controlView.bounds.contains(stationPoint){
return self.controlView
}
return self
}
}
练习本题 ›