配置环境
首先我们得先配置好环境
我这里用的是IDEA,也可以用android studio
首先在IDEA中安装一个叫Android的插件
下载好后我们需要创建项目
框选的位置一定要修改(language有误,应该选择kotlin)
可能会提示下载SDK,直接下载就行了
创建好后,我们需要修改gradle镜像源
将框选的地址换为
https://mirrors.cloud.tencent.com/gradle/gradle-8.2-all.zip
修改后,重新加载gradle项目即可
项目搭建
首先我们找到文件app\src\main\java\com\example\myapplication\MainActivity
若没有修改项目名称,那路径就和我一样的
将以下代码复制到上面的文件中,项目名称不同下述代码的第一行不用复制,粘贴的时候要保留原有的第一行
package com.example.myapplicationimport android.annotation.SuppressLintimport android.app.AlertDialogimport a ...
创建文件夹
mkdir demo
初始化
npm init -y
打开编译器创建文件index.js并填入以下信息
function main () { console.log("Hello, world");}main();export default main;export function Hello(name) { console.log('${ name }}');}
打开package.json文件
现在我们来熟悉下这个文件。
字段
备注
name
npm包的名称,也就是publish后的名称
version
每次publish的时候记得修改这个,必须要是新版本
desdescription
对这个npm包的描述
main
链接到这个包后,默认打开的文件
keywords
关键词。若是自行使用,可以不配置
author
作者。填写自己的用户名就行
现在在json文件中添加以下信息
"files" ...
StarRail
未读
梦醒方知我非蝶
睁眼 不知今夕何年
缀尾以赤焰 塑身以红莲
生死仿佛只在一念间
梦醒方知我非蝶
执念 缠绕于我指尖
前尘隔山远 往事散如烟
清夜 乘一叶星槎归故园
望仙舟繁华似从前
故人如相见 是否泪如涟
只恨旧忆皆忘却
归来时
春色满丛 花繁露浓 暗香盈襟袖
奈何
世事匆匆 今朝明月 可与当年同
纸扇归烬泪成空 木
桃花依旧笑春风
谁见昨日山河尽入梦
梦魇 盘旋之后幻灭
旧忆如残片 又蓦然浮现
聚散不定 随月色溶解
昼起才见花未眠
夙愿 萦绕于我心间
前尘隔山远 往事今重叠
尤见 花瓣落荒原坠深渊
叹命运脆弱似琴弦
弦断梦可辨 业火燃罪孽
忘归即最终纪念
怎忘却
焰噬长空 魂殇囚笼 作别长生种
归来 徒留惨痛 旧友难逢 此身系转蓬
朝露明灭浮光散 听涛不见山万重
应是红尘蹀躞皆入梦
而今 幽夜沉重
云过无 ...
codeforces
未读打过的最难的div3
A.Line Breaks
Line Breaks
题目描述
英文题面中文题面Kostya has a text s consisting of n words made up of Latin alphabet letters. He also has two strips on which he must write the text. The first strip can hold m characters, while the second can hold as many as needed.
Kostya must choose a number x and write the first x words from s on the first strip, while all the remaining words are written on the second strip. To save space, the words are written without gaps, but each word must be entirely on ...
A.Pairing
Pairing
题目描述
英文题面There are four balls, and the color of the $i$-th ball is $A_i$.
Find the maximum number of times you can perform this operation: choose two balls of the same color and discard both.
参考代码
#include<bits/stdc++.h>#define int long long#define endl '\n'#define pii std::pair<int ,int>#define fix(x) std::fixed << std::setprecision(x)const int inf = 1e17 + 50, MAX_N = 1e5 + 50, mod = 1e9 + 7;void solve() { std::map<int, int> mp; for(in ...
A.Rearranging ABC
Rearranging ABC
题目描述
英文题面中文题面You are given a string $S$ of length $3$ consisting of uppercase English letters.
Determine whether it is possible to rearrange the characters in $S$ to make it match the string ABC.给定字符串$s$,判断是否可以组成 $ABC$
解题思路
排个序就行了
参考代码
#include<bits/stdc++.h>#define int long long#define endl '\n'#define pii std::pair<int ,int>#define fix(x) std::fixed << std::setprecision(x)const int inf = 1e17 + 50, MAX_N = 1e5 + 50, mod = 1e9 + 7; ...
建议查看中文题面,不要问为什么*(问就是,英文题面就是复制过来的,中文体面精简些),数据范围详见题目链接
A.Candy Button
Candy Button
题目描述
英文题面中文题面There is a mysterious button. When you press this button, you receive one candy, unless less than $C$ seconds have elapsed since you last received a candy.
Takahashi decided to press this button $N$ times. He will press the button for the $i$-th time $T_i$ seconds from now.
How many candies will he receive?一个按钮,按了会发糖。
给定多次按的时间。如果这次按的时间距离上次发糖时间超过了$c$,则发个糖。问发的糖数量。
解题思路
发糖的前提是距离上次发糖时间大于等于$c$
参考代码
#inclu ...
建议查看中文题面,不要问为什么*(问就是,英文题面就是复制过来的,中文体面精简些),数据范围详见题目链接
A.Seats
Seats
题目描述
英文题面中文题面There are $N$ seats in a row, numbered $1, 2, \ldots, N$.
The state of the seats is given by a string $S$ of length $N$ consisting of # and .. If the $i$-th character of $S$ is #, it means seat $i$ is occupied; if it is ., seat $i$ is unoccupied.
Find the number of integers $i$ between $1$ and $N - 2$, inclusive, that satisfy the following condition:
Seats $i$ and $i + 2$ are occupied, and seat $i + 1$ is unoccupie ...
建议查看中文题面,不要问为什么*(问就是,英文题面就是复制过来的,中文体面精简些)
A.Takahashi san 2
Takahashi san 2
题目描述
英文题面中文题面KEYENCE has a culture of addressing everyone with the suffix “-san,” regardless of roles, age, or positions.
You are given a string $S$ consisting of lowercase English letters.
If $S$ ends with san, print Yes; otherwise, print No.判断字符串末尾是否有 san 这个后缀
参考代码
#include<bits/stdc++.h>#define int long long#define endl '\n'#define pii std::pair<int ,int>#define fix(x) std::fixed << std::s ...
codeforces
未读A. Minimize!
Minimize!
题目描述
英文题面中文简义You are given two integers a and b (a≤b). Over all possible integer values of c (a≤c≤b), find the minimum value of (c−a)+(b−c).给定数字 $a$ , $b$ ,一个数 $c$ 的取值范围为 $[a,b]$ 求 $(c-a)+(b-c)$ 的最小值
解题思路
我们对等式化简 $(c-a)+(b-c) \to b-a$ 由此可见,等式的结果与 $c$ 的值无关
参考代码
#include<bits/stdc++.h>#define int long long#define endl '\n'#define pii std::pair<int ,int>#define fix(x) std::fixed << std::setprecision(x)const int inf = 1e17 + 50, MAX_N = 1e5 + 50, ...