Submission #1121878

#TimeUsernameProblemLanguageResultExecution timeMemory
1121878vjudge1Calvinball championship (CEOI15_teams)C++17
10 / 100
73 ms65536 KiB
/** ██╗░░██╗████████╗██╗░░░░░███╗░░░███╗ ██║░░██║╚══██╔══╝██║░░░░░████╗░████║ ███████║░░░██║░░░██║░░░░░██╔████╔██║ ██╔══██║░░░██║░░░██║░░░░░██║╚██╔╝██║ ██║░░██║░░░██║░░░███████╗██║░╚═╝░██║ ╚═╝░░╚═╝░░░╚═╝░░░╚══════╝╚═╝░░░░░╚═╝ **/ #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define int l #define f first #define stop system("pause") #define ara <<" "<< #define s second #define endl '\n' #define l long long #define pb push_back #define pairs pair<l,l> #define all(v) v.begin(),v.end() #define yesno(v) ((v) ? "YES" : "NO") #define dbg(x) cout<<#x<<" = "<<x<<endl; #define filereader() ifstream cin(input); #define fileprinter() ofstream cout(output); #define fast ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL); using namespace std; using namespace __gnu_pbds; typedef tree<int, null_type, less_equal<int> , rb_tree_tag, tree_order_statistics_node_update> indexed_set; l gcd(l a, l b){ return (b == 0) ? a : gcd(b, a%b); } const l N = 1e4 + 5; const l INF = 1e18; const l mod = 1e6 + 7; const string input = "input.txt"; const string output = "output.txt"; l dp[N][N]; void solve(){ //ifstream cin(input); //ofstream cout(output); l n; cin >> n; l a[n]; set<l>s; for(int i = 0 ; i < n ; i++){ cin>>a[i];a[i]--; s.insert(a[i]); } dp[0][0] = 1; for(int i = 1; i <= n ; i++){ for(int j = 1; j <= n;j++){ dp[i][j] = ((dp[i-1][j] * (j)) % mod + dp[i-1][j-1]) % mod; } } /* 3 0 1 1 */ l delta = 0; l difnum = s.size(); l ans = 0; for(int i = 1 ; i <= n ; i++){ ans = (ans + dp[n][i]) % mod; } cout<<ans<<endl; } signed main(){ //fast; system("color a"); l n = 1; //cin>>n; while(n--){ solve(); } }

Compilation message (stderr)

teams.cpp: In function 'void solve()':
teams.cpp:79:7: warning: unused variable 'delta' [-Wunused-variable]
   79 |     l delta = 0;
      |       ^~~~~
teams.cpp:80:7: warning: unused variable 'difnum' [-Wunused-variable]
   80 |     l difnum = s.size();
      |       ^~~~~~
teams.cpp: In function 'int main()':
teams.cpp:96:11: warning: ignoring return value of 'int system(const char*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   96 |     system("color a");
      |     ~~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...