Cod sursa(job #996497)
| Utilizator | Data | 12 septembrie 2013 07:46:47 | |
|---|---|---|---|
| Problema | Oite | Scor | 10 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.62 kb |
#include <iostream>
#include <fstream>
#include <map>
using namespace std;
//map<long,long> H;
#define P1 113
#define P2 137
#define P3 2311
long H[P1][P2][P3];
int main() {
ifstream I("oite.in");
ofstream O("oite.out");
long C,L, A[1024];
I >> C >> L;
int i,j,k,l;
for(i=0;i<C;i++)
I >> A[i];
for(i=0;i<C;i++) {
for(j=i+1;j<C;j++) {
for(k=j+1;k<C;k++) {
for(l=k+1;l<C;l++) {
long s = A[i]+A[j]+A[k]+A[l];
H[s % P1][s % P2][s % P3]++;
};
};
};
};
O << H[L%P1][L%P2][L%P3];
};
