zoukankan      html  css  js  c++  java
  • [2020.5.20]UOJ520 【美团杯2020】图片解密

    Small Task

    打开发现是一大堆实数,以整数代替实数并缩小可以看到整个字符串为JZ4WC3TPIFYGK。

    Large Task

    观看提供的视频,猜测文件给出了一个时钟墙。

    观察发现文件里有很多86400(一天的秒数),猜测它应该是给出秒数,画出钟面以后得到答案。

    用3*3的方格来近似钟面,得到这个文件

    发现中间三分之一的部分似乎有字符。

    如果以特殊的角度观察,可以看清这些字符。

    进一步用5*5的方格近似钟面,可以看得更清楚

    可以发现字符串为LZYYJFQHJZJT。

    打出5*5钟面的代码:

    #include<bits/stdc++.h>
    #define ci const int&
    using namespace std;
    //const char ch[8]={'|','/','-','\','|','/','-','\'};
    //const char ch2[16]={'|','|','/','-','-','-','\','|','|','|','/','-','-','-','\','|'};
    const int wy[8][2]={{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1},{0,-1},{-1,-1}};
    const int wy2[16][2]={{-2,0},{-2,1},{-2,2},{-1,2},{0,2},{1,2},{2,2},{2,1},{2,0},{2,-1},{2,-2},{1,-2},{0,-2},{-1,-2},{-2,-2},{-2,-1}};
    const int n=27,m=('H'-'A'+1)*26+('S'-'A'+1);
    int tmp,typ;
    double t,sv;
    char mp[n*5+10][m*5+10];
    void scan(int&x){
    	x=0;
    	char c=getchar();
    	while(!isdigit(c))c=getchar();
    	while(isdigit(c))x=(x<<3)+(x<<1)+c-'0',c=getchar();
    }
    void Prt(ci x,ci y,double v){
    	sv=1.0/16.0;
    	if(v<=sv||v>15*sv)typ=0;
    	else if(v<=3*sv)typ=1;
    	else if(v<=5*sv)typ=2;
    	else if(v<=7*sv)typ=3;
    	else if(v<=9*sv)typ=4;
    	else if(v<=11*sv)typ=5;
    	else if(v<=13*sv)typ=6;
    	else typ=7;
    	mp[x+wy[typ][0]][y+wy[typ][1]]=/*ch[typ]*/'0';
    	sv=1.0/32.0;
    	if(v<=sv||v>31*sv)typ=0;
    	else for(typ=1;typ<=15;++typ)if(v<=(typ<<1|1)*sv)break;
    	mp[x+wy2[typ][0]][y+wy2[typ][1]]=/*ch2[typ]*/'0';
    }
    int main(){
    	freopen("large.csv","r",stdin);
    	freopen("output.txt","w",stdout);
    	for(int i=0;i<n*5;++i)for(int j=0;j<m*5;++j)mp[i][j]=' ';
    	for(int i=0;i<n*5;++i)for(int j=0;j<m*5;++j)mp[i][j]=(i%5==2&&j%5==2?'O':' ');
    	for(int i=0;i<n;++i)for(int j=0;j<m;++j){
    		scan(tmp);
    		t=(1.0*(tmp%43200)/43200.0),Prt(i*5+2,j*5+2,t);
    		t=(1.0*(tmp%3600)/3600.0),Prt(i*5+2,j*5+2,t);
    	}
    	for(int i=0;i<n*5;++i)cout<<mp[i]<<"
    ";
    	return 0;
    }
    
  • 相关阅读:
    11.11 开课二个月零七天(ajax和bootstrp做弹窗)
    11.10 (下午)开课二个月零六天(ajax验证用户名,ajax调数据库)
    获取当月时间段。
    JavaScript prototype 使用介绍
    JavaScript arguments对象
    JS,DOM对象新知识点整理
    JS清除选择的内容
    限制显示内容,超出用省略号代替的方法
    封装php连接数据库返回方法
    div跟随鼠标移动代码
  • 原文地址:https://www.cnblogs.com/xryjr233/p/UOJ520.html
Copyright © 2011-2022 走看看