/images/avatar.png

^_^

浮点数加减法

#0 0操作数检查

如果有一个数为0,则可以直接得出结果

#1 用补码表示阶码,尾数

阶码的符号位为两位

尾数的个位为符号位

#2 对阶

小阶向大阶对齐(看原码),被对阶的数尾数右移阶差个

Codeforces Round #630 (Div. 2) A~E

A. Exercising Walk

题意

给一坐标范围,初始位置,和左右上下移动的步数,问是否会出界

题解

加各种条件判断即可

ac代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
#include<bits/stdc++.h>
using namespace std;
int t;
int a,b,c,d,x,y,x1,y1,x2,y2;
bool ok;
int main(){
	//freopen("input.txt","r",stdin);
	cin>>t;
	while(t--){
		ok=true;
		cin>>a>>b>>c>>d>>x>>y>>x1>>y1>>x2>>y2;
		if( (a-b>=0 and x-x1<a-b) or (b-a>0 and x2-x<b-a) or (c-d>0 and y-y1<c-d) or (d-c>0 and y2-y<d-c) or 
		(a==b and a!=0 and x1==x and x2==x) or (c==d and c!=0 and y1==y and y2==y) )
		ok = false;
		if(ok) puts("yes"); else puts("no");
	}
	return 0;
}

B. Composite Coloring

题意

给n个合数上色,要求相同颜色的数字必须不互质,求最小着色数和着色方案

abc160

A - Coffee

题意

判断一个长度为6的字符串,第3位和第4位是否相等,第5位和第6位是否相等

题解

模拟

ac代码

1
2
3
4
5
6
7
8
9
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	if(s[2]==s[3] and s[4]==s[5]) cout<<"Yes";
	else cout<<"No";
	return 0;
}

B - Golden Coins

题意

高桥有许多钱,可以兑换成各种硬币,每获得一枚500円的硬币,就能获得1000

星际牛仔

《星际牛仔》(カウボーイビバップ;Cowboy Bebop),是日本SUNRISE动画

公司制作的原创电视动画,于1998年10月23日-1999年4月23日在东京电视台和

Codeforces Round #629 (Div. 3)

A. Divisibility Problem

题意

求一个数加上多少能被另一个数整除

题解

如果b|(a+k)

则k=b-a%b注意k=0特判

ac代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#include<bits/stdc++.h>
using namespace std;
int t,a,b;
int main(){
	//freopen("input.txt","r",stdin);
	cin>>t;
	while(t--){
		cin>>a>>b;
		cout<<(b-(a%b)==b?0:b-(a%b))<<endl;
	}
	return 0;
}

B. K-th Beautiful String

题意

一个长度为n的字符串,由n-2个a组成和2个b组成

杀手2

杀手2由IO Interactive开发,2018年发行的潜行刺杀游戏,与羞辱不同的是这是第三人称

https://img-blog.csdnimg.cn/20200328175706409.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNzM3Njk3,size_16,color_FFFFFF,t_70

杀手2最大的特点是刺杀方法的丰富性

Android 属性动画

简单演示

https://img-blog.csdnimg.cn/20200323221512658.gif

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".anim2Activity">


    <TextView
        android:layout_width="match_parent"
        android:layout_height="70dp"
        android:id="@+id/a2tv1"
        android:textSize="30sp"
        android:text="animation_test"
        android:gravity="center"
        android:textColor="#FFFFFF"
        android:background="#AAAAAA"/>
</androidx.constraintlayout.widget.ConstraintLayout>
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
package com.example.test;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

public class anim2Activity extends AppCompatActivity {
    private TextView a2tv1;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_anim2);
        a2tv1 = findViewById(R.id.a2tv1);
        a2tv1.animate().translationYBy(500).setDuration(2000).start();
    }
}

https://img-blog.csdnimg.cn/20200324104958404.gif

看门狗2

Watch_dogs2是ubisoft于2016年11月发行的角色扮演游戏

https://img-blog.csdnimg.cn/20200324223722585.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNzM3Njk3,size_16,color_FFFFFF,t_70

骇入系统是其游戏特色

玩了130+小时

看门狗2的这个特色很新颖,但是剧情很平淡,后面的玩法基本与前面重复

Android 数据存储

SharedPreferences

https://img-blog.csdnimg.cn/20200322213737854.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNzM3Njk3,size_16,color_FFFFFF,t_70#pic_center

sharedpreferences的布局

https://img-blog.csdnimg.cn/20200322214132290.PNG?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQzNzM3Njk3,size_16,color_FFFFFF,t_70

布局文件

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".datastorage.sharedPreferencesActivity">

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/spet1"
        android:hint="input"
        android:textSize="25sp"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintVertical_bias="0.1"
        />

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="25sp"
        android:text="sava"
        app:layout_constraintTop_toBottomOf="@+id/spet1"
        android:layout_marginTop="20dp"
        android:id="@+id/spbtn1"/>

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:textSize="25sp"
        android:text="show"
        app:layout_constraintTop_toBottomOf="@+id/spbtn1"
        android:layout_marginTop="20dp"
        android:id="@+id/spbtn2"/>

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/sptv1"
        android:textSize="25sp"
        app:layout_constraintTop_toBottomOf="@+id/spbtn2"
        android:layout_marginTop="20dp"
        />


</androidx.constraintlayout.widget.ConstraintLayout>

输入内容,存储到sharedpreferences,并呈现