Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
105566 陈志轩 棋子移动 C++ 通过 100 0 MS 256 KB 1321 2023-10-07 13:27:24

Tests(5/5):


#include<bits/stdc++.h> #define int long long using namespace std; namespace Fast{ //注:快读快写与CCF函数不能一起用,不然可能会趋势 inline int fr(){ register int x = 0,f = 1; static char c = getchar(); while (c < '0' || c > '9'){ if (c == '-'){ f = -1; } c = getchar(); } while (c >= '0' && c <= '9'){ x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); } return x * f; } inline void fw(int x){ if (x == 0){ putchar('0'); return ; } if (x < 0){ putchar('-'); x = -x; } stack <char> s; while (x){ s.push(x % 10 + 48); x /= 10; } while (!s.empty()){ putchar(s.top()); s.pop(); } } inline void DEBUG(){ puts("awa"); } inline void CCF(){ //原来想叫CINCOUTFASTER的结果发现缩写竟然是CCF(doge) ios::sync_with_stdio(false); cin.tie(0),cout.tie(0); } } using namespace Fast; void dfs(int siz){ if (siz == 4){ puts("4,5-->9,10"); puts("8,9-->4,5"); puts("2,3-->8,9"); puts("7,8-->2,3"); puts("1,2-->7,8"); exit(0); } cout<<siz<<','<<siz + 1<<"-->"<<siz * 2 + 1<<','<<siz * 2 + 2<<'\n'; cout<<siz * 2 - 1<<','<<siz * 2<<"-->"<<siz<<','<<siz + 1<<'\n'; dfs(siz - 1); } signed main(){ int n = fr(); dfs(n); return 0; }


测评信息: