2020牛客暑期多校训练营(第七场)J.Pointer Analysis

题目链接

题目描述

Pointer analysis, which aims to figure out which objects accessible via a specific pointer variable in a program during the execution, is one of the fundamental parts of static program analysis. Now we want you to perform the context-insensitive pointer analysis on the test data.

A program contains 26 objects denoted by lowercase letters and each object has 26 member variables (a.k.a. fields, which are pointers that may point to some objects) denoted by lowercase letters as well. Meanwhile, there are 26 global pointers in the programs designated by uppercase letters.

There are four kinds of statements in a program. We use [Variable] to represent the name of a pointer, [Field] to represent the name of a member variable, and [Object] to represent an object.

Format Example Description
Allocation [Variable] = [Object] A = x pointer A can point to object x (i.e., x is accessible via A)
Assignment [Variable] = [Variable] A = B pointer A can point to every object accessible via B
Store [Variable].[Field] = [Variable] A.f = B for every object o accessible via A, the member variable f of o can point to every object accesible via B
Load [Variable] = [Variable].[Field] A = B.f for every object o accessible via B, A can point to every object accessible via the member variable f of o

The context-insensitive pointer analysis assumes that statements of the program will be executed in any order for a sufficient number of times. For example, in the following two programs, both A and B can point to the object x and object o. The reason for that is, in the real world, the exact execution order and execution times of statements are difficult to predict.

First Program Second Program
A = o A = x B = A B = A A = x A = o

Now you are asked to perform a context-insensitive pointer analysis on a given program consists of N statements, and for each pointer, output the objects it can point to.

输入描述:

The first line of the input contains one integer N(1≤N≤200)N (1 \le N \le 200)N(1≤N≤200), representing the number of statements in the program. There is exactly one space before and after the equal sign ‘=’.

Each of the following N lines contains one statement.

输出描述:

The output should contains 26 lines.

In the i-th line, output the name of the i-th pointer (which is the i-th uppercase letter) followed by a colon ‘:’ and a space, and then list the objects accessible via this pointer in alphabetical order.

示例1

输入

5
B.f = A
C = B.f
C = x
A = o
B = o

输出

A: o
B: o
C: ox
D:
E:
F:
G:
H:
I:
J:
K:
L:
M:
N:
O:
P:
Q:
R:
S:
T:
U:
V:
W:
X:
Y:
Z:

示例2

输入

4
A = o
B.f = A
C = B.f
C = g

输出

A: o
B:
C: g
D:
E:
F:
G:
H:
I:
J:
K:
L:
M:
N:
O:
P:
Q:
R:
S:
T:
U:
V:
W:
X:
Y:
Z:

示例3

输入

3
A = o
B = A
A = x

输出

A: ox
B: ox
C:
D:
E:
F:
G:
H:
I:
J:
K:
L:
M:
N:
O:
P:
Q:
R:
S:
T:
U:
V:
W:
X:
Y:
Z:

模拟,至于简不简单,仁者见仁智者见智了

2020牛客暑期多校训练营(第七场)J.Pointer Analysis相关推荐

  1. 2020牛客暑期多校训练营(第一场)

    文章目录 A B-Suffix Array B Infinite Tree C Domino D Quadratic Form E Counting Spanning Trees F Infinite ...

  2. 2020牛客暑期多校训练营(第二场)

    2020牛客暑期多校训练营(第二场) 最烦英语题 文章目录 A All with Pairs B Boundary C Cover the Tree D Duration E Exclusive OR ...

  3. E Groundhog Chasing Death(2020牛客暑期多校训练营(第九场))(思维+费马小定理+质因子分解)

    E Groundhog Chasing Death(2020牛客暑期多校训练营(第九场))(思维+费马小定理+质因子分解) 链接:https://ac.nowcoder.com/acm/contest ...

  4. 2020牛客暑期多校训练营(第一场)A B-Suffix Array(后缀数组,思维)

    链接:https://ac.nowcoder.com/acm/contest/5666/A 来源:牛客网 题目描述 The BBB-function B(t1t2-tk)=b1b2-bkB(t_1 t ...

  5. 2020牛客暑期多校训练营(第二场)Just Shuffle

    https://ac.nowcoder.com/acm/contest/5667/J 题目大意:给你一个置换A,使得置换P^k=A,让你求出置换P. 思路:我们根据置换A再置换z次,那么就等于置换p ...

  6. 2020牛客暑期多校训练营(第一场)j-Easy Integration(思维,分数取模,沃斯利积分)

    题目链接 题意: 给你一个积分公式,给你一个n,问积分公式的值取模后的结果. 思路: 积分公式(沃利斯积分)值的结论直接就是(n!)^2/(2n+1)!,求个阶乘,再用费马小定理给1/(2n+1)!取 ...

  7. 2020 牛客暑期多校训练营(第一场)F

    题目大意: 多次输入两个a,b字符串他们可以无限次的重复变成aaa,或者bbb 比较他们的大小,相同输出 =,a<b输出 <,a>b输出 >. 输入: aa b zzz zz ...

  8. 2020牛客暑期多校训练营(第二场)未完待续......

    F. Fake Maxpooling 题目: 题目大意: 输入n,m,k.矩阵的尺寸为nm,其中每一个元素为A[i][j] = lcm( i , j ).从中找出所有kk的子矩阵中元素最大的数之和. ...

  9. 2020牛客暑期多校训练营(第一场)J、Easy Integration (数学、分部积分)

    题目链接 题面: 题意: 求给定的定积分. 题解,化成 ∫ xn (1-x)n dx 然后用分部积分法即可得. 分部积分法:∫ udv = uv - ∫ vdu 最终为 n!/((n+1)*(n+2) ...

  10. 2020牛客暑期多校训练营(第二场)题解

    废话 蒟蒻不会积分,K不会做. 文章目录 废话 A. All with Pairs B. Boundary C. Cover the Tree D. Duration E. Exclusive OR ...

最新文章

  1. html怎么样取jsp中的路径,jsp中获得路径的两种方法和获得url路径的方法(推荐)
  2. 行为模式之Iterator模式
  3. php mysqli new 连接,php mysqli 连接数据库
  4. python语法基础知识案例_Python 语法速览与实战清单
  5. 语义分割双料冠军!微软 OCRNet化解语义分割上下文信息缺失难题|ECCV 2020
  6. x86 Assembly Guide
  7. 深度优先搜索(DFS)递归形式改为非递归形式
  8. python管理工具ports_采用python flask 开发如何管理 host port
  9. Java旅游管理系统
  10. Git 可视化管理工具 - Sourcetree 使用指南
  11. mysql驱动和url在5.7以上版本变化
  12. java ee 思维导图
  13. 通过Python获取维基百科中概念词条的维基信息
  14. InterConnect 和SmartConnect
  15. 各种通信铁塔和机房类型介绍,别再傻傻分不清了
  16. Unity游戏设计与实现 南梦宫一线程序员的开发实例pdf
  17. UI靠近边框解决办法
  18. 中信银行上线票付通产品 为电商打造专属电票服务
  19. 2017 计蒜之道 初赛 第一场 A题(阿里的新游戏)
  20. 客户端测试是什么?你了解客户端测试吗?

热门文章

  1. MySQL 为什么需要 redo log?
  2. can转光纤 海上风电消防火灾报警系统中消防主机超远距离联网方案
  3. ps滤镜之——马赛克
  4. snmp-cmds 系列工具命令
  5. maya 中的 cmds.scriptJob 命令
  6. 金蝶设置盘盈盘亏单据权限
  7. seo搜索引擎优化-SEO优化教程附关键词工具以及文章采集软件
  8. 网络中的代理(proxy)和NAT
  9. 从个人邮箱登录页面进入后,邮箱如何撤回邮件?
  10. 代码对比工具(beyondCompare/Winmerge/Meld)