Lv.1
I only remember that I worked hard for 3 years.
签名:Infinity
在 我的电脑蓝屏啦!!! 中回复
<html><head>
<title>PRANK: Windows 8 Update</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<script async="" src="//www.google-analytics.com/analytics.js"></script><script src="https://code.jquery.com/jquery-latest.js"></script>
<script src="../assets/js/lang.js"></script>
<script>
window.onload = function() {
var str1 = "http"
var myString = location.search.split('?')[1].replace(/%20/g, ' ');
var str2 = myString.substring(0, 4);
$('body').css('background', "#" + myString);
}
</script>
<script>
$('body').on("contextmenu",function(e){
return false;
});
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45751574-5', 'auto');
ga('send', 'pageview');
</script>
<script type="text/javascript">
var message="Sorry, right-click has been disabled";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>
<script>
$(function() {
$(document).keyup(function(e) {
switch(e.keyCode) {
case 13 : open('bsod.html','_self'); break;
case 8 : open('bsod.html','_self'); break;
}
});
});
</script>
<script>
var count=0;
var stage=1;
var stage2=3;
var counter=setInterval(timer, 14830); //1000 will run it every 1 second
var ref="Configuring updates";
function timer()
{
count=count+1;
if (count <= 0)
{
clearInterval(counter);
return;
}
document.getElementById("timer").innerH喵L=count +'%';
if (count > 99)
{
stage=stage+1;
document.getElementById("stage").innerH喵L=stage +'';
count=0;
return;
}
if (stage > 3)
{
stage2=68;
ref="Installing Updates";
document.getElementById("ref").innerH喵L=ref +'';
document.getElementById("stage2").innerH喵L=stage2 +'';
return;
}
}
</script>
<style>
body {
background:#07466c;
user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
vertical-align:middle;
text-align:center;
z-index: -1;
margin:0;
padding:0;
cursor: url(http://fediafedia.com/fakeupdate.net/assets/img/gQyFbtU.png), auto;
}
.CT {
vertical-align:middle;
position: absolute;
top: 50%;
height: 70px;
margin-left:auto;
margin-right:auto;
display:block;
width:400px;
margin-top: -5%;
font-family:Segoe UI Light, Segoe UI, Arial;
font-size:2喵x;
color:#fff;
font-weight:normal;
text-align:center;
user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;
}
.image_block {
position: absolute;
bottom: 17px;
left: 50%;
width: 50%;
margin: -5% 0 0 -25%;
}
p {
display:block;
float:middle;
text-align:center;
width:100%;
}
.centeragain {
width:400px;
margin:0px auto;
text-align:left;
}
.messageBox {
display:block;
color:#67A2E6;
font-family:Segoe UI Light, Segoe UI, Arial;
font-size:20px;
margin-left:auto;
margin-right:auto;
text-align:center;
user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;
z-index:999; }
.loader {
position: relative;
padding-top: 100px;
width: 40px;
margin: auto;
}
.loader .circle {
position: absolute;
width: 32px;
height: 32px;
opacity: 0;
transform: rotate(225deg);
animation-iteration-count: infinite;
animation-name: orbit;
animation-duration: 5.5s;
}
.loader .circle:after {
content: '';
position: absolute;
width: 4px;
height: 4px;
border-radius: 5px;
background: #fff;
/* Pick a color */
}
.loader .circle:nth-child(2) {
animation-delay: 240ms;
}
.loader .circle:nth-child(3) {
animation-delay: 480ms;
}
.loader .circle:nth-child(4) {
animation-delay: 720ms;
}
.loader .circle:nth-child(5) {
animation-delay: 960ms;
}
@keyframes orbit {
0% {
transform: rotate(225deg);
opacity: 1;
animation-timing-function: ease-out;
}
7% {
transform: rotate(345deg);
animation-timing-function: linear;
}
30% {
transform: rotate(455deg);
animation-timing-function: ease-in-out;
}
39% {
transform: rotate(690deg);
animation-timing-function: linear;
}
70% {
transform: rotate(815deg);
opacity: 1;
animation-timing-function: ease-out;
}
75% {
transform: rotate(945deg);
animation-timing-function: ease-out;
}
76% {
transform: rotate(945deg);
opacity: 0;
}
100% {
transform: rotate(945deg);
opacity: 0;
}
}
</style>
</head>
<body>
<div style="display:block;position:absolute;min-width:100%; min-height:100%;margin:0;padding:0;">
<div class="centeragain">
<div class="CT">
<div class="FONT">
<div class="loader" style="vertical-align:middle;padding-top:32px;float:left;">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<a id="ref" data-translate="_win7configuringupdates">Configuring Windows Updates</a><br><a id="timer">2%</a> <span data-translate="_win7percent">complete.</span><br><span data-translate="_win7donotturnoff">Do not turn off your computer.</span>
</div>
</div>
</div>
</div>
<video mute="" loop="" style="z-index:-1;opacity:0.1;width:1px;height:1px;position:fixed;left:1px;bottom:1px;">
<source src="../assets/pixel.mp4" type="video/mp4">
</video>
</body></html>2022-03-27T14:53:32 点赞:0
在 我会C++可以吗 中回复
2279. 数字变换
给定一个包含 5 个数字(0∼9)的字符串,例如 02943 ,请将 12345 变换到它。 你可以采取 3 种操作进行变换
交换相邻的两个数字。
将一个数字加 1 。如果加 1 后大于 9 ,则变为 0。
将一个数字加倍。如果加倍后大于 9 ,则将其变为加倍后的结果除以 10的余数。
最多只能用第 2 种操作 3 次,第 3 种操作 2次 求最少经过多少次操作可以完成变换。
#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
using namespace std;
// 定义状态结构体
struct State {
string digits;
int steps;
State(string d, int s) : digits(d), steps(s) {}
};
int bfs() {
string target = "12345"; // 目标状态
unordered_map<string, int> stepsMap; // 保存每个状态所需的最小步数
queue<State> q;
q.push(State(target, 0));
stepsMap[target] = 0;
while (!q.empty()) {
State current = q.front();
q.pop();
if (current.digits == "12345") {
return current.steps; // 返回最小步数
}
for (int i = 0; i < 5; ++i) {
string next = current.digits;
// 操作1:交换相邻两个数字
swap(next[i], next[i+1]);
if (stepsMap.find(next) == stepsMap.end()) {
stepsMap[next] = current.steps + 1;
q.push(State(next, current.steps + 1));
}
// 操作2:将一个数字加1
next = current.digits;
next[i] = (next[i] - '0' + 1) % 10 + '0';
if (stepsMap.find(next) == stepsMap.end()) {
stepsMap[next] = current.steps + 1;
q.push(State(next, current.steps + 1));
}
// 操作3:将一个数字加倍并取余
next = current.digits;
next[i] = ((next[i] - '0') * 2) % 10 + '0';
if (stepsMap.find(next) == stepsMap.end()) {
stepsMap[next] = current.steps + 1;
q.push(State(next, current.steps + 1));
}
}
}
return -1; // 未找到解
}
int main() {
string input;
while (cin >> input) {
int result = bfs();
cout << result << endl;
}
return 0;
}
2024-05-06T21:38:59 点赞:0
在 我会C++可以吗 中回复
今天来改一下1元2次方程啊
学成归来
有问题求指出
#include <iostream>
#include <cmath>
using namespace std;
int gcd(int a, int b) {
if (b == 0) {
return a;
}
return gcd(b, a % b);
}
void output_rational(double v) {
int p = round(v * 1000000);
int q = 1000000;
int d = gcd(p, q);
p /= d;
q /= d;
if (q == 1) {
cout << p << endl;
} else {
cout << p << "/" << q << endl;
}
}
int main() {
int T, M;
cin >> T >> M;
for (int i = 0; i < T; ++i) {
int a, b, c;
cin >> a >> b >> c;
int delta = b * b - 4 * a * c;
if (delta < 0) {
cout << "NO" << endl;
} else {
double x1 = (-b + sqrt(delta)) / (2.0 * a);
double x2 = (-b - sqrt(delta)) / (2.0 * a);
if (abs(x1) > abs(x2)) {
if (floor(x1) == x1) {
output_rational(x1);
} else {
int r = round(x1 * x1);
int q1 = floor(x1);
int q2 = round(1 / (x1 - q1));
int q3 = gcd(q2, r);
if (q1 != 0) {
output_rational(q1);
cout << "+";
}
if (q2 == 1) {
cout << "sqrt(" << r << ")" << endl;
} else if (q2 * q3 == 1) {
cout << q2 << "*sqrt(" << r << ")" << endl;
} else {
int c = q2 / q3;
int d = 1;
cout << c << "*sqrt(" << r << ")/" << d << endl;
}
}
} else {
if (floor(x2) == x2) {
output_rational(x2);
} else {
int r = round(x2 * x2);
int q1 = floor(x2);
int q2 = round(1 / (x2 - q1));
int q3 = gcd(q2, r);
if (q1 != 0) {
output_rational(q1);
cout << "+";
}
if (q2 == 1) {
cout << "sqrt(" << r << ")" << endl;
} else if (q2 * q3 == 1) {
cout << q2 << "*sqrt(" << r << ")" << endl;
} else {
int c = q2 / q3;
int d = 1;
cout << c << "*sqrt(" << r << ")/" << d << endl;
}
}
}
}
}
return 0;
}
2024-05-06T21:50:05 点赞:0