time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sengoku still remembers the mysterious "colourful meteoroids" she discovered with Lala-chan when they were little. In particular, one of…
http://codeforces.com/problemset/problem/814/B 构造题烦死人,一开始我还记录一大堆信息来构造p数列,其实因为s数列只有两项相等,也正好缺了一项,那就把两种情况构造出来暴力验证对不对就行了. #include<bits/stdc++.h> using namespace std; #define ll long long int n; ]; ]; ]; ]; ]; int main(){ scanf("%d",&n); ;…
B. An express train to reveries time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sengoku still remembers the mysterious "colourful meteoroids" she discovered with Lala-chan when they we…
An express train to reveries time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Sengoku still remembers the mysterious "colourful meteoroids" she discovered with Lala-chan when they were…
题目链接:http://codeforces.com/problemset/problem/814/B 题目意思:分别给定一个长度为 n 的不相同序列 a 和 b.这两个序列至少有 i 个位置(1 ≤ i ≤ n ), a[i] != b[i] .现在需要构造一个长度为 n,每个数只能取值1~n 且只能取值一次的序列 p, 使得恰好存在有一个位置 i(1 ≤ i ≤ n ), ai ≠ pi .和恰好存在一个位置 j (1 ≤ j ≤ n) , bj ≠ pj ,保证这个序列 p 有n-1个位…
A An abandoned sentiment from past 水题 #include<bits/stdc++.h> using namespace std; int a[300],b[300],n,k; bool cmp(int a,int b) { return a>b; } int main() {//freopen("t.txt","r",stdin); scanf("%d%d",&n,&k); f…