网站建设三方合同范本,35互联做网站,编程网站有哪些,wordpress 文件不刷新e/f/j
e:#xff0c;#xff0c;#xff0c;一道e题卡我2个多h#xff0c;幸好之后去写i题了#xff0c;不然就完了╥﹏╥...
E-Tokitsukaze and Eliminate (easy)_2024牛客寒假算法基础集训营2 (nowcoder.com)
我的思路#xff1a;倒过来看不同个数再考虑一下1212这样…e/f/j
e:一道e题卡我2个多h幸好之后去写i题了不然就完了╥﹏╥...
E-Tokitsukaze and Eliminate (easy)_2024牛客寒假算法基础集训营2 (nowcoder.com)
我的思路倒过来看不同个数再考虑一下1212这样的情况
//非ac代码有错误f应该初始化为n,因为,如果是
//1111这样,由题意知肯定是4次,,,痛苦,,就这一步没考虑卡了2h不说考试的时候还没对,,,特殊情
//况要考虑全面#includebits/stdc.h
using namespace std;
const int N2e55;
const int inf0x3f3f3f3f;
#define int long long
int a[N];
void solve()
{int t;cint;while(t--){int n,cn0,f0;cinn;if(n1){cout1\n;continue;}for(int i0;in;i){cina[i];}for(int in-2;i0;i--){if(a[i]!a[i1]){cn;if(i1)a[i]a[i-1];fi;}}cnf;coutcn\n;}
}
signed main()
{ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);solve();return 0;
}
这样之后才66.67/100
之后看和我思路差不多的代码才发现╥﹏╥...f初始值的问题好好好我是笨蛋
╥﹏╥...
ac代码
#includebits/stdc.h
using namespace std;
const int N2e55;
const int inf0x3f3f3f3f;
#define int long long
int a[N]{};
void solve()
{int t;cint;while(t--){int n,cn0;cinn;for(int i0;in;i){cina[i];}int fn;for(int in-2;i0;i--){if(a[i1]!a[i]){cn;if(i1)a[i]a[i-1];fi;}}coutcnfendl;}
}
signed main()
{ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);solve();return 0;
}
j:
也是找规律的题和i题差不多就是最后时间不够了╥﹏╥...e题再说一次写题的时候先要考虑特殊情况不行还是加我模板上吧 //fkue(彭)的模板
//写题的时候要注意1特殊情况,2注意是多次还是一次
/****** __----~~~~~~~~~~~------___* . . ~~//...... __--~ ~~* -. \_|// |||\\ ~~~~~~::::... /~* ___-_ _-~o~ \/ ||| \\ _/~~-* __---~~~.~||\_ -_--~/_-~|- |\\ \\ _/~* _-~~ .~ | \\-_ -~7 /- / || \ /* .~ .~ | \\ -_ / /- / || \ /* / ____ / | \\ ~-_/ /|- _/ .|| \ /* |~~ ~~|--~~~~--_ \ ~-/ | \~--~~ .\* ~-| /| |-~\~~ __--~~* |-~~-_/ | | ~\_ _-~ /\* / \ \__ \/~ \__* _--~ _/ | .-~~____--~-/ ~~.* ((-/~ .||| -_| ~~-/ , . _||* -_ ~\ ~~---l__i__i__i--~~_/* _-~-__ ~) \--______________--~~* //.-~~~-~_--~- |-------~~~~~~~~* //.-~~~--\* 神兽保佑* 代码无BUG!*//* 标准键盘布局
┌───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┬───┐ ┌───┬───┬───┐
│Esc│ │ F1│ F2│ F3│ F4│ │ F5│ F6│ F7│ F8│ │ F9│F10│F11│F12│ │P/S│S L│P/B│ ┌┐ ┌┐ ┌┐
└───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┴───┘ └───┴───┴───┘ └┘ └┘ └┘
┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ ┌───┬───┬───┐ ┌───┬───┬───┬───┐
│~ │! 1│ 2│# 3│$ 4│% 5│^ 6│ 7│* 8│( 9│) 0│_ -│ │ BacSp │ │Ins│Hom│PUp│ │N L│ / │ * │ - │
├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ ├───┼───┼───┤ ├───┼───┼───┼───┤
│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │{ [│} ]│ | \ │ │Del│End│PDn│ │ 7 │ 8 │ 9 │ │
├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ └───┴───┴───┘ ├───┼───┼───┤ │
│ Caps │ A │ S │ D │ F │ G │ H │ J │ K │ L │: ;│ │ Enter │ │ 4 │ 5 │ 6 │ │
├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ ┌───┐ ├───┼───┼───┼───┤
│ Shift │ Z │ X │ C │ V │ B │ N │ M │ ,│ .│? /│ Shift │ │ ↑ │ │ 1 │ 2 │ 3 │ │
├─────┬──┴─┬─┴──┬┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ ┌───┼───┼───┐ ├───┴───┼───┤ E││
│ Ctrl│ │Alt │ Space │ Alt│ │ │Ctrl│ │ ← │ ↓ │ → │ │ 0 │ . │←─┘│
└─────┴────┴────┴───────────────────────┴────┴────┴────┴────┘ └───┴───┴───┘ └───────┴───┴───┘
*/
#includebits/stdc.h
using namespace std;
const int N2e55;
const int inf0x3f3f3f3f;
#define int long long
void solve()
{}
signed main()
{ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int t;cint;//t1;while(t--){solve();}return 0;
}
j:
#includebits/stdc.h
using namespace std;
const int N2e55;
const int inf0x3f3f3f3f;
#define int long long
int a[N];
void solve()
{int n,cn0;cinn;for(int i1;in;i)cina[i];sort(a1,a1n);for(int i1;in;i){cnmin(2*a[i],4*a[1])*(n-i);}cout2*cnendl;
}
signed main()
{ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);int t;cint;//t1;while(t--){solve();}return 0;
}
f待续。