NC237298. Plus
描述
Given , you need to find all pairs such that:
输入描述
One line contains one integer . ()
输出描述
In the first line, output the number of pairs you found.
Then each line contains two integers, indicating and .
If there are multiple pairs , you should output them in the increasing order. if and only if or ( and ).
示例1
输入:
2
输出:
0
示例2
输入:
3
输出:
1 2 3
C++(g++ 7.5.0) 解法, 执行用时: 3ms, 内存消耗: 464K, 提交时间: 2023-05-24 18:53:57
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; cout<<(n>2?"1\n2 3":"0")<<endl; }
C++ 解法, 执行用时: 3ms, 内存消耗: 448K, 提交时间: 2022-06-08 15:41:24
#include<stdio.h> long long t;int main(){scanf("%ld",&t);if(t>2)printf("1\n2 3");else printf("0");}
pypy3 解法, 执行用时: 148ms, 内存消耗: 26832K, 提交时间: 2022-07-11 12:42:44
n = int( input() ) if n < 3: print("0") else : print("1\n2 3")
Python3 解法, 执行用时: 42ms, 内存消耗: 4548K, 提交时间: 2022-06-17 18:42:06
n=int(input()) if(n>2): print("1\n2 3") else:print("0")