1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/大的国家 [big-countries].html

62 lines
2.0 KiB
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<p><code>World</code> 表:</p>
<div class="top-view__1vxA">
<div class="original__bRMd">
<div>
<pre>
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| name | varchar |
| continent | varchar |
| area | int |
| population | int |
2023-12-09 18:42:21 +08:00
| gdp | bigint |
2022-03-27 20:46:41 +08:00
+-------------+---------+
2023-12-09 18:42:21 +08:00
<code>name</code> 是该表的主键(具有唯一值的列)。
2022-03-27 20:46:41 +08:00
这张表的每一行提供:国家名称、所属大陆、面积、人口和 GDP 值。
</pre>
<p>&nbsp;</p>
<p>如果一个国家满足下述两个条件之一,则认为该国是 <strong>大国</strong> </p>
<ul>
2023-12-09 18:42:21 +08:00
<li>面积至少为 300 万平方公里(即,<code>3000000 km<sup>2</sup></code>),或者</li>
2022-03-27 20:46:41 +08:00
<li>人口至少为 2500 万(即 <code>25000000</code></li>
</ul>
2023-12-09 18:42:21 +08:00
<p>编写解决方案找出&nbsp;<strong>大国</strong> 的国家名称、人口和面积。</p>
2022-03-27 20:46:41 +08:00
<p><strong>任意顺序</strong> 返回结果表。</p>
2023-12-09 18:42:21 +08:00
<p>返回结果格式如下例所示。</p>
2022-03-27 20:46:41 +08:00
<p>&nbsp;</p>
2023-12-09 18:42:21 +08:00
<p><strong class="example">示例:</strong></p>
2022-03-27 20:46:41 +08:00
<pre>
<strong>输入:</strong>
World 表:
+-------------+-----------+---------+------------+--------------+
| name | continent | area | population | gdp |
+-------------+-----------+---------+------------+--------------+
| Afghanistan | Asia | 652230 | 25500100 | 20343000000 |
| Albania | Europe | 28748 | 2831741 | 12960000000 |
| Algeria | Africa | 2381741 | 37100000 | 188681000000 |
| Andorra | Europe | 468 | 78115 | 3712000000 |
| Angola | Africa | 1246700 | 20609294 | 100990000000 |
+-------------+-----------+---------+------------+--------------+
<strong>输出:</strong>
+-------------+------------+---------+
| name | population | area |
+-------------+------------+---------+
| Afghanistan | 25500100 | 652230 |
| Algeria | 37100000 | 2381741 |
+-------------+------------+---------+
</pre>
</div>
</div>
</div>