Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
ამოცანა#1---------------From adjacency matrix to adjacency list.
#include <iostream> #include <vector> #include <sstream> #include <algorithm> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; for (int i = 1; i <= n; i ++) { int count = 0; stringstream ss; for (int j = 1; j <= n; j++) { int v; cin >> v; if (v == 1) { count++; ss << ' ' << j; } } cout << count << ss.str() << '\n'; } return 0; }
run
|
edit
|
history
|
help
0
Hello
dijkstra's algo
Einstein's Physics
const example
cons1
Simple Interest Calculator
odws
Right view of a tree
codeforces - 545D
passing by reference vs passing by value