Submission #3596236
Source Code Expand
#include <bits/stdc++.h> using namespace std;; #define ll long long #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define INF 1<<30 #define LINF 1LL<<62 #define all(x) (x).begin(), (x).end() #define mp make_pair const int MOD = 1000000007; typedef pair<int, int> P; typedef pair<ll, ll> LP; typedef pair<int, P> PP; typedef pair<ll, LP> LPP; int main(){ int n; cin >> n; int s = 0; while(s*(s+1)<2* n){ s++; } if(s*(s+1)!=2*n){ cout << "No" << endl; return 0; } vector<int> v[s+1]; int count = 1; REP(i, s){ FOR(j, 1, s-i+1){ v[i].push_back(count); v[i+j].push_back(count); count++; } } cout << "YES" << endl; cout << s+1 << endl; REP(i,s+1){ REP(j,v[i].size()){ cout << v[i][j]; if(j!=v[i].size()-1){ cout << " "; }else{ cout << "\n"; } } } }
Submission Info
Submission Time | |
---|---|
Task | D - Crossing |
User | mathda1 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1147 Byte |
Status | WA |
Exec Time | 20 ms |
Memory | 2304 KB |
Judge Result
Set Name | Sample | All | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | WA | 1 ms | 256 KB |
02.txt | AC | 1 ms | 256 KB |
03.txt | AC | 1 ms | 256 KB |
04.txt | WA | 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 | WA | 1 ms | 256 KB |
09.txt | WA | 1 ms | 256 KB |
10.txt | WA | 1 ms | 256 KB |
11.txt | WA | 18 ms | 2176 KB |
12.txt | WA | 20 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 | WA | 3 ms | 384 KB |
19.txt | WA | 8 ms | 1152 KB |
20.txt | AC | 1 ms | 256 KB |
21.txt | WA | 12 ms | 1536 KB |
22.txt | WA | 10 ms | 1408 KB |
23.txt | WA | 1 ms | 256 KB |
24.txt | WA | 1 ms | 256 KB |
s1.txt | WA | 1 ms | 256 KB |
s2.txt | AC | 1 ms | 256 KB |