Codeforces Round #364 (Div. 2) B
来源:互联网 发布:如何成为一个网络作家 编辑:程序博客网 时间:2024/06/11 23:23
这里用了set没有重复元素的性质,做的时候用的vis数组,但用set思路清晰好多,代码也好很多。然后就是注意1ll*int*int
#include<bits/stdc++.h>using namespace std;set<int>s1,s2;#define LL long longint main(){ int a,b; int n,m; cin>>n>>m; LL t=1ll*n*n; for(int i=0;i<m;i++){ cin>>a>>b; s1.insert(a); s2.insert(b); LL ans=t-1ll*n*s1.size()-1ll*(n-s1.size())*s2.size(); if(i==0)cout<<ans; else cout<<" "<<ans; } cout<<endl; return 0;}
0 0
- Codeforces Round #364 (Div. 2) B
- Codeforces Round #364 (Div. 2) B
- Codeforces Round #364 (Div. 2)(A,B,C,D) 题解
- Codeforces Round #364 (Div. 2),只有A与B
- Codeforces Round #364 div.2 B 【数组标记】
- Codeforces Round #364 (Div. 2)(A,B,C,D)
- Codeforces Round #364 (Div. 2) B. Cells Not Under Attack
- Codeforces Round #131 (Div. 2) A B
- Codeforces Round #134 (Div. 2)B. Airport
- Codeforces Round #170 (Div. 2) problem B
- Codeforces Round #173 (Div. 2) Problem B
- Codeforces Round #181 (Div. 2) B. Coach
- Codeforces Round #185 (Div. 2)--A,B
- Codeforces Round #171 (Div. 2) B
- Codeforces Round #169 (Div. 2) B题
- Codeforces Round #188 (Div. 2) B题
- Codeforces Round #192 (Div. 2) B
- Codeforces Round #203 (Div. 2) B. Resort
- 类的派生性
- http://blog.csdn.net/mindfloating/article/details/51534289
- 学习java day01
- iOS - 小文件下载篇(下载完写入文件)
- Codeforces 364Div2
- Codeforces Round #364 (Div. 2) B
- 派生类的构造函数与基类的构造函数
- Service初学
- 欧拉函数
- Fiddler抓包工具
- hdu 3032 Nim or not Nim?(打表 sg函数)
- Java语言:if语句
- HDU5734 Acperience
- IOS动画开发总结