当前位置:网站首页>abc 258 G - Triangle(bitset)
abc 258 G - Triangle(bitset)
2022-07-05 00:02:00 【eva_can(not)survive】
G - Trianglehttps://atcoder.jp/contests/abc258/tasks/abc258_g直接用bitset存邻接矩阵,暴力一下就行
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cstring>
#include <set>
#include <cmath>
#include <map>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int MN = 65005;
const int MAXN = 1e6 + 10;
const int INF = 0x3f3f3f3f;
#define IOS ios::sync_with_stdio(false)
#define lowbit(x) ((x)&(-x))
using P = pair<int, int>;
const int N = (int) 3e3 + 5;
//int s[5000][5000];
bitset<N> s[N];
int main() {
int n;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
string str;
cin >> str;
reverse(str.begin(), str.end());
s[i] = bitset<N>(str);
}
ll res = 0;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (s[i][j] == 1) {
res += (s[i] & s[j]).count();
}
}
}
printf("%lld", res / 3);
return 0;
}
边栏推荐
- 微软禁用IE浏览器后,打开IE浏览器闪退解决办法
- Basic points of the game setup of the points mall
- 【路径规划】RRT增加动力模型进行轨迹规划
- 挖财学院开户安全的吗?开户怎么开?
- Using the uniapp rich text editor
- [JS] - [dynamic planning] - Notes
- 实战模拟│JWT 登录认证
- Face recognition 5- insight face padding code practice notes
- Build your own minecraft server with fast parsing
- Meet ThreadPoolExecutor
猜你喜欢
Jar批量管理小工具
QT addition calculator (simple case)
How to apply for PMP project management certification examination?
Blue sky nh55 series notebook memory reading and writing speed is extremely slow, solution process record
[paper reading] Tun det: a novel network for meridian ultra sound nodule detection
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
XML的解析
用快解析内网穿透实现零成本自建网站
圖解網絡:什麼是網關負載均衡協議GLBP?
快解析内网穿透帮助企业快速实现协同办公
随机推荐
股票账户佣金怎么调低,炒股佣金怎么调低网上开户安全吗
Every time I look at the interface documents of my colleagues, I get confused and have a lot of problems...
香港珠宝大亨,22亿“抄底”佐丹奴
If you open an account of Huatai Securities by stock speculation, is it safe to open an account online?
Remember to build wheels repeatedly at one time (the setting instructions of obsidian plug-in are translated into Chinese)
Fs8b711s14 electric wine bottle opener MCU IC scheme development special integrated IC
Selected cutting-edge technical articles of Bi Ren Academy of science and technology
PMP证书续证流程
使用快解析搭建自己的minecraft服务器
机器人强化学习——Learning Synergies between Pushing and Grasping with Self-supervised DRL (2018)
C language to quickly solve the reverse linked list
PMP certificate renewal process
uniapp 除了数字,其他输入无效
雅思考试流程、需要具体注意些什么、怎么复习?
Skills in analyzing the trend chart of London Silver
Jar batch management gadget
Illustrated network: what is gateway load balancing protocol GLBP?
[论文阅读] TUN-Det: A Novel Network for Thyroid Ultrasound Nodule Detection
go踩坑——no required module provides package : go.mod file not found in current directory or any parent
22-07-02周总结