Submission #992717
Source Code Expand
#include <bits/stdc++.h> using namespace std; #define pb push_back typedef long long ll; const ll INF = 1000000000ll; const ll MOD = 1000000007ll; const double EPS = 1e-8; int main(void) { //ios_base::sync_with_stdio(false); //cin.tie(0); int n; cin >> n; int mi = INF; int a1, a2; for(int i=1; i<=n; i++){ if(n-i > 0 && n-i != i && max(i, n-i) < mi){ mi = max(i, n-i); a1 = i; a2 = n-i; } } int sum = 0; vector<int> v; for(int i=1; i<n/2; i++){ sum += i; v.push_back(i); if(sum == n){ for(int j=0; j<v.size(); j++){ cout << v[j] << endl; } return 0; } } int c1, c2, c3; if((n/2) * 2 == n ){ c1 = n / 2; c2 = 1; c3 = n / 2 - 1; if(c1 != c2 && c2 != c3 && c1 != c3){ cout << c1 << endl; cout << c2 << endl; cout << c3 << endl; return 0; } } if(mi == INF){ cout << n << endl; }else{ cout << a1 << endl; cout << a2 << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | tanutarou |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 998 Byte |
Status | WA |
Exec Time | 89 ms |
Memory | 33124 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | 0 / 100 | ||||||||||
Status |
|
|
|
Set Name | Test Cases |
---|---|
sample | sample-01.txt, sample-02.txt, sample-03.txt |
dataset1 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt |
dataset2 | sample-01.txt, sample-02.txt, sample-03.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, 01-08.txt, 01-09.txt, 01-10.txt, 02-01.txt, 02-02.txt, 02-03.txt, 02-04.txt, 02-05.txt, 02-06.txt, 02-07.txt, 02-08.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 3 ms | 256 KB |
01-02.txt | AC | 3 ms | 256 KB |
01-03.txt | AC | 3 ms | 256 KB |
01-04.txt | WA | 3 ms | 256 KB |
01-05.txt | WA | 3 ms | 256 KB |
01-06.txt | WA | 3 ms | 256 KB |
01-07.txt | AC | 3 ms | 256 KB |
01-08.txt | WA | 3 ms | 256 KB |
01-09.txt | WA | 3 ms | 256 KB |
01-10.txt | WA | 3 ms | 256 KB |
02-01.txt | WA | 89 ms | 33124 KB |
02-02.txt | AC | 34 ms | 256 KB |
02-03.txt | WA | 88 ms | 33124 KB |
02-04.txt | WA | 88 ms | 33124 KB |
02-05.txt | WA | 88 ms | 33124 KB |
02-06.txt | WA | 25 ms | 8556 KB |
02-07.txt | WA | 14 ms | 4464 KB |
02-08.txt | WA | 85 ms | 33124 KB |
sample-01.txt | AC | 3 ms | 256 KB |
sample-02.txt | AC | 3 ms | 256 KB |
sample-03.txt | AC | 2 ms | 256 KB |