#include<bits/stdc++.h>
using namespace std;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long n;
cin>>n;
if(n == 0)
{
cout<<"6 6\n1 4\n1 5\n4 3\n5 3\n3 2\n2 6\n";
return 0;
}
int i,a[61][2],cnt = 4;
vector<pair<int,int>>edges;
a[0][0] = 2;
a[0][1] = 1;
edges.push_back({1,2});
edges.push_back({1,3});
edges.push_back({1,4});
for(i = 1; i < 6;i ++)
{
a[i][i^1] = cnt + 1;
edges.push_back({cnt - 2,cnt + 1});
edges.push_back({cnt - 2,cnt + 2});
edges.push_back({cnt - 1,cnt + 1});
edges.push_back({cnt - 1,cnt + 2});
cnt += 3;
a[i][i&1] = cnt;
}
bool l = 0;
if(n < 0) l = 1;
cnt ++;
i = 0;
while(n)
{
if(n & 1) edges.push_back({a[i][l],cnt});
n /= 2;
i++;
}
cout<<cnt<<" "<<edges.size()<<'\n';
for(auto x:edges)
cout<<x.first<<" "<<x.second<<'\n';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Integer parameter [name=X_26] equals to 0, violates the range [1, 20] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
384 KB |
Integer parameter [name=X_24] equals to 0, violates the range [1, 20] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Integer parameter [name=X_26] equals to 0, violates the range [1, 20] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Integer parameter [name=X_26] equals to 0, violates the range [1, 20] |
2 |
Halted |
0 ms |
0 KB |
- |