Submission #22275785


Source Code Expand

Copy
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long double ld;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> T gcd(T a, T b){return !b?a:gcd(b,a%b);}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 66666;
ll k,f[N],g[N];int cnt=600;
ll C(ll n, ll m){
	ll r=1;rep(i,1,m)r=r*(n-i+1)/i;return r;
}
int main() {
	read(k);
	rep(i,1,cnt)f[i]=C(6+i,7);
	per(i,cnt,1)while(k>=f[i])k-=f[i],g[i]++;
	rep(i,1,cnt){
		cout<<"FESTIVA";
		while(g[i]--)cout<<"L";
	}
	return 0;
}


Submission Info

Submission Time
Task G - FESTIVAL
User supy
Language C++ (GCC 9.2.1)
Score 1000
Code Size 1259 Byte
Status AC
Exec Time 11 ms
Memory 3648 KB

Compile Error

./Main.cpp: In function ‘ll C(ll, ll)’:
./Main.cpp:32:13: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   32 |  ll r=1;rep(i,1,m)r=r*(n-i+1)/i;return r;
      |             ^
./Main.cpp:9:38: note: in definition of macro ‘rep’
    9 | #define rep(i,a,b) for (register int i=(a); i<=(b); i++)
      |                                      ^
./Main.cpp: In function ‘int main()’:
./Main.cpp:36:6: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   36 |  rep(i,1,cnt)f[i]=C(6+i,7);
      |      ^
./Main.cpp:9:38: note: in definition of macro ‘rep’
    9 | #define rep(i,a,b) for (register int i=(a); i<=(b); i++)
      |                                      ^
./Main.cpp:37:6: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   37 |  per(i,cnt,1)while(k>=f[i])k-=f[i],g[i]++;
      |      ^
./Main.cpp:10:38: note: in definition of macro ‘per’
   10 | #define per(i,a,b) for (register int i=(a); i>=(b); i--)
      |                                      ^
./Main.cpp:38:6: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
   38 |  rep(i,1,cnt){
      |      ^
./Main.cpp:9:38: note: in definition of macro ‘rep’
    9 | #define rep(i,a,b) for (register int i=(a); i<=(b); i++)
      |                                      ^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 1000 / 1000
Status
AC × 2
AC × 56
Set Name Test Cases
Sample example0.txt, example1.txt
All 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, 019.txt, 020.txt, 021.txt, 022.txt, 023.txt, 024.txt, 025.txt, 026.txt, 027.txt, 028.txt, 029.txt, 030.txt, 031.txt, 032.txt, 033.txt, 034.txt, 035.txt, 036.txt, 037.txt, 038.txt, 039.txt, 040.txt, 041.txt, 042.txt, 043.txt, 044.txt, 045.txt, 046.txt, 047.txt, 048.txt, 049.txt, 050.txt, 051.txt, 052.txt, 053.txt, example0.txt, example1.txt
Case Name Status Exec Time Memory
000.txt AC 11 ms 3640 KB
001.txt AC 2 ms 3412 KB
002.txt AC 2 ms 3636 KB
003.txt AC 2 ms 3540 KB
004.txt AC 2 ms 3568 KB
005.txt AC 2 ms 3568 KB
006.txt AC 5 ms 3476 KB
007.txt AC 2 ms 3536 KB
008.txt AC 2 ms 3540 KB
009.txt AC 2 ms 3580 KB
010.txt AC 2 ms 3608 KB
011.txt AC 2 ms 3412 KB
012.txt AC 2 ms 3584 KB
013.txt AC 2 ms 3472 KB
014.txt AC 3 ms 3408 KB
015.txt AC 2 ms 3536 KB
016.txt AC 3 ms 3460 KB
017.txt AC 2 ms 3456 KB
018.txt AC 2 ms 3424 KB
019.txt AC 2 ms 3584 KB
020.txt AC 2 ms 3608 KB
021.txt AC 2 ms 3564 KB
022.txt AC 2 ms 3612 KB
023.txt AC 2 ms 3448 KB
024.txt AC 3 ms 3584 KB
025.txt AC 2 ms 3648 KB
026.txt AC 2 ms 3580 KB
027.txt AC 3 ms 3460 KB
028.txt AC 3 ms 3468 KB
029.txt AC 2 ms 3540 KB
030.txt AC 3 ms 3600 KB
031.txt AC 3 ms 3456 KB
032.txt AC 2 ms 3600 KB
033.txt AC 2 ms 3580 KB
034.txt AC 2 ms 3596 KB
035.txt AC 2 ms 3608 KB
036.txt AC 2 ms 3536 KB
037.txt AC 2 ms 3564 KB
038.txt AC 3 ms 3540 KB
039.txt AC 2 ms 3580 KB
040.txt AC 2 ms 3464 KB
041.txt AC 2 ms 3460 KB
042.txt AC 2 ms 3636 KB
043.txt AC 2 ms 3536 KB
044.txt AC 2 ms 3564 KB
045.txt AC 2 ms 3604 KB
046.txt AC 2 ms 3420 KB
047.txt AC 2 ms 3648 KB
048.txt AC 6 ms 3536 KB
049.txt AC 2 ms 3468 KB
050.txt AC 2 ms 3472 KB
051.txt AC 2 ms 3608 KB
052.txt AC 2 ms 3648 KB
053.txt AC 3 ms 3636 KB
example0.txt AC 2 ms 3608 KB
example1.txt AC 2 ms 3584 KB