【NOIP2012TG】solution】的更多相关文章

D1T1(Vigenere) 题意:给你一个原串与一个密码串,问你按照题意规则加密后的密文. 解题思路:暴力模拟. #include <stdio.h> ],c[],u1[],u2[]; void read(int*a,int*b){ char c; while(c=getchar(),c>='a'&&c<='z'||c>='A'&&c<='Z') ]]=c-'a'; ]]=c-]]=;; } int main(){ read(k,u1)…
本人设备列表: Onda tablet {Android} wifi Desktop computer {win7.centos7} 外接蓝牙adapter PS interface 键盘.鼠标{与同局域网laptop通过synergy软件共享,使其成为共享的输入设备} 3.5mm interface低音炮{通过Bluetooth连接laptop,从而让laptop也可以使用该声音输出设备} 250G硬盘,通过在linuxcentos上搭建NFSNetwork File System,使其硬盘资…
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6409067.html 1:Hamming distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance.…
Coding everyday. ^_^ 1. Two Sum 重点知识:指针可以存储数值,通过 malloc 新建数组 int* returnSize:Size of the return array. Store the value in a pointer, say 2.*returnSize = 2 My solution: /** * Note: The returned array must be malloced, assume caller calls free(). */ in…
链接:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83|31 D1T1(rps) 题意:给你一个周期,以及胜负关系,求A和B的胜场. 解题思路:暴力抄表,然后暴力计算即可. #include<cstdio> #include<iostream> using namespace std; ],na,nb,b[],ansa,ansb,n; ][]{{,,,,},{,,,,},{,,,,},{,,…
传送门:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%7C33 D1T1(toys) 题意:有n个小人,给你M条指令,每条指令可顺可逆(时针),问你操作后的位置在哪. 解题思路:裸模拟即可. #include<stdio.h> using namespace std; #define MN 100005 ]; int n,m; bool b[MN]; inline int in(){ ;char c…
链接:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%2C32 D1T1(magic) 题意:看题目.. 解题思路:纯模拟... #include<stdio.h> ][],n; int main() { scanf("%d",&n); ,y=n+>>;f[x][y]=; ; i<=n*n; ++i){ &&y<n) x=n,++y;…
链接:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%2C30 D1T1:转圈游戏(circle) 题意:看题目.. 解题思路:快速幂求\( (10^k m) mod n \)即可.时间效率\( O (\lg k) \) #include<stdio.h> #define ll long long #define For(i,a,b) for(int i=a; i<=b; i++) #defin…
老师最近叫我把NOIPTG的题目给刷掉,于是就开始刷吧= = 链接:https://www.luogu.org/problem/lists?name=&orderitem=pid&tag=83%2C28 D1T1:carpet 题意简析:一个平面内有多个矩形按顺序覆盖平面,问覆盖后某个点属于哪个矩形. 解题思路:从n~1倒着check点有没有在矩形内即可,时间效率\( O(n) \). #include<cstdio> #include<iostream> #inc…
转载请注明原文地址: 21:Assign Cookies Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a cookie that the child wi…