Submission #906362

# Submission time Handle Problem Language Result Execution time Memory
906362 2024-01-14T06:42:21 Z iloveroseanne Sifra (COCI21_sifra) C++17
50 / 50
1 ms 348 KB
/// PARK CHAEYOUNG IS MY LOVE
/// Author: Ngo Ba Van
/// roses_are_rosie
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define MASK(i) (1LL<<i)
#define BIT(x,i) (x&MASK(i))
#define ONBIT(x,i) (x|MASK(i))
#define OFFBIT(x,i) (x&~MASK(i))
#define COUNT(x) (__builtin_popcount(x))
#define RVAN1102 signed main()
using ii=pair<int,int>;
const ll N=2e5+5,M=1e9+7;
ll n,m,res;
map<string,int>d;
void nhap()
{
    string s,k="";
    cin>>s; s+='a'; n=s.size();
    for (int i=0;i<n;i++)
    {
        if (s[i]=='0')
        {
            if (k!="") k+=s[i];
            continue;
        }
        if (s[i]>='1'&&s[i]<='9') k+=s[i];
        else
        {
            if (k!="")
            {
                if (d[k]==0) res++,d[k]++;
                k="";
            }
        }
    }
    cout<<res;
}
RVAN1102 {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#define task ""
#define task "a"
if(fopen(task".inp","r"))
{
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
}
int t=1;
//cin>>t;
while (t--)
nhap();
}

Compilation message

Main.cpp:46: warning: "task" redefined
   46 | #define task "a"
      | 
Main.cpp:45: note: this is the location of the previous definition
   45 | #define task ""
      | 
Main.cpp: In function 'int main()':
Main.cpp:49:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   49 |     freopen(task".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:50:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   50 |     freopen(task".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 348 KB Output is correct
10 Correct 1 ms 348 KB Output is correct