Submission #992669

# Submission time Handle Problem Language Result Execution time Memory
992669 2024-06-05T00:27:53 Z ezzzay Pairs (IOI07_pairs) C++14
0 / 100
32 ms 1600 KB
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
const int N=3e5+5;
int arr[N];
int sbtsk1(int N, int D , int M){
	vector<int>v;
	for(int i=1;i<=N;i++){
		v.pb(arr[i]);
	}
	sort(v.begin(),v.end());
	int cnt=0;
	for(auto i=v.begin();i!=v.end();i++){
		int a=*i;
		auto it= upper_bound(v.begin(),v.end(),a-D-1);
		cnt+= i-it;
	}
	cout<<cnt;
}
signed main(){
    int B,N,D,M;
    cin>>B>>N>>D>>M;
    for(int i=1;i<=N;i++)cin>>arr[i];
    if(B==1){
    	sbtsk1(N,D,M);
    	return 0;
	}
}

Compilation message

pairs.cpp: In function 'int sbtsk1(int, int, int)':
pairs.cpp:21:1: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | }
      | ^
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 348 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 604 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 19 ms 1488 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 31 ms 1600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 1600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 1372 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 1368 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 1116 KB Output isn't correct
2 Halted 0 ms 0 KB -