Submission #18738614
Source Code Expand
Copy
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
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(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------
static const int N_=1020;
static ll C_[N_][N_];
void solve() {
int i,j,k,l,r,x,y; string s;
FOR(i,N_) C_[i][0]=C_[i][i]=1;
for(i=1;i<N_;i++) for(j=1;j<i;j++) C_[i][j]=(C_[i-1][j-1]+C_[i-1][j]);
cin>>x;
cout<<C_[x-1][11]<<endl;
}
int main(int argc,char** argv){
string s;int i;
if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
cout.tie(0); solve(); return 0;
}
Submission Info
Submission Time |
|
Task |
C - Duodecim Ferra |
User |
kmjp |
Language |
C++ (GCC 9.2.1) |
Score |
300 |
Code Size |
1075 Byte |
Status |
AC |
Exec Time |
15 ms |
Memory |
10764 KB |
Compile Error
./Main.cpp: In function ‘void solve()’:
./Main.cpp:21:10: warning: unused variable ‘k’ [-Wunused-variable]
21 | int i,j,k,l,r,x,y; string s;
| ^
./Main.cpp:21:12: warning: unused variable ‘l’ [-Wunused-variable]
21 | int i,j,k,l,r,x,y; string s;
| ^
./Main.cpp:21:14: warning: unused variable ‘r’ [-Wunused-variable]
21 | int i,j,k,l,r,x,y; string s;
| ^
./Main.cpp:21:18: warning: unused variable ‘y’ [-Wunused-variable]
21 | int i,j,k,l,r,x,y; string s;
| ^
./Main.cpp: In function ‘int main(int, char**)’:
./Main.cpp:6:28: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
6 | #define FOR(x,to) for(x=0;x<(to);x++)
| ^
./Main.cpp:33:38: note: in expansion of macro ‘FOR’
33 | FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
| ^~~
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
sample_01.txt, sample_02.txt, sample_03.txt |
All |
handmade_00.txt, handmade_01.txt, handmade_02.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, sample_01.txt, sample_02.txt, sample_03.txt |
Case Name |
Status |
Exec Time |
Memory |
handmade_00.txt |
AC |
12 ms |
10760 KB |
handmade_01.txt |
AC |
8 ms |
10764 KB |
handmade_02.txt |
AC |
8 ms |
10712 KB |
random_00.txt |
AC |
10 ms |
10724 KB |
random_01.txt |
AC |
15 ms |
10724 KB |
random_02.txt |
AC |
13 ms |
10684 KB |
random_03.txt |
AC |
8 ms |
10672 KB |
random_04.txt |
AC |
14 ms |
10748 KB |
random_05.txt |
AC |
9 ms |
10656 KB |
random_06.txt |
AC |
9 ms |
10712 KB |
random_07.txt |
AC |
12 ms |
10624 KB |
random_08.txt |
AC |
8 ms |
10760 KB |
random_09.txt |
AC |
12 ms |
10612 KB |
sample_01.txt |
AC |
8 ms |
10676 KB |
sample_02.txt |
AC |
10 ms |
10684 KB |
sample_03.txt |
AC |
9 ms |
10676 KB |