Submission #718813

# Submission time Handle Problem Language Result Execution time Memory
718813 2023-04-05T00:08:50 Z Abrar_Al_Samit Jail (JOI22_jail) C++17
0 / 100
1 ms 340 KB
#include <bits/stdc++.h>
using namespace std;
 
 
long long rand(long long a, long long b) {
    return a + rand() % (b - a + 1);
}
int main(int argc, char *argv[]) {
    srand(atoi(argv[1]));
 	
 	int tc = rand(1, 2);
 	cout<<tc<<'\n';

 	while(tc--) {
 		int n = rand(2, 10);
 		cout<<n<<'\n';

 		for(int i=2; i<=n; ++i) {
 			cout<<rand(1, i-1) <<' '<<i<<'\n';
 		}

 		int m = rand(2, n);
 		cout<<m<<'\n';


 		set<int>s, t;
 		while(s.size()<m) {
 			s.insert(rand(1, n));
 		}
 		while(t.size()<m) {
 			t.insert(rand(1, n));
 		}

 		while(!s.empty()) {
 			cout<<*s.begin()<<' '<<*t.begin()<<'\n';
 			s.erase(s.begin());
 			t.erase(t.begin());
 		}
 	}   
    return 0;
}

Compilation message

jail.cpp: In function 'int main(int, char**)':
jail.cpp:27:18: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |    while(s.size()<m) {
      |          ~~~~~~~~^~
jail.cpp:30:18: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   30 |    while(t.size()<m) {
      |          ~~~~~~~~^~
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -