模拟
MQLYES
这个作者很懒,什么都没留下…
展开
-
HDU 5353
#includeusing namespace std;const int maxn = 100005;int a[maxn];int b[maxn];int c[maxn];int ans[maxn*2+10];int main(){ int T ; scanf("%d", &T); while(T--) { int n;原创 2015-08-27 15:48:53 · 366 阅读 · 0 评论 -
HDU 5596
#include#include#include#include#include#includeusing namespace std;const int maxn = 1e5+10;int c[maxn];struct node{ int data; int id;}a[maxn];int main(){ int T; scanf("%d",&T); while(T--) { int n,m;原创 2015-12-12 21:43:33 · 714 阅读 · 0 评论 -
codeforce 615 C
time limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputA boy named Ayrat lives on planet AMI-1511. Each inhabitant of th原创 2016-01-09 15:25:56 · 484 阅读 · 0 评论 -
hdu 5875
#includeusing namespace std;int n,m;int pos[100010];int a[100010];void getl(){ pos[n]=-1; for(int i = n-1; i>=1; i--) { int p = i+1; while(1) {原创 2016-09-20 13:20:52 · 354 阅读 · 0 评论 -
Hihocoder 数组重排
题意: 给你个1到n的序列p,每次将所有数移动,第i个数移动到p[i]位置上 ,问最少几次操作,使得 所有 i==p[i]其实想想也就是 第I个数按照规则移动,会再次回到 i的位置上,需要几次, 要保证所有数同时回到自己位置上,就是要求每个数移动次数的最小公倍数就行了#includeusing namespace std;long long a[101];long long l原创 2016-11-06 17:59:19 · 806 阅读 · 0 评论