Submission #3042872
Source Code Expand
#include<iostream> #include<string> #include<cstdio> #include<vector> #include<cmath> #include<algorithm> #include<functional> #include<iomanip> #include<queue> #include<ciso646> #include<random> #include<map> #include<set> #include<complex> #include<bitset> using namespace std; typedef long long ll; typedef unsigned int ui; const ll MOD = 998244353; const ll INF = (ll)1000000007 * 1000000007; typedef pair<int, int> P; #define stop char nyaa;cin>>nyaa; #define rep(i,n) for(int i=0;i<n;i++) #define per(i,n) for(int i=n-1;i>=0;i--) #define Rep(i,sta,n) for(int i=sta;i<n;i++) #define rep1(i,n) for(int i=1;i<=n;i++) #define per1(i,n) for(int i=n;i>=1;i--) #define Rep1(i,sta,n) for(int i=sta;i<=n;i++) typedef long double ld; typedef complex<ld> Point; const ld eps = 1e-11; const ld pi = acos(-1.0); typedef pair<ll, ll> LP; typedef pair<ld, ld> LDP; int main() { int k = 38; int n = k * k - k + 1; cout << n << " " << k << endl; int trans[38]; rep(i, k) { cout << 1; int s = 1 + i * (k - 1); Rep(j, s, s + k - 1) { cout << " " << j + 1; } cout << endl; } rep(i, k - 1) { rep(j, k - 1) { trans[j] = (i + j) % (k - 1); } rep(j, k - 1) { cout << i + 2; int now = j; rep(l, k - 1) { int s = k + l * (k - 1) + now; now = trans[now]; cout << " " << s + 1; } cout << endl; } } return 0; }
Submission Info
Submission Time | |
---|---|
Task | F - Distribute Numbers |
User | heno239 |
Language | C++14 (GCC 5.4.1) |
Score | 1000 |
Code Size | 1410 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 512 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 1000 / 1000 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | 01-01.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 8 ms | 512 KB |