Submission #1048413

# Submission time Handle Problem Language Result Execution time Memory
1048413 2024-08-08T07:27:16 Z 이온조(#11092) Make them Meet (EGOI24_makethemmeet) C++17
0 / 100
0 ms 352 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;
	for(int i=1; i<N; i++) {
		for(int t=0; t<2; t++) ans.push_back(V[i]);
	}
	for(int i=1; i<N; i++) {
		ans.push_back(V[i]);
		for(int j=1; j<N; j++) for(int t=0; t<2; t++) if(i != j) ans.push_back(V[i]);
		ans.push_back(V[i]);
	}
	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 352 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 1 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 1 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 -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 352 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 1 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 352 KB Output is correct
2 Incorrect 0 ms 348 KB If people start at 1 and 2, then they can avoid each other
3 Halted 0 ms 0 KB -