//
问题 E: Bichrome Cells
时间限制: 1.000 Sec 内存限制: 128 MB题目描述
We have an N×N square grid.
We will paint each square in the grid either black or white.
If we paint exactly A squares white, how many squares will be painted black?Constraints
1≤N≤100
0≤A≤N^2
输入
Input is given from Standard Input in the following format:
N
A
输出
Print the number of squares that will be painted black.
样例输入 Copy
3
4
样例输出 Copy
5
提示
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 main()
{int n,a;while( ~scanf("%d%d",&n,&a) ){printf("%d\n",n*n-a);}return 0;
}
//
#include<bits/stdc++.h>
using namespace std;int main()
{int n,a,ans;while( ~scanf("%d%d",&n,&a) ){printf("%d\n",ans=n*n-a);}return 0;
}