square869120Contest #3

Submission #1188524

Source codeソースコード

#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include <iomanip>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP(i,n) for (int i=1;i<=(n);i++)
#define EVEL 1

#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {X;}
#define TF(f) {f;}
#define END {}
#endif
const int MOD = 1000000007;
const int INF = 1000000;
#define NMAX 50
//#define MAX 10

    ll N,K,id=9;
    ll A[100010],sum=0,ans=0;


int main(){
    ios_base::sync_with_stdio(false);
    cin>>N>>K;

        REP(i,N){
            ll a=id;
            REP(j,5){
                if(i==0||i==N-1)break;
                    if(j==0){
                        sum=a*9;
                    }else{
                        a++;
                        sum=a*9;
                    }
                    DEB(i)DEB(j)DEB(sum) END
                    if(sum%11==K){ans++;}
            }
            if(!(i==0||i==N-1))id+=7;
            DEB(id) END
        }

    cout<<ans<<endl;
}

Submission

Task問題 A - カレンダー / Calendar
User nameユーザ名 Nafmo
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 TLE
Score得点 150
Source lengthソースコード長 1297 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
Sample - sample_1.txt,sample_2.txt,sample_3.txt,sample_4.txt
Subtask1 150 / 150 sample_1.txt,sample_2.txt,sample_3.txt,sample_4.txt,sub1_in1.txt,sub1_in2.txt,sub1_in3.txt,sub1_in4.txt,sub1_in5.txt,sub1_in6.txt,sub1_in7.txt,sub1_in8.txt,sub1_in9.txt
Subtask2 0 / 100 sample_1.txt,sample_2.txt,sample_3.txt,sample_4.txt,sub1_in1.txt,sub1_in2.txt,sub1_in3.txt,sub1_in4.txt,sub1_in5.txt,sub1_in6.txt,sub1_in7.txt,sub1_in8.txt,sub1_in9.txt,sub2_in1.txt,sub2_in2.txt,sub2_in3.txt,sub2_in4.txt,sub2_in5.txt,sub2_in6.txt,sub2_in7.txt,sub2_in8.txt,sub2_in9.txt

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
sample_1.txt AC 1 ms 256 KB
sample_2.txt AC 1 ms 256 KB
sample_3.txt AC 1 ms 256 KB
sample_4.txt AC 1 ms 256 KB
sub1_in1.txt AC 1 ms 256 KB
sub1_in2.txt AC 1 ms 256 KB
sub1_in3.txt AC 1 ms 256 KB
sub1_in4.txt AC 1 ms 256 KB
sub1_in5.txt AC 1 ms 256 KB
sub1_in6.txt AC 1 ms 256 KB
sub1_in7.txt AC 1 ms 256 KB
sub1_in8.txt AC 1 ms 256 KB
sub1_in9.txt AC 1 ms 256 KB
sub2_in1.txt AC 29 ms 256 KB
sub2_in2.txt TLE
sub2_in3.txt TLE
sub2_in4.txt TLE
sub2_in5.txt TLE
sub2_in6.txt AC 330 ms 256 KB
sub2_in7.txt TLE
sub2_in8.txt TLE
sub2_in9.txt AC 197 ms 256 KB