Submission #2407383
Source Code Expand
#include<bits/stdc++.h> using namespace std; #define inf 1e9 #define ll long long #define ull unsigned long long #define M 1000000007 #define P pair<int,int> #define FOR(i,m,n) for(int i=m;i<n;i++) #define rep(i,n) FOR(i,0,n) const int vx[4] = {0,1,0,-1}; const int vy[4] = {1,0,-1,0}; #define PI 3.14159265 int n,c; int a[1000000]; int ans; int main(){ cin>>n>>c; rep(i,n){ cin>>a[i]; } sort(a,a+n); int i=0; for(int j=n-1;j>=i;j--){ if(a[i]+a[j]+1<=c) i++; ans++; } cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - 収納 |
User | mint |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 566 Byte |
Status | AC |
Exec Time | 60 ms |
Memory | 640 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt, sample_03.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 59 ms | 640 KB |
02.txt | AC | 60 ms | 640 KB |
03.txt | AC | 36 ms | 640 KB |
04.txt | AC | 56 ms | 640 KB |
05.txt | AC | 29 ms | 640 KB |
06.txt | AC | 21 ms | 640 KB |
07.txt | AC | 32 ms | 640 KB |
08.txt | AC | 42 ms | 640 KB |
09.txt | AC | 47 ms | 640 KB |
10.txt | AC | 20 ms | 640 KB |
11.txt | AC | 60 ms | 640 KB |
12.txt | AC | 59 ms | 640 KB |
13.txt | AC | 33 ms | 640 KB |
sample_01.txt | AC | 1 ms | 256 KB |
sample_02.txt | AC | 1 ms | 256 KB |
sample_03.txt | AC | 1 ms | 256 KB |