c.htm

来自「ACM精彩程序01(University_of_Waterloo_2_June_」· HTM 代码 · 共 32 行

HTM
32
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0044)http://plg.uwaterloo.ca/~acm00/010602/C.html -->
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=GB18030">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY><IMG src="C.files/venn.gif" align=right> 
<H2>Problem C - Sumsets</H2>Given S, a set of integers, find the largest d such 
that a + b + c = d where a, b, c, and d are distinct elements of S. 
<H3>Input</H3>Several S, each consisting of a line containing an integer 1 &lt;= 
n &lt;= 1000 indicating the number of elements in S, followed by the elements of 
S, one per line. Each element of S is a distinct integer between -536870912 and 
+536870911 inclusive. The last line of input contains 0. 
<H3>Output</H3>For each S, a single line containing d, or a single line 
containing "no solution". 
<H3>Sample Input</H3><PRE>5
2 
3 
5 
7 
12
5
2 
16 
64 
256 
1024
0
</PRE>
<H3>Output for Sample Input</H3><PRE>12
no solution
</PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?