6608: Bichrome Cells发表时间:2022-10-27 19:53 6608: Bichrome Cells时间限制: 1 Sec 内存限制: 128 MB 题目描述We have an N×N square grid. 输入Input is given from Standard Input in the following format: 输出Print the number of squares that will be painted black. 样例输入 Copy3 4 样例输出 Copy5 提示There are nine squares in a 3×3 square grid. Four of them will be painted white, so the remaining five squares will be painted black. #include<bits/stdc++.h> using namespace std; int n,a; int main(){ cin>>n>>a; cout<<n*n-a<<endl; return 0; }
上一篇13765: 消灭冰龙
下一篇5270: 托马斯破密码
文章分类:
算法例题
|