delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

33
2.120.cpp Normal file
View File

@ -0,0 +1,33 @@
#include<iostream>
#include<cstdio>
#include<sstream>
#include<algorithm>
using namespace std;
int n;
int a[35];
void flip(int p)
{
for(int i=0;i<p-i;i++)
swap(a[i],a[p-i]);
printf("%d ",n-p);
}
int main()
{
string s;
while(getline(cin, s))
{
cout<<s<<endl;
stringstream ss(s);
n=0;
while(ss>>a[n]) n++;
for(int i=n-1;i>=0;i--)
{
int p=max_element(a,a+i+1)-a;
if(i==p) continue;
if(p>0) flip(p);
flip(i);
}
printf("0\n");
}
return 0;
}