CodeForces 669C Little Artem and Matrix GNU】的更多相关文章

模拟. 把操作记录一下,倒着复原回去. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<…
题目链接: C. Little Artem and Matrix time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output   Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelt…
C. Little Artem and Matrix 题目连接: http://www.codeforces.com/contest/669/problem/C Description Little Artem likes electronics. He can spend lots of time making different schemas and looking for novelties in the nearest electronics store. The new contro…
题目链接: Codeforces 669D Little Artem and Dance 题目描述: 给一个从1到n的连续序列,有两种操作: 1:序列整体向后移动x个位置, 2:序列中相邻的奇偶位置互换. 问:q次操作后,输出改变后的序列? 解题思路: 刚开始只看了第一组样例,发现相邻的奇偶位一直在一起,于是乎就开始writing code,写完后发现并不是正解!!!!就去推了一下第三个样例,总是这组实例通过,那组实例卡死,,,,,,,最后终于成功的Mengbility.今天突然想起来,其实整体…
F. Magic Matrix 题目连接: http://www.codeforces.com/contest/632/problem/F Description You're given a matrix A of size n × n. Let's call the matrix with nonnegative elements magic if it is symmetric (so aij = aji), aii = 0 and aij ≤ max(aik, ajk) for all…
题目链接: C. Artem and Array time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Artem has an array of n positive integers. Artem decided to play with it. The game consists of n moves. Each move g…
http://codeforces.com/problemset/problem/669/D 题意:n个数1~N围成一个圈.q个操作包括操作1:输入x, 所有数右移x.操作2:1,2位置上的数(swap(a[1], a[2])交换:3,4交换.... 题解:观察,发现所有奇数行为都是一样的,偶数同理,(对于操作1 两者相同,对于操作2 奇数位++,偶数位上--: 模拟1,2,即可,然后依次输出其它数字即可.(看清 ac代码: #define _CRT_SECURE_NO_WARNINGS #in…
B. Little Artem and Dance time limit per test 2 second memory limit per test 256 megabytes input standard input output standard output Little Artem is fond of dancing. Most of all dances Artem likes rueda - Cuban dance that is danced by pairs of boys…
链接:http://codeforces.com/problemset/problem/669/C http://www.cnblogs.com/Ash-ly/p/5443155.html 题意: 给你一个N*M的矩阵,有三种操作: 1 r 代表把第r行整体左移一位,第一个到最后一个位置. 2 l  代表把第l列整体上移一位,第一个到最底下的位置. 3 x y v 代表此刻第 x 行第 y 列的值为 v. 给你一系列的操作,让你给出满足要求的原始矩阵,如果有多个答案,其中任意一个都可以. 思路:…
Strictly Positive Matrix 题解: 如果原来的 a[i][j] = 0, 现要 a[i][j] = 1, 那么等于 sum{a[i][k] + a[k][j]} > 1. 如果把a[i][j]视作 i -> j 是否能达到. 那么对于上述的那个方程来说,相当于 i先走到k, k再走到j. 单向边. 所以化简之后,就是询问一幅图是不是只有一个强连通缩点. 代码: #include<bits/stdc++.h> using namespace std; #defi…