nastya专题

CF1341E. Nastya and Unexpected Guest(01bfs)

If the girl doesn’t go to Denis, then Denis will go to the girl. Using this rule, the young man left home, bought flowers and went to Nastya. On the way from Denis’s house to the girl’s house is a ro

CF1341D. Nastya and Scoreboard(DP)

Denis, after buying flowers and sweets (you will learn about this story in the next task), went to a date with Nastya to ask her to become a couple. Now, they are sitting in the cafe and finally… Deni

Codeforces Round 489 (Div. 2) E. Nastya and King-Shamans(线段树)

原题链接:E. Nastya and King-Shamans 题目大意: 给出一个长度为 n n n 的非负整数数组 a a a,设 s i s_{i} si​ 为 a a a 的前 i i i 项前缀和: s i = ∑ i = 1 i a i s_{i}=\sum_{i=1}^{i}a_{i} si​=∑i=1i​ai​ 。 给出 q q q 次询问,格式为 p

Codeforces Round #546 (Div. 2)C. Nastya Is Transposing Matrices(思维)

题目链接:http://codeforces.com/contest/1136/problem/C 题意:给你A,B两个矩阵,如果A矩阵通过行列变换可以转化成B矩阵就输出YES,否则输出NO。 思路:通过观察可以发现,如果A矩阵可以转化成B矩阵,那么A矩阵所有的副对角线排序后一定和B矩阵的副对角线相等。 #include <bits/stdc++.h>using namespace std

CF1136E Nastya Hasn‘t Written a Legend

文章目录 R e s u l t Result Result H y p e r l i n k Hyperlink Hyperlink D e s c r i p t i o n Description Description S o l u t i o n Solution Solution C o d e Code Code R e s u l t Result R