Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2)
 #include <bits/stdc++.h>
 using namespace std;

 int n,m,k;
 ;

 int main()
 {
     cin>>n>>m>>k;
     ;i<=k-;++i) {
         sum+=(n+(m-))*-(i)*;
     }
     cout<<sum<<endl;
 }

A - Golden Plate

一个三维数组确定一条路径,直接搜就行

 #include<bits/stdc++.h>
 #include<iostream>
 #include<cstdio>
 #include<cstdlib>
 #include<cstring>
 #include<cmath>
 #include<algorithm>
 #include<queue>
 #include<vector>
 #include<map>
 #define lson i<<1
 #define rson i<<1|1
 #define LS l,mid,lson
 #define RS mid+1,r,rson
 #define mem(a,x) memset(a,x,sizeof(a))
 #define gcd(a,b) __gcd(a,b)
 #define ll long long
 #define ull unsigned long long
 #define lowbit(x) (x&-x)
 #define pb(x) push_back(x)
 #define enld endl
 #define mian main
 #define itn int
 #define prinft printf
 #pragma GCC optimize(2)
 //#pragma comment(linker, "/STACK:102400000,102400000")

 const double PI = acos (-1.0);
 const int INF = 0x3f3f3f3f;
 ;
 ;
 ;
 ;

 using namespace std;

 int n,cnt,temp;
 int a[MAXN],b[MAXN],ans[MAXN];
 //int a,b;
 ][][];

 void init() {
     mem(t,-);
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
     t[][][]=,t[][][]=;
 }

 int main() {
     std::ios::sync_with_stdio(false);
     cin.tie(NULL);
     init();
     while(cin>>n) {
         mem(ans,-);
         ; i<=n-; ++i) {
             cin>>a[i];
         }
         ; i<=n-; ++i) {
             cin>>b[i];
         }
         ; i<=; ++i) {
             temp=i;
             cnt=;
             ans[++cnt]=temp;
             ; j<=n-; ++j) {
                 //cerr<<'#'<<a[j]<<' '<<b[j]<<' '<<temp<<' '<<t[a[j]][b[j]][temp]<<endl;
                 ) {
                     temp=t[a[j]][b[j]][temp];
                     ans[++cnt]=temp;
                 } else {
                     cnt=;
                     break;
                 }
             }
             if(cnt==n)
                 break;
         }
         if(cnt==n) {
             cout<<"YES"<<endl;
             ; i<=n; ++i) {
                 )
                     cout<<' ';
                 cout<<ans[i];
             }
             cout<<endl;
         } else
             cout<<"NO"<<endl;
     }

     ;
 }

B - Curiosity Has No Limits

二分+贪心(只要n在a+b的范围内,所有的数都可以放进去)

 #include<bits/stdc++.h>
 #include<iostream>
 #include<cstdio>
 #include<cstdlib>
 #include<cstring>
 #include<cmath>
 #include<algorithm>
 #include<queue>
 #include<vector>
 #include<map>
 #define lson i<<1
 #define rson i<<1|1
 #define LS l,mid,lson
 #define RS mid+1,r,rson
 #define mem(a,x) memset(a,x,sizeof(a))
 #define gcd(a,b) __gcd(a,b)
 #define ll long long
 #define ull unsigned long long
 #define lowbit(x) (x&-x)
 #define pb(x) push_back(x)
 #define enld endl
 #define mian main
 #define itn int
 #define prinft printf
 #pragma GCC optimize(2)
 //#pragma comment(linker, "/STACK:102400000,102400000")

 const double PI = acos (-1.0);
 const int INF = 0x3f3f3f3f;
 ;
 ;
 ;
 ;

 using namespace std;

 ll a,b,n,m;

 bool check(ll m) {
     )/>(a+b))
         return true;
     else
         return false;
 }

 ll ans1[MAXN],ans2[MAXN];

 int main() {
     //std::ios::sync_with_stdio(false);
     //cin.tie(NULL);

     while(cin>>a>>b) {
         ll l=-,r=*sqrt(a+b);
         ; i<=; ++i) {
             m=(l+r)/;
             if(check(m))
                 r=m-;
             else
                 n=m,l=m+;
         }
         cerr<<n<<endl;
         ll cnt1=,cnt2=;
         ; i--) {
             if(i<=a) {
                 ans1[++cnt1]=i;
                 a-=i;
             } else {
                 ans2[++cnt2]=i;
                 b-=i;
             }
         }

         cout<<cnt1<<endl;
         ; i<=cnt1; ++i) {
             )
                 cout<<' ';
             cout<<ans1[i];
         }
         cout<<endl<<cnt2<<endl;
         ; i<=cnt2; ++i) {
             )
                 cout<<' ';
             cout<<ans2[i];
         }
         cout<<endl;

     }

     ;
 }

C - Cram Time

Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2)的更多相关文章

  1. Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2) D. Minimum path

    http://codeforces.com/contest/1072/problem/D bfs 走1步的最佳状态 -> 走2步的最佳状态 -> …… #include <bits/ ...

  2. Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2) D. Minimum path(字典序)

    https://codeforces.com/contest/1072/problem/D 题意 给你一个n*n充满小写字母的矩阵,你可以更改任意k个格子的字符,然后输出字典序最小的从[1,1]到[n ...

  3. Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2)D(思维,DP,字符串)

    #include<bits/stdc++.h>using namespace std;char c[2007][2007];char ans[4007];int s[2007][2007] ...

  4. (AB)Codeforces Round #528 (Div. 2, based on Technocup 2019 Elimination Round

    A. Right-Left Cipher time limit per test 1 second memory limit per test 256 megabytes input standard ...

  5. Codeforces Round #528 (Div. 2, based on Technocup 2019 Elimination Round 4) C. Connect Three 【模拟】

    传送门:http://codeforces.com/contest/1087/problem/C C. Connect Three time limit per test 1 second memor ...

  6. Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) C. Vasya and Golden Ticket 【。。。】

    任意门:http://codeforces.com/contest/1058/problem/C C. Vasya and Golden Ticket time limit per test 1 se ...

  7. Codeforces Round #512 (Div. 2, based on Technocup 2019 Elimination Round 1) E. Vasya and Good Sequences(DP)

    题目链接:http://codeforces.com/contest/1058/problem/E 题意:给出 n 个数,对于一个选定的区间,区间内的数可以通过重新排列二进制数的位置得到一个新的数,问 ...

  8. Codeforces Round #522 (Div. 2, based on Technocup 2019 Elimination Round 3)B. Personalized Cup

    题意:把一长串字符串 排成矩形形式  使得行最小  同时每行不能相差大于等于两个字符 每行也不能大于20个字符 思路: 因为使得行最小 直接行从小到大枚举即可   每行不能相差大于等于两个字符相当于  ...

  9. Codeforces Round #522 (Div. 2, based on Technocup 2019 Elimination Round 3) C. Playing Piano

    题意:给出一个数列 a1 a2......an  让你构造一个序列(该序列取值(1-5)) 如果a(i+1)>a(i) b(i+1)>b(i) 如果a(i+1)<a(i)  那么b( ...

随机推荐

  1. bzoj千题计划209:bzoj1185: [HNOI2007]最小矩形覆盖

    http://www.lydsy.com/JudgeOnline/problem.php?id=1185 题解去看它 http://www.cnblogs.com/TheRoadToTheGold/p ...

  2. AngularJS 启程

    <!DOCTYPE html> <html lang="en" ng-app> <head> <meta charset="UT ...

  3. [C]语法, 知识点总结(二. 结构体, 类别名, static, const)

    结构体 定义: struct Student{ // 定义结构体Student, stu是创建的对象         char a[17]; // 结构体里面可以有多种不同类型的变量         ...

  4. CSS的力量:用一个DIV画图

    这些图片都是用一个DIV绘制出来的,其实原理并不复杂. 这些图片都是由CSS绘制出来的,通过background-image叠加实现, 如蘑菇头的实现,通过 radial-gradient 径向渐变  ...

  5. nodejs图片总结

    今天终于把朴灵老师写的<深入浅出Node.js>给学习完了, 这本书不是一本简单的Node入门书籍,它没有停留在Node介绍或者框架.库的使用层面上,而是从不同的视角来揭示Node自己内在 ...

  6. 【51Nod】1519 拆方块 贪心+递推

    [题目]1519 拆方块 [题意]给定n个正整数,\(A_i\)表示第i堆叠了\(A_i\)个石子.每轮操作将至少有一面裸露的石子消除,问几轮所有石子均被消除.\(n \leq 10^5\). [算法 ...

  7. 20155321 2016-2017-2 《Java程序设计》第五周学习总结

    20155321 2016-2017-2 <Java程序设计>第五周学习总结 教材学习内容总结 第八章 异常处理 Java提供特有的语句进行处理 try { 需要被检测的代码; } cat ...

  8. header()跳转

    if ($toNews == 1) { header('Location:/ucenter/pageMailBox/2'); exit; } PHP跳转页面,用 header() 函数 定义和用法 h ...

  9. Sql语句 表中相同的记录(某个字段)只显示一条,按照时间排序显示最大或最小

    原始表数据:

  10. ARMCC和GCC编译ARM代码的软浮点和硬浮点问题【转】

    转自:https://blog.csdn.net/hunanchenxingyu/article/details/47003279 本文介绍了ARM代码编译时的软浮点(soft-float)和硬浮点( ...