Submission #4021736
Source Code Expand
/* * Created by Dipta Das on 14-01-2019 * Title: * Problem Link: * Editorial: * Source Code: * Comments: */ #include <bits/stdc++.h> #include <stdio.h> #define fin freopen("input", "r", stdin) #define endl "\n" #define whatis(x) cerr << #x << ": " << x << endl; using namespace std; using ll = long long; vector<int> s[1000]; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, k = 2; cin >> n; while(1) { if (k*(k-1) / 2 >= n) break; ++k; } if (k*(k-1)/2 > n) { cout << "No" << endl; return 0; } cout << "Yes" << endl << k << endl; int x = 1; for (int i = 0; i < k; ++i) { for (int j = i + 1; j < k; ++j) { s[i].push_back(x); s[j].push_back(x); ++x; } } for (int i = 0; i < k; ++i) { cout << s[i].size(); for (int j = 0; j < s[i].size(); ++j) { cout << " " << s[i][j]; } cout << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Crossing |
User | dipta10 |
Language | C++14 (GCC 5.4.1) |
Score | 500 |
Code Size | 1109 Byte |
Status | AC |
Exec Time | 17 ms |
Memory | 2304 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | AC | 1 ms | 256 KB |
05.txt | AC | 1 ms | 256 KB |
06.txt | AC | 1 ms | 256 KB |
07.txt | AC | 1 ms | 256 KB |
08.txt | AC | 1 ms | 256 KB |
09.txt | AC | 1 ms | 256 KB |
10.txt | AC | 1 ms | 256 KB |
11.txt | AC | 16 ms | 2176 KB |
12.txt | AC | 17 ms | 2304 KB |
13.txt | AC | 1 ms | 256 KB |
14.txt | AC | 1 ms | 256 KB |
15.txt | AC | 1 ms | 256 KB |
16.txt | AC | 1 ms | 256 KB |
17.txt | AC | 1 ms | 256 KB |
18.txt | AC | 3 ms | 512 KB |
19.txt | AC | 7 ms | 1408 KB |
20.txt | AC | 1 ms | 256 KB |
21.txt | AC | 10 ms | 1664 KB |
22.txt | AC | 9 ms | 1408 KB |
23.txt | AC | 1 ms | 256 KB |
24.txt | AC | 1 ms | 256 KB |
s1.txt | AC | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |