Submission #1048339

# Submission time Handle Problem Language Result Execution time Memory
1048339 2024-08-08T06:54:14 Z 김은성(#11035) Make them Meet (EGOI24_makethemmeet) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
vector<int> graph[109];
vector<vector<int> > moves;
int n, color[109];
void make_move(){
	vector<int> temp;
	for(int i=0; i<n; i++)
		temp.push_back(color[i]);
	moves.push_back(temp);
}
void answer(){
	printf("%d\n", moves.size());
	for(vector<int> u: moves){
		for(int v: u)
			printf("%d ", v);
		printf("\n");
	}
}
int main(){
	int m, i, j, k, u, v;
	scanf("%d %d", &n, &m);
	for(i=1; i<=m; i++){
		scanf("%d %d", &u, &v);
		graph[u].push_back(v);
		graph[v].push_back(u);
	}
	for(i=1; i<n; i++){
		for(j=i+1; j<n; j++){
			for(k=0; k<n; k++){
				if(k==0 || k==i)
					color[k] = 2;
				else
					color[k]= 1;
			}
			make_move();
			for(k=0; k<n; k++){
				if(k==0 || k==j)
					color[k] = 2;
				else
					color[k]= 1;
			}
			make_move();
			for(k=0; k<n; k++){
				if(k==0 || k==i)
					color[k] = 2;
				else
					color[k]= 1;
			}
			make_move();
			for(k=0; k<n; k++){
				if(k==0 || k==j)
					color[k] = 2;
				else
					color[k]= 1;
			}
			make_move();
		}
	}
	answer();
	return 0;
}

Compilation message

Main.cpp: In function 'void answer()':
Main.cpp:13: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=]
   13 |  printf("%d\n", moves.size());
      |          ~^     ~~~~~~~~~~~~
      |           |               |
      |           int             std::vector<std::vector<int> >::size_type {aka long unsigned int}
      |          %ld
Main.cpp: In function 'int main()':
Main.cpp:22:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   22 |  scanf("%d %d", &n, &m);
      |  ~~~~~^~~~~~~~~~~~~~~~~
Main.cpp:24:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |   scanf("%d %d", &u, &v);
      |   ~~~~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB If people start at 0 and 1, then they can avoid each other
2 Halted 0 ms 0 KB -