Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
133902 baim. 分发饼干 C++ 编译错误 0 0 MS 0 KB 575 2024-03-02 10:27:15

Tests(0/0):


#include<bits/stdc++.h> using namespace std; int findContentChildren(vector<int>& g, vector<int>& s) { sort(g.begin(), g.end()); sort(s.begin(), s.end()); int m = g.size(), n = s.size(); int count = 0; for (int i = 0, j = 0; i < m && j < n; i++, j++) { while (j < n && g[i] > s[j]) { j++; } if (j < n) { count++; } } return count; } int main(){ int a,b; cin>>a>>b; cout<<findContentChildren(a,b); }


测评信息: