Educationnal Codeforces Round 41

This blog post discusses the problems from the Educationnal Codeforces Round 41, covering topics such as Tetris-inspired puzzles, prefix sums in Lecture Sleep, chessboard strategies in ChessBoard, line intersection in Pair Of Lines using vector algebra, and data structure analysis in Tufurama." 53888210,5718616,Android高仿微信实践:摇一摇功能实现,"['Android UI', '微信功能仿造', '用户交互']
摘要由CSDN通过智能技术生成

被教育场。。
A.Tetris
类似俄罗斯方块

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define CLR(a) memset(a, 0, sizeof(a))
#define DBG(x) cout<<(#x)<<"="<<x<<endl
#define FOR(i, a, b)  for(int i=(a); i<(b); i++)
#define REP(i, a, b)  for(int i=(a); i<=(b); i++)
#define DOWN(i, a, b) for(int i=(a); i>=(b); i--)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const ll mod = 1000000009;
const int N= 1e6 +10;

int n, m;
int ans=INF;
int col, a[N];

int main() {
    cin>>n>>m;
    REP(i, 1, m) {
        cin>>col;
        a[col]++;
    }
    REP(i, 1, n) {
        ans=min(ans, a[i]);
    }
    cout<<ans<<endl;
    //cout<<1.*clock()/CLOCKS_PER_SEC<<"ms"<<"\n";
    return 0;
}

B.Lecture Sleep
前缀和

#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define CLR(a) memset(a, 0, sizeof(a))
#define DBG(x) cout<<(#x)<<"="<<x<<endl
#define FOR(i, a, b)  for(int i=(a); i<(b); i++)
#define REP(i, a, b)  for(int i=(a); i<=(b); i&#
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值