首页 > TAG信息列表 > Moscow

[做题记录-图论] [NEERC2017]Journey from Petersburg to Moscow [关于处理路径前$k$大的一种方法]

题意 给定一张连通无向简单图 \(G\),每条边有一个边权。 给定正整数 \(k\),你需要找到 \(G\) 的一条从 \(1\) 到 \(n\) 的路径,设该路径的长度为 \(l\),你需要使得这条路径中边权前 \(\min \left\{ k, l \right\}\) 大的边的边权总和尽可能小。 题解 这种玩意看着人傻了, 一点想法没有,

Codeforces Round #707 (Div. 2, based on Moscow Open Olympiad in Informatics)C. Going Home

C. Going Home 题目大意 在一个数组中问你是否存在4个下标不同的数,是的两两之和相等 思路 两两之和肯定需要枚举,在枚举时,将之和存入另一个维护数组中记录两个下标,如果当前维护数组的没有记录该和的下标就将其压入数组中,如果已经存在就判断维护数组的下标与当前该和的两个下

2017-2018 ACM-ICPC, NEERC, Moscow Subregional Contest Problem G

题目链接 每个格子都是一个未知数,每条边都能列出一个方程 于是得到了一个 \(2mn \times mn\) 的线性方程组 一开始以为是超定,后来举了个例子,发现是亚定。 发现每个未知数都分别在四个方程中出现,两次系数为1,两次为-1,那我们正负两两相加,这个变量就被消掉了,这就成了一个自由变量。

《Codeforces Round #680 (Div. 2, based on Moscow Team Olympiad)》

A:签到题,排序之后判断一下即可 #include<bits/stdc++.h> using namespace std; typedef long long LL; const int N = 5e6 + 5; const LL Mod = 1e9 + 7; #define INF 1e9 #define dbg(x) cout << "now this num is " << x << endl; inline LL read()

[Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)] B

//很好玩的一道题#include <bits/stdc++.h> #define P pair<int, int> #define ll long long using namespace std; const int maxn = 4e4 + 5; int n, m, k; ll ans; int a[maxn], b[maxn]; int main() { int c[5] = { 0, 1, 2, 3 }; int ccc = lower_bou

[Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)] -D. Present(异或性质,按位拆

[Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)] -D. Present(异或性质,按位拆分,树桩数组) D. Present time limit per test 3 seconds memory limit per test 512 megabytes input standard input output standard output Catherine received an a

Codeforces Round #626 (Div. 1, based on Moscow Open Olympiad in Informatics) A-D

https://codeforces.com/contest/1323   A. Even Subset Sum Problem. 数据范围只有100,两个for暴力枚举一遍,记录满足题意的区间左右端点即可。最后输出。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 105; 5 ll a[maxn

Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)

A. Even Subset Sum Problem 题意 给出一串数,找到其中的一些数使得他们的和为偶数 题解 水题,找到一个偶数或者两个奇数就好了 代码 #include<iostream> #include<cstdio> #include<cstring> #define def 110 using namespace std; long a[def]; int main() { long _,ans0,an

Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics)

Codeforces Round #626 (Div. 2, based on Moscow Open Olympiad in Informatics) 比赛链接 A. Even Subset Sum Problem 找出第一次出现的一个偶数或者两个奇数 #include<bits/stdc++.h> #define IOS ios::sync_with_stdio(0);cin.tie(0); #define MEM(X,Y) memset(X,Y,siz