Skip to content

Commit c6fbcda

Browse files
Michael  ChenMichael  Chen
authored andcommitted
initial commit
0 parents  commit c6fbcda

File tree

834 files changed

+1229704
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

834 files changed

+1229704
-0
lines changed

.DS_Store

44 KB
Binary file not shown.

.idea/code.iml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/workspace.xml

Lines changed: 30 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.sublime-project

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"path": "/Users/chen.young/code/"
6+
}
7+
]
8+
}

222D/.DS_Store

6 KB
Binary file not shown.

222D/222D.sublime-project

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"path": "/Users/chen.young/code/222D"
6+
}
7+
]
8+
}

222D/ans

33.2 KB
Binary file not shown.

222D/ans.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include <bits/stdc++.h>
2+
using namespace std;
3+
4+
typedef long long ll;
5+
typedef pair<int, int> pii;
6+
7+
#define mp make_pair
8+
#define pb push_back
9+
int nums[100005];
10+
int main() {
11+
#ifdef LOCAL
12+
freopen("input.txt", "r", stdin);
13+
#endif
14+
int n, x;
15+
multiset<int> other;
16+
scanf("%d%d", &n, &x);
17+
for (int i=0; i<2; ++i){
18+
for(int j=0;j<n;++j){
19+
int x; cin >>x;
20+
if (i) nums[j]=x;
21+
else other.insert(x);
22+
}
23+
}
24+
25+
int num=0;
26+
for (int i=0; i<n; ++i) {
27+
int k = x-nums[i];
28+
auto it = other.lower_bound(k);
29+
if (it == other.end()) continue;
30+
++num; other.erase(it);
31+
}
32+
printf("1 %d\n", num);
33+
}

0 commit comments

Comments
 (0)