Submission #1058651

#TimeUsernameProblemLanguageResultExecution timeMemory
1058651kachim2Make them Meet (EGOI24_makethemmeet)C++17
34 / 100
4 ms604 KiB
#include<bits/stdc++.h> using namespace std; vector<vector<int>> graph; int n, m; void pathlike(){ cout << "600\n"; for(int i = 0; i < 600; i++){ for(int j = 0; j < n; j++){ cout << (j+(i%2))/2 << ' '; } cout << '\n'; } } void star(){ cout << 3 << '\n'; cout << 1 << ' ' << 1 << ' '; for(int i = 2; i < n; i++){ cout << 1 << ' '; } cout << '\n'; cout << 0 << ' ' << 0 << ' '; for(int i = 2; i < n; i++){ cout << 1 << ' '; } cout << '\n'; cout << 1 << ' ' << 1 << ' '; for(int i = 2; i < n; i++){ cout << 1 << ' '; } } int main(){ cin >> n >> m; graph.resize(n); for(int i = 0; i < m; i++){ int x, y; cin >> x >> y; graph[x].push_back(y); graph[y].push_back(x); } if(graph[0].size() == n-1 && graph[1].size() == 1){ star(); }else{ pathlike(); } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:41:24: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   41 |     if(graph[0].size() == n-1 && graph[1].size() == 1){
      |        ~~~~~~~~~~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...