目录

博主赛情

网站链接

比赛简介

Contest Information

Reason why freee needs AtCoder users

freee's business content that can utilize the abilities cultivated at AtCoder

About freee's competitive programming club

Point Values

Contest Rules

Useful Links

题目讲解

A - "atcoder".substr()

原题描述

题目大意

题目思路

题目代码

相关知识

B - Nice Grid

原题描述

题目大意

题目思路

题目代码

相关知识

C - Matrix Reducing

原题描述

题目大意

题目思路

题目代码

相关知识

D - "redocta".swap(i,i+1)

原题描述

题目大意

题目思路

题目代码

相关知识

比赛总结


博主赛情

从244起,博主一直坚持打ABC,今天终于上千分了,特此纪念!(码龄仅一岁,勿喷!)

网站链接

freee Programming Contest 2022(AtCoder Beginner Contest 264) - AtCoder

比赛简介

Contest Information

  • Duration: 100 minutes
  • Rated Range: 0 - 1999

Contest Summary

This is an online programming contest sponsored by freee, Inc.

freee's mission is to 「Empower Small Businesses to Take Center Stage」 and we develop and provide services with the aim of building an "integrated management platform that allows anyone to run their business freely. We believe that small businesses, which can materialize their ideas boldly and with a sense of speed, can create various innovations and at the same time, stimulate large companies to create a new movement in the world as a whole.

Reason why freee needs AtCoder users

freee is a cloud-based ERP that stores customer's Accounting, Human Resources, and other business data and provides functions to improve business efficiency.

Records of daily transactions, time and attendance, etc. gradually become large volumes of data as the company grows, and the calculation efficiency must be considered in order to tabulate and present this information in real time. Tax and salary calculations also require the ability to translate complex specifications of laws that change from year to year into logic and accurately put them into code. In addition, since the complexity of each domain area is divided into microservices and loosely coupled so as not to affect others, data must be efficiently federated while maintaining consistency among the services.

We believe that AtCoder users' 「ability to select the appropriate data structure and algorithm for the problem」 and 「ability to implement quickly while considering edge cases」 will be of great help in these challenges. This time we are organizing a programming contest on AtCoder to meet AtCoder users who have such talent and to get them interested in freee.

freee's business content that can utilize the abilities cultivated at AtCoder

This section describes an example of freee's business content that can utilize the implementation skills cultivated with AtCoder, knowledge of data structures and algorithms, and ability to estimate the amount of calculation.

  • In the development of the common infrastructure, we are also developing microservices that handle tree structures such as the organizational hierarchy of a company.
  • Algorithms are used to structure real-world data, such as tracking changes in credit card statements over time or inferring transaction details from receipt images.
  • Various microservices have distributed system designs to maintain data integrity among other internal services.
  • In the development of infrastructure services, we are implementing libraries that provide common functions such as authentication and failover with only a small overhead.
  • At DBRE, we understand the internal implementation of each database from open source code and papers to determine optimal usage and deploy stable operations throughout the company.

If you are interested, please apply through the link below.

  • Job Description of Global engineering team
  • Mid-Career Recruitment List (Written in Japanese)
  • New Graduate Recruitment Page (Written in Japanese)
  • AtCoder Job offer page (Written in Japanese)

To learn more about freee's corporate culture, please see below.

  • freee Developers Hub (Written in Japanese)
  • freee Tech Night (Written in Japanese)

About freee's competitive programming club

freee launched the Competitive Programming Club in January 2022 as a club activity, and currently meets twice a week, mainly to discuss impressions and solutions to AtCoder contests held on Saturdays and Sundays. For more information, please see the article (Written in Japanese) about the club's activities. In recent activities other than impression battles, we are expanding the range of activities every day, such as holding an in-house programming contest in which the members were in charge of asking questions.

Read about holding an in-house programming contest here. (Written in Japanese)

Point Values

Task Score
A 100
B 200
C 300
D 400
E 500
F 500
G 600
Ex 600

Contest Rules

This contest is full-feedback (solutions are judged during the contest).
When you solve a problem, you get a score assigned to it. Competitors are ranked first by total scores, then by penalties. The penalties are computed as (the time you spend to get your current score) + (5 minutes) * (the number of incorrect attempts).

Useful Links

  • AtCoder top page
  • How to participate
  • Practice contest

题目讲解

A - "atcoder".substr()

原题描述

题目大意

打印字符串“atcoder”中的第l位到第r位之间的字符。

题目思路

从l循环到r,输出每一位。

题目代码

C++ (GCC 9.2.1) 100 1375 Byte AC 5 ms 3624 KB Detail
#include<bits/stdc++.h>
using namespace std;
int main(){cin.tie(0);ios::sync_with_stdio(0);string s="atcoder";int l,r; cin>>l>>r;for(int i=l;i<=r;i++) cout<<s[i-1];return 0;
}
//ACplease!!!/*  printf("                                                                          \n");printf("                                                                           \n");printf("       * * *               * * *             * * *             * * *            \n");printf("     *       *           *       *         *      *          *       *         \n");printf("    *        *          *         *       *        *        *         *        \n");printf("            *           *         *                *                  *      \n");printf("           *            *         *               *                  *     \n");printf("          *             *         *              *                  *       \n");printf("         *              *         *             *                  *            \n");printf("        *               *         *           *                  *            \n");printf("      *                  *       *          *                  *              \n");printf("    * * * * * * *          * * *          * * * * * * *      * * * * * * *    \n");                      \n");
*/    

相关知识

① string是C++、java、VB等编程语言中的字符串,字符串是一个特殊的对象,属于引用类型。 在java、C#中,String类对象创建后,字符串一旦初始化就不能更改,因为string类中所有字符串都是常量,数据是无法更改,由于string对象的不可变,所以可以共享。对String类的任何改变,都是返回一个新的String类对象。 C++标准库中string类以类型的形式对字符串进行封装,且包含了字符序列的处理操作。

② for循环是编程语言中一种循环语句,而循环语句由循环体及循环的判定条件两部分组成,其表达式为:for(单次表达式;条件表达式;末尾循环体){中间循环体;}。

B - Nice Grid

原题描述

题目大意

输出下图中第r行第c列的颜色(black或white)。

题目思路

方法1:找规律发现,max(abs(r-8),abs(c-8))%2为1时是black,反之是white。

方法2:手写前8行,后面循环复制,第i行=第16-i行。

题目代码

方法1:

C++ (GCC 9.2.1) 200 1392 Byte AC 5 ms 3664 KB Detail
#include<bits/stdc++.h>
using namespace std;
int main(){cin.tie(0);ios::sync_with_stdio(0);int r,c; cin>>r>>c;if(max(abs(r-8),abs(c-8))%2) puts("black");else puts("white");return 0;
}
//ACplease!!!/*  printf("                                                                          \n");printf("                                                                           \n");printf("       * * *               * * *             * * *             * * *            \n");printf("     *       *           *       *         *      *          *       *         \n");printf("    *        *          *         *       *        *        *         *        \n");printf("            *           *         *                *                  *      \n");printf("           *            *         *               *                  *     \n");printf("          *             *         *              *                  *       \n");printf("         *              *         *             *                  *            \n");printf("        *               *         *           *                  *            \n");printf("      *                  *       *          *                  *              \n");printf("    * * * * * * *          * * *          * * * * * * *      * * * * * * *    \n");                      \n");
*/    

方法2:

C++ (GCC 9.2.1) 200 1640 Byte AC 8 ms 3644 KB Detail
#include<bits/stdc++.h>
using namespace std;
int main(){cin.tie(0);ios::sync_with_stdio(0);string s[30];s[1]="000000000000000";s[2]="011111111111110";s[3]="010000000000010";s[4]="010111111111010";s[5]="010100000001010";s[6]="010101111101010";s[7]="010101000101010";s[8]="010101010101010";for(int i=9;i<=15;i++) s[i]=s[16-i];int r,c; cin>>r>>c;if(s[r][c-1]=='1') puts("white");else puts("black");return 0;
}
//ACplease!!!/*  printf("                                                                          \n");printf("                                                                           \n");printf("       * * *                * * *             * * *             * * *            \n");printf("     *       *           *       *         *      *          *       *         \n");printf("    *        *          *         *       *        *        *         *        \n");printf("            *           *         *                *                  *      \n");printf("           *            *         *               *                  *     \n");printf("          *             *         *              *                  *       \n");printf("         *              *         *             *                  *            \n");printf("        *               *         *           *                  *            \n");printf("      *                  *       *          *                  *              \n");printf("    * * * * * * *          * * *          * * * * * * *      * * * * * * *    \n");                      \n");
*/    

相关知识

① 函数max函数用于求向量或者矩阵的最大元素,或几个指定值中的最大值。MATLAB等高级编程语言中常用有三种形式:max(A)、max(A,B)、max(A,[],dim)。

② puts()函数的功能是用于输出一个字符串,其中括号内的参数是输出字符串的起始地址。 用来向标准输出设备(屏幕)写字符串并换行, 其调用格式为: puts(s);

puts(s) 等效于printf("%s\n",s),前提 :s是C风格字符串,最后以'\0'结尾。

说明:(1). puts()函数只能输出字符串, 不能输出数值或进行格式变换。 (2). 可以将字符串直接写入puts()函数中。如: puts("Hello, Turbo C2.0");

③ abs 函数是存在于多种编程语言(包括且不限于:C语言、C++、Fortran、Matlab、Pascal、Delphi、Visual Basic 和 VBA)中的一种用于求数据绝对值的函数。

C - Matrix Reducing

原题描述

题目大意

你有两个矩阵:矩阵a(h1×w1),矩阵b(h2×w2)。问能否删除一些行列(可以不删除),将a变成b。

题目思路

遇到a的某行或列不包含任何b里的元素,则删除该行或列。数据很小,时间很充裕,可以乱写循环。

题目代码

C++ (GCC 9.2.1) 300 3105 Byte AC 5 ms 3616 KB Detail
#include<bits/stdc++.h>
using namespace std;
int main(){cin.tie(0);ios::sync_with_stdio(0);long long h1,r1,h2,r2,a[20][20],b[20][20]; cin>>h1>>r1;long long h1t=h1,r1t=r1;for(long long i=1;i<=h1;i++) for(long long j=1;j<=r1;j++) cin>>a[i][j];cin>>h2>>r2;for(long long i=1;i<=h2;i++) for(long long j=1;j<=r2;j++) cin>>b[i][j];for(long long i=1;i<=h1t;i++){bool flag=1;for(long long j=1;j<=r1t;j++){for(long long k=1;k<=h2;k++) for(long long l=1;l<=r2;l++) if(b[k][l]==a[i][j]){flag=0;break;} if(!flag) break;}if(flag){h1--;for(long long j=1;j<=r1;j++) a[i][j]=0;}}int y=0,z=1;for(long long i=1;i<=h1t;i++){bool flag=0;for(long long j=1;j<=r1t;j++){if(a[i][j]){y++;a[z][y]=a[i][j];flag=1;}}if(flag) z++;y=0;}h1t=h1; r1t=r1;//cout<<h1<<" "<<r1<<endl;for(long long i=1;i<=r1t;i++){bool flag=1;for(long long j=1;j<=h1t;j++){for(long long k=1;k<=h2;k++) for(long long l=1;l<=r2;l++) if(b[k][l]==a[j][i]){flag=0;break;} if(!flag) break;}if(flag){r1--;for(long long j=1;j<=h1;j++) a[j][i]=0;}}/*for(long long i=1;i<=h1t;i++){for(long long j=1;j<=r1t;j++){cout<<a[i][j]<<" ";}cout<<endl;}*/y=0,z=1;for(long long i=1;i<=h1t;i++){bool flag=0;for(long long j=1;j<=r1t;j++){if(a[i][j]){y++;a[z][y]=a[i][j];flag=1;}}if(flag) z++;y=0;}if(h1<h2||r1<r2) cout<<"No";else{/*for(long long i=1;i<=h1t;i++){for(long long j=1;j<=r1t;j++){cout<<a[i][j]<<" ";}cout<<endl;}*/for(long long i=1;i<=h2;i++) for(long long j=1;j<=r2;j++) if(a[i][j]!=b[i][j]){cout<<"No";return 0;}cout<<"Yes";}return 0;
}
//ACplease!!!/*  printf("                                                                          \n");printf("                                                                           \n");printf("       * * *               * * *             * * *             * * *            \n");printf("     *       *           *       *         *      *          *       *         \n");printf("    *        *          *         *       *        *        *         *        \n");printf("            *           *         *                *                  *      \n");printf("           *            *         *               *                  *     \n");printf("          *             *         *              *                  *       \n");printf("         *              *         *             *                  *            \n");printf("        *               *         *           *                  *            \n");printf("      *                  *       *          *                  *              \n");printf("    * * * * * * *          * * *          * * * * * * *      * * * * * * *    \n");                      \n");
*/    

ps:博主不小心把w1和w2全写成r1和r2了……

相关知识

① 数组(Array)是有序的元素序列。若将有限个类型相同的变量的集合命名,那么这个名称为数组名。组成数组的各个变量称为数组的分量,也称为数组的元素,有时也称为下标变量。用于区分数组的各个元素的数字编号称为下标。数组是在程序设计中,为了处理方便, 把具有相同类型的若干元素按有序的形式组织起来的一种形式。 这些有序排列的同类数据元素的集合称为数组。数组是用于储存多个相同类型数据的集合。

② break语句,是中断当前循环,或和label一起使用,中断相关联的语句。

D - "redocta".swap(i,i+1)

原题描述

题目大意

字符串s是“atcoder”的一种排列,交换相邻两字符的位置是一种操作,求至少需要多少次操作可以让s变成“atcoder”。

题目思路

不需要贪心算法,只要按顺序把每个字母归位就是最少操作。

题目代码

C++ (GCC 9.2.1) 400 2161 Byte AC 8 ms 3616 KB Detail
#include<bits/stdc++.h>
using namespace std;
int main(){cin.tie(0);ios::sync_with_stdio(0);string s; cin>>s;int ans=0;for(int i=1;i<(int)s.size();i++){if(s[i]=='a'){for(int j=i;j>0;j--){swap(s[j],s[j-1]);ans++;}}}for(int i=2;i<(int)s.size();i++){if(s[i]=='t'){for(int j=i;j>1;j--){swap(s[j],s[j-1]);ans++;}}}for(int i=3;i<(int)s.size();i++){if(s[i]=='c'){for(int j=i;j>2;j--){swap(s[j],s[j-1]);ans++;}}}for(int i=4;i<(int)s.size();i++){if(s[i]=='o'){for(int j=i;j>3;j--){swap(s[j],s[j-1]);ans++;}}}for(int i=5;i<(int)s.size();i++){if(s[i]=='d'){for(int j=i;j>4;j--){swap(s[j],s[j-1]);ans++;}}}if(s[5]=='r'){swap(s[5],s[6]);ans++;}cout<<ans; return 0;
}
//ACplease!!!/*  printf("                                                                          \n");printf("                                                                           \n");printf("       * * *               * * *             * * *             * * *            \n");printf("     *       *           *       *         *      *          *       *         \n");printf("    *        *          *         *       *        *        *         *        \n");printf("            *           *         *                *                  *      \n");printf("           *            *         *               *                  *     \n");printf("          *             *         *              *                  *       \n");printf("         *              *         *             *                  *            \n");printf("        *               *         *           *                  *            \n");printf("      *                  *       *          *                  *              \n");printf("    * * * * * * *          * * *          * * * * * * *      * * * * * * *    \n");                      \n");
*/    

相关知识

① swap函数是计算机中的函数,在不同领域有不同的用法,但都是交换的意思。

比赛总结

这次比赛取得新的进步,博主挺满意的,下次向E题迈进,继续努力!

freee Programming Contest 2022(AtCoder Beginner Contest 264)A~D题详细讲解相关推荐

  1. freee Programming Contest 2022(AtCoder Beginner Contest 264) 题解 (A~D)

    A - "atcoder".substr() Time Limit: 2 sec / Memory Limit: 1024 MB Score : 100100100 points ...

  2. Caddi Programming Contest 2021(AtCoder Beginner Contest 193) 题解

    Caddi Programming Contest 2021(AtCoder Beginner Contest 193) A - Discount 打折浮点数除即可 B - Play Snuke 枚举 ...

  3. NEC Programming Contest 2021(AtCoder Beginner Contest 229) B - Hard Calculation

    题目链接:B - Hard Calculation (atcoder.jp) Problem Statement You are given positive integers A and B. Le ...

  4. Atcoder TOYOTA SYSTEMS Programming Contest 2021(AtCoder Beginner Contest 228) B - Takahashi‘s Secret

    题目链接:B - Takahashi's Secret (atcoder.jp) Problem Statement Takahashi has N friends. They have nickna ...

  5. Atcoder TOYOTA SYSTEMS Programming Contest 2021(AtCoder Beginner Contest 228) C - Final Day

    题目链接:C - Final Day (atcoder.jp) Problem Statement N students are taking a 4-day exam. There is a 300 ...

  6. KYOCERA Programming Contest 2021 (AtCoder Beginner Contest 200) A~E 题解

    ABC200/KYOCERA2021 A~E [A - Century](https://atcoder.jp/contests/abc200/tasks/abc200_a) 题目大意 输入格式 输出 ...

  7. Mynavi Programming Contest 2021 (AtCoder Beginner Contest 201) A~E 题解

    ABC201/Mynavi2021 A~E [A - Tiny Arithmetic Sequence](https://atcoder.jp/contests/abc201/tasks/abc201 ...

  8. NEC Programming Contest 2021 (AtCoder Beginner Contest 229)

    终于开始补提了 重点 : C, E的倒着算, F的染色,G的相邻的转换: B - Hard Calculation #include <iostream> #include <alg ...

  9. TOYOTA SYSTEMS Programming Contest 2021(AtCoder Beginner Contest 228) ABCD

    A 题意: 有一个开关,每天s点开,t点关(可能在第2天或第n天),判断x点时开着还是关着. 思路: 按照是否需要隔夜分个类. #include<bits/stdc++.h> using ...

  10. Caddi Programming Contest 2021(AtCoder Beginner Contest 193) F.Zebraness

    题目链接 Problem Statement We have a grid with N horizontal rows and N vertical columns. Let (i,j) denot ...

最新文章

  1. 动态卷积超进化!通道融合替换注意力,减少75%参数量且性能显著提升 | ICLR 2021
  2. java 覆盖和隐藏_Java覆盖和隐藏2
  3. 如何设置电脑自动登录系统?不用输入用户名和密码
  4. Cockroach DB 1.0发布
  5. redis集群搭建报错-(error) CLUSTERDOWN The cluster is down
  6. Bootstrap源码解读之栅格化篇
  7. 关于Tomcat文件下载中文名乱码现象
  8. MongoDB的基本概念与操作
  9. 谈谈分布式事务之一:SOA需要怎样的事务控制方式
  10. (转)git 忽略规则
  11. 【TSP】基于matlab GUI模拟退火+蚁群+遗传算法求解旅行商问题【含Matlab源码 1611期】
  12. HR:你为什么选择计算机这个行业?
  13. 移动光猫怎么设置虚拟服务器设置,移动光猫如何设置自带的WIFI无线功能
  14. 制作u盘winpe启动盘_U盘启动盘如何制作?图文教程详解!
  15. d954(D9546)
  16. Html设置超链接文字颜色
  17. Leetcode 32 最长合法括号子序列
  18. [ Java ] 实现两个数加减乘除的简易计算器
  19. Android_学习安卓必备网址
  20. 第三方支付-核心交易之商户结算设计

热门文章

  1. 安卓之百度地图定位图层显示方式
  2. vmware虚拟机安装ghost版xp-黑屏错误及解决方法
  3. DS期末复习卷(六)
  4. jmeter基础逻辑控制器之if控制器
  5. 复用形式之:委派(delegation)
  6. python爬取手机号段(电信199号段)
  7. python 长度为8-10位的用户密码 : 包含数字字母下划线 正则表达式(简单易懂,代码可以指运行)
  8. 2022-2028年全球及中国集成门极换向晶闸管(IGCT)行业投资前景分析
  9. 《ONAP技术详解与应用实践》中奖名单来了!
  10. 中台战略-第三章、全面解读中台