1209. 1, 10, 100, 1000... Time limit: 1.0 secondMemory limit: 64 MB Let's consider an infinite sequence of digits constructed of ascending powers of 10 written one after another. Here is the beginning of the sequence: 110100100010000… You are to find…
先上题目: 1209. 1, 10, 100, 1000... Time limit: 1.0 secondMemory limit: 64 MB Let's consider an infinite sequence of digits constructed of ascending powers of 10 written one after another. Here is the beginning of the sequence: 110100100010000… You are t…
1087 1 10 100 1000 题目来源: Ural 1209 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题  收藏  关注 1,10,100,1000...组成序列1101001000...,求这个序列的第N位是0还是1.   Input 第1行:一个数T,表示后面用作输入测试的数的数量.(1 <= T <= 10000) 第2 - T + 1行:每行1个数N.(1 <= N <= 10^9) Output 共T行,如果该位是0,输出0,…
题目来源: Ural 1209 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题  收藏  关注 1,10,100,1000...组成序列1101001000...,求这个序列的第N位是0还是1.   Input 第1行:一个数T,表示后面用作输入测试的数的数量.(1 <= T <= 10000) 第2 - T + 1行:每行1个数N.(1 <= N <= 10^9) Output 共T行,如果该位是0,输出0,如果该位是1,输出1. Input示例…
Input示例 3 1 2 3 Output示例 1 1 0 #include "bits/stdc++.h" using namespace std; #define LL long long #define INF 0x3f3f3f3f3f #define PI acos(-1) #define N 510 #define MOD 10 using namespace std; int main() { int n,t,m; scanf("%d",&t)…
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1087 用高中的数列知识就可以推出公式,不难发现f(n)=f(n-1)+n-1,f(1)=1.列出f(n)~f(2)的所有表达式,左右值分别求和就可以消去中间量,最后得出f(n)=(n*n-n)/2+1. 刚才在上XML的时候一个同学告诉我,她初中数学老师告诉她假如数列的公差也是一个等差数列,那么这个式子一定表示为a*x^2+b*x+c的形式.我试着带进去了前三…
http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1087 暴力大法 #include<bits/stdc++.h> using namespace std; map <int,int>s; void solve() { ,k=; while (i<=1e9) { s[i] = ; i+=k; k++; } } int main () { int t,n; solve();scanf("%d&…
https://blog.csdn.net/lunch__/article/details/82655579 看似高大上,实际也不太好想到 先尝试确定一些位: 给出了最后一列,sort得到第一列 0XXX1 0XXX1 1XXX0 1XXX0 1XXX1 现在知道了第一行的第一个和最后一个 考虑不断确定第一行的下一个 某一行一定是由某一行循环左移1位得到的 发现,如果输入合法,这个移动的配对一定是开始的0和结束的0依次配对,开始的1和结束的1依次配对 否则如果有交叉,如1->4,2->3那么第…
一道有趣的for循环题 今天在复习js基础知识时发现了一个for循环的题,第一眼看到直接懵逼了,没想到for循环竟然还可以这样玩?涨姿势了. 题目是这样的 for(i=0, j=0; i<10, j<6; i++, j++){ k = i + j; } console.log(k); //10 k 的值结果为 10,刚开始不解,就在循环中打印了一下 i 和 j 的值,发现一共循环了六次,i 和 j 的值是相等的. 把 i 和 j 的判断部分互换位置 for(i=0, j=0; i<6,…
[源码下载] 背水一战 Windows 10 (100) - 应用间通信: 分享 作者:webabcd 介绍背水一战 Windows 10 之 应用间通信 分享 示例1.本例用于演示如何开发一个分享的分享源App2AppCommunication/ShareSource.xaml <Page x:Class="Windows10.App2AppCommunication.ShareSource" xmlns="http://schemas.microsoft.com/w…