Submission #1048485

# Submission time Handle Problem Language Result Execution time Memory
1048485 2024-08-08T07:53:31 Z 이온조(#11092) Make them Meet (EGOI24_makethemmeet) C++17
11 / 100
4 ms 860 KB
#include <bits/stdc++.h>
using namespace std;

vector<int> V[111], G[111];

int main() {
	int N, M; scanf("%d%d", &N, &M);
	for(int i=0; i<M; i++) {
		int u, v; scanf("%d%d", &u, &v);
		G[u].push_back(v);
		G[v].push_back(u);
	}
	for(int i=1; i<N; i++) {
		for(int j=0; j<N; j++) {
			if(j == 0 || i == j) V[i].push_back(1);
			else V[i].push_back(2);
		}
	}
	
	vector<vector<int>> ans;
	vector<int> V1(N), V2(N);
	for(int i=0; i<N; i++) V1[i] = i/2%2 + 1, V2[i] = (i+1)/2%2 + 1;
	for(int i=0; i<3*N; i++) {
		ans.push_back(V1);
		ans.push_back(V2);
	}

	printf("%d\n", ans.size());
	for(auto &it: ans) {
		for(auto jt: it) printf("%d ", jt);
		puts("");
	}
	return 0;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:28:11: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wformat=]
   28 |  printf("%d\n", ans.size());
      |          ~^     ~~~~~~~~~~
      |           |             |
      |           int           std::vector<std::vector<int> >::size_type {aka long unsigned int}
      |          %ld
Main.cpp:7:17: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  int N, M; scanf("%d%d", &N, &M);
      |            ~~~~~^~~~~~~~~~~~~~~~
Main.cpp:9:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   int u, v; scanf("%d%d", &u, &v);
      |             ~~~~~^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB If people start at 0 and 2, then they can avoid each other
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 528 KB Output is correct
5 Correct 4 ms 860 KB Output is correct
6 Correct 3 ms 856 KB Output is correct
7 Correct 3 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 0 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -