Submission #226303

# Submission time Handle Problem Language Result Execution time Memory
226303 2020-04-23T10:51:52 Z kshitij_sodani Meetings (JOI19_meetings) C++17
0 / 100
33 ms 32612 KB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef int64_t llo;
#define mp make_pair
#define pb push_back
#define a first
#define b second
#define endl "\n"
#include "meetings.h"

void Solve(int n){
	int vis[n][n];
	for(int i=0;i<n;i++){
		for(int j=0;j<n;j++){
			vis[i][j]=0;
		}
	}
	int arr[n];
	for(int i=0;i<n;i++){
		arr[i]=i;
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			int st=1;
			shuffle(arr, arr + n, 
            default_random_engine(0)); 

			for(int kk=0;kk<n;kk++){
				int k=arr[k];
				if(k==i or k==j){
					continue;
				}
				int x=Query(i,j,k);
				if(x==k){
					st=0;
					break;
				}
			}
			vis[i][j]=st;
		}
	}
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			if(vis[i][j]==1){
				Bridge(i,j);
			}
		}
	}
}

/*int main(){




	return 0;
}*/

Compilation message

meetings.cpp: In function 'void Solve(int)':
meetings.cpp:30:9: warning: 'k' may be used uninitialized in this function [-Wmaybe-uninitialized]
     int k=arr[k];
         ^
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 5 ms 640 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 33 ms 32612 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -