Submission #11691192
Source Code Expand
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<set> #include<map> #include<queue> #include<stack> #include<cctype> #include<climits> #include<string> #include<bitset> #include<cfloat> #include<iomanip> #include<numeric> //#define int long long #define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i)) #define rep(i,end) repi((i),0,(end)) #define rfor(x,v) for(auto& (x) : (v)) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define fsort(v,lambda) sort(all((v)),(lambda)) #define vin(v) rep(i,(v).size())cin >> (v)[i]; #define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second using namespace std; using ll = long long; using pint = pair<int,int>; using vint = vector<int>; using vvint = vector<vint>; using vpint = vector<pint>; template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; } template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; } template<class T>void put_double(T a){if(cout.precision()!=12)cout<<setprecision(12);cout<<a<<endl;} template<class T>void print(T a){cout << a << endl;} //lambda: [](int x, int y){return x<y;} signed main(void) { int n; cin >> n; int sum = 1, i = 2; while(sum < n) { sum += i; if(sum >= n) { int d = sum - n; repi(j, 1, i + 1) { if(j == d) continue; print(j); } return 0; } i++; } print(1); return 0; }
Submission Info
Submission Time | |
---|---|
Task | B - Exactly N points |
User | sagoj0_ |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 1564 Byte |
Status | AC |
Exec Time | 8 ms |
Memory | 256 KB |
Judge Result
Set Name | sample | dataset1 | dataset2 | ||||||
---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | 100 / 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, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01-01.txt | AC | 1 ms | 256 KB |
01-02.txt | AC | 1 ms | 256 KB |
01-03.txt | AC | 1 ms | 256 KB |
01-04.txt | AC | 1 ms | 256 KB |
01-05.txt | AC | 1 ms | 256 KB |
01-06.txt | AC | 1 ms | 256 KB |
01-07.txt | AC | 1 ms | 256 KB |
01-08.txt | AC | 1 ms | 256 KB |
01-09.txt | AC | 1 ms | 256 KB |
01-10.txt | AC | 1 ms | 256 KB |
02-01.txt | AC | 8 ms | 256 KB |
02-02.txt | AC | 8 ms | 256 KB |
02-03.txt | AC | 8 ms | 256 KB |
02-04.txt | AC | 8 ms | 256 KB |
02-05.txt | AC | 8 ms | 256 KB |
02-06.txt | AC | 5 ms | 256 KB |
02-07.txt | AC | 4 ms | 256 KB |
02-08.txt | AC | 8 ms | 256 KB |
sample-01.txt | AC | 1 ms | 256 KB |
sample-02.txt | AC | 1 ms | 256 KB |
sample-03.txt | AC | 1 ms | 256 KB |