P2 隨機序列 - Random Sequence Generator

mail@pastecode.io avatar
unknown
c_cpp
a year ago
327 B
1
Indexable
Never
#include <iostream>
using namespace std;
 
int N;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
    cin >> N;
    
    cout << 2*N*N+1 << endl;
    for(int i = 0; i < N; ++i)
    	for(int j = 0; j < N; ++j)
    		cout << i << " " << j << " ";
    cout << 0 << "\n";
}