Submission #1040399

# Submission time Handle Problem Language Result Execution time Memory
1040399 2024-08-01T03:20:57 Z tamir1 Pairs (IOI07_pairs) C++17
29 / 100
4000 ms 3420 KB
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll b,n,m,d,i,j,x[100010],y[100010],z[100010];
ll ans;
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> b >> n >> d >> m;
	if(b==1) for(i=1;i<=n;i++) cin >> x[i];
	if(b==2) for(i=1;i<=n;i++) cin >> x[i] >> y[i];
	if(b==3) for(i=1;i<=n;i++) cin >> x[i] >> y[i] >> z[i];
	for(i=1;i<n;i++){
		for(j=i+1;j<=n;j++){
			if(abs(x[i]-x[j])+abs(y[i]-y[j])+abs(z[i]-z[j])<=d) ans++;
		}
	}
	cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4016 ms 1624 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4067 ms 1884 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4038 ms 2348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 1 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4059 ms 2396 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4053 ms 2652 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4027 ms 3164 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4011 ms 3416 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4067 ms 3420 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4064 ms 3420 KB Time limit exceeded
2 Halted 0 ms 0 KB -