第一次AK的ABC

虽然题非常简单

但是值得纪念一下

T1

一道很水的题

不存在做法

纯粹乱跑

但是我把Yes打成YES了,哭唧唧

  1. #include <cstdio>
  2. #include <algorithm>
  3. #include <cstring>
  4. using namespace std;
  5. int main(){
  6. int a,b;
  7. scanf("%d %d",&a,&b);
  8. if((*a*b)%==||(*a*b)%==||(*a*b)%==)
  9. printf("Yes\n");
  10. else
  11. printf("No\n");
  12. return ;
  13. }

T2

就是普通的判重和模拟

stl真好用

  1. #include <cstdio>
  2. #include <algorithm>
  3. #include <cstring>
  4. #include <string>
  5. #include <set>
  6. #include <iostream>
  7. using namespace std;
  8. int n;
  9. set<string> s;
  10. string a;
  11. char lat;
  12. int main(){
  13. scanf("%d",&n);
  14. for(int i=;i<=n;i++){
  15. cin>>a;
  16. if(s.count(a)){
  17. printf("No\n");
  18. return ;
  19. }
  20. if(i>&&a[]!=lat){
  21. printf("No\n");
  22. return ;
  23. }
  24. lat=a[a.length()-];
  25. s.insert(a);
  26. }
  27. printf("Yes\n");
  28. return ;
  29. }

T3

有趣的GCD应用

秒掉

  1. #include <cstdio>
  2. #include <cstring>
  3. #include <algorithm>
  4. #define int long long
  5. using namespace std;
  6. int n,x,pos[];
  7. int gcd(int a,int b){
  8. return (b==)?a:gcd(b,a%b);
  9. }
  10. signed main(){
  11. scanf("%lld %lld",&n,&x);
  12. for(int i=;i<=n;i++)
  13. scanf("%lld",&pos[i]);
  14. for(int i=;i<=n;i++)
  15. pos[i]-=x;
  16. ++n;
  17. pos[n]=;
  18. sort(pos+,pos+n+);
  19. int ans=pos[]-pos[];
  20. for(int i=;i<=n-;i++){
  21. ans=gcd(ans,pos[i+]-pos[i]);
  22. }
  23. printf("%lld",ans);
  24. return ;
  25. }

T4

乍一看不好做其实很水的构造

  1. #include <cstdio>
  2. #include <algorithm>
  3. #include <cstring>
  4. #define int long long
  5. using namespace std;
  6. int mat[][],mat2[][],ans=;
  7. int h,w;
  8. signed main(){
  9. scanf("%lld %lld",&h,&w);
  10. for(int i=;i<=h;i++)
  11. for(int j=;j<=w;j++)
  12. scanf("%lld",&mat[i][j]),mat2[i][j]=mat[i][j];
  13. for(int i=;i<=h;i++)
  14. for(int j=;j<=w-;j++){
  15. if(mat2[i][j]%==)
  16. continue;
  17. else{
  18. ans++;
  19. mat2[i][j+]++;
  20. mat2[i][j]--;
  21. }
  22. //ans+=mat2[i][j],mat2[i][j+1]+=mat2[i][j],mat2[i][j]=0;
  23. }
  24. for(int i=;i<=h-;i++){
  25. //ans+=mat2[i][w],mat2[i+1][w]+=mat2[i][w],mat2[i][w]=0;
  26. if(mat2[i][w]%==)
  27. continue;
  28. else{
  29. ans++;
  30. mat2[i+][w]++;
  31. mat2[i][w]--;
  32. }
  33. }
  34. printf("%lld\n",ans);
  35. for(int j=;j<=h;j++)
  36. for(int i=;i<=w-;i++){
  37. if(mat[j][i]%==)
  38. continue;
  39. else{
  40. printf("%lld %lld %lld %lld\n",j,i,j,i+);
  41. mat[j][i+]++;
  42. mat[j][i]--;
  43. }
  44. // for(int k=1;k<=mat[j][i];k++){
  45. // printf("%d %d %d %d\n",j,i,j,i+1);
  46. // mat[j][i+1]+=1;
  47. // }
  48. // mat[j][i]=0;
  49. }
  50. for(int i=;i<=h-;i++){
  51. if(mat[i][w]%==)
  52. continue;
  53. else{
  54. mat[i+][w]++;
  55. mat[i][w]--;
  56. printf("%lld %lld %lld %lld\n",i,w,i+,w);
  57. }
  58. }
  59. // for(int k=1;k<=mat[i][w];k++)
  60. // printf("%d %d %d %d\n",i,w,i+1,w),mat[i+1][w]++;
  61. return ;
  62. }

比赛总结——atcoder beginner contest 109的更多相关文章

  1. 2018.09.08 AtCoder Beginner Contest 109简要题解

    比赛传送门 水题大赛? 全是水题啊!!! T1 ABC333 就是判断是不是两个数都是奇数就行了. 代码: #include<bits/stdc++.h> using namespace ...

  2. AtCoder Beginner Contest 053 ABCD题

    A - ABC/ARC Time limit : 2sec / Memory limit : 256MB Score : 100 points Problem Statement Smeke has ...

  3. AtCoder Beginner Contest 154 题解

    人生第一场 AtCoder,纪念一下 话说年后的 AtCoder 比赛怎么这么少啊(大雾 AtCoder Beginner Contest 154 题解 A - Remaining Balls We ...

  4. AtCoder Beginner Contest 161

    比赛链接:https://atcoder.jp/contests/abc161/tasks AtCoder Beginner Contest 161 第一次打AtCoder的比赛,因为是日本的网站终于 ...

  5. AtCoder Beginner Contest 224

    AtCoder Beginner Contest 224 A - Tires 思路分析: 判断最后一个字符即可. 代码如下: #include <bits/stdc++.h> using ...

  6. AtCoder Beginner Contest 184 题解

    AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - S ...

  7. AtCoder Beginner Contest 169 题解

    AtCoder Beginner Contest 169 题解 这场比赛比较简单,证明我没有咕咕咕的时候到了! A - Multiplication 1 没什么好说的,直接读入两个数输出乘积就好了. ...

  8. AtCoder Beginner Contest 148 题解

    目录 AtCoder Beginner Contest 148 题解 前言 A - Round One 题意 做法 程序 B - Strings with the Same Length 题意 做法 ...

  9. AtCoder Beginner Contest 100 2018/06/16

    A - Happy Birthday! Time limit : 2sec / Memory limit : 1000MB Score: 100 points Problem Statement E8 ...

随机推荐

  1. hdu1757 构造矩阵

    Lele now is thinking about a simple function f(x). If x < 10 f(x) = x.If x >= 10 f(x) = a0 * f ...

  2. Solid Dominoes Tilings (轮廓线dp打表 + 容器)

    第一步先打一个表,就是利用轮廓线DP去打一个没有管有没有分界线组合数量的表 #include<bits/stdc++.h> using namespace std; ; <<; ...

  3. uva 11183 Teen Girl Squad

    题意: 有一个女孩,需要打电话让所有的人知道一个消息,消息可以被每一个知道消息的人传递. 打电话的关系是单向的,每一次电话需要一定的花费. 求出打电话最少的花费或者判断不可能让所有人知道消息. 思路: ...

  4. mybatis源码解析4---Configuration解析

    Configuration类解析 Configuration类位于mybatis包的org.apache.ibatis.session目录下,是mybatis的全局变量,属性就是对应于mybatis的 ...

  5. Flask的请求对象--request

    request-Flask的请求对象 请求解析和响应封装大部分是有Werkzeug完成的,Flask子类化Werkzeug的请求(Request)对象和响应(Response)对象,并添加了和程序的特 ...

  6. 禁用HTTP.sys,导致80端口被禁用和IIS服务无法启动解决办法

    由于端口被占用,使用 win+r 运行 cmd 输入netstat -ano 可以看到端口被PIF 4占用,可以找到对应的进程NT kernel& System 该进程是Http.sys,是h ...

  7. WebStorm: The Smartest JavaScript IDE by JetBrains

    WebStorm: The Smartest JavaScript IDE by JetBrains https://www.jetbrains.com/webstorm/?fromMenu

  8. scss简单用法

  9. MySQL性能测试工具sysbench的安装和使用

    sysbench是一个开源的.模块化的.跨平台的多线程性能测试工具,可以用来进行CPU.内存.磁盘I/O.线程.数据库的性能测试.目前支持的数据库有MySQL.Oracle和PostgreSQL.当前 ...

  10. 通过数组和枚举简化GPIO操作编码(转)

    源: 通过数组和枚举简化GPIO操作编码