Cod sursă (job #813736)

Utilizator avatar patricksavin Savin Patrick Alexandru patricksavin IP ascuns
Problemă 2sah (clasele 11-12) Compilator cpp-32 | 0,67 kb
Rundă Arhiva de probleme Status evaluat
Dată 11 mar. 2025 13:47:19 Scor 24
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("2sah.in");
ofstream fout("2sah.out");
#define cin fin
#define cout fout
#define mod 100003;
long long n,k,m;
int main()
{
    int c;
    cin >> c;
    cin >> n >> k;
    m=2*n+1;
    n++;
    if(c==1)
    {
        if(k==1)
            cout << "1";
        if(k==2)
            cout << "3";
        if(k==3)
            cout << "9";
        if(k==4)
            cout << "27";
        else
        {
            long long s=27;
            for(int i=5;i<=k;i++)
            {
                s=s*3%mod;
            }
            cout << s;
        }
    }
    return 0;
}