제출 #843681

#제출 시각아이디문제언어결과실행 시간메모리
843681nihaddhuseynliLozinke (COCI17_lozinke)C++14
40 / 100
1084 ms15800 KiB
//Bismillahi Rahmanir Rahim
#include <bits/stdc++.h>
using namespace std; 
typedef long long int ll;
const int N = 1000100;
const ll inf =1000001;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };
ll n,m,l,r,x,y,k,cnt,cnt1,flag,flag1,maxx,minn,sum,sum1,a[inf],b[inf],ans,ans1;
ll visited[500001];
ll d[1000][1000],ok[1000][1000];
ll c[100001];
string str,str1,str2,str3;
const int md =1e9+7;
vector<pair<ll,ll>>v,p;
vector<ll> v2;
map<ll,ll>mp;
set<ll>s;
multiset<ll> ms;
stack<ll>st;
double pi=3.14159265358979323846;
vector<ll> v1[500001];
ll dp[2023][2023],dis[200001];
#define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
#define FORN(a, b, c) for (int(a) = (b); (a) <= (c); ++(a))
#define RESET(a, b) memset(a, b, sizeof(a))
#define ins insert
#define fi first
#define se second
#define pb push_back
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SIZE(v) (int)v.size()
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
#define TC(t) while (t--)
/**********/
void solve()
{
      
    cin >> n;
    string a[n+5];
    FOR(i,0,n)
    {
      cin >> a[i];
    }
    FOR(i,0,n)
    {
      FOR(j,i+1,n)
      {
        if(a[i].find(a[j])!=string::npos)
        {
            cnt++;
        }
        if(a[j].find(a[i])!=string::npos)
        {
            cnt++;
        }
      }
    }
    cout << cnt << endl;


}
/**********/
int main()
{       
    ios::sync_with_stdio(0);
    cin.tie(0);
    int t=1;
    int i =1;
    //cin >> t;
    //freopen("homework.in", "r", stdin);
    //freopen("homework.out", "w", stdout);   
    TC(t)
    {   
        solve();
    }
    return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

lozinke.cpp: In function 'void solve()':
lozinke.cpp:24:30: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   24 | #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
      |                              ^
lozinke.cpp:45:5: note: in expansion of macro 'FOR'
   45 |     FOR(i,0,n)
      |     ^~~
lozinke.cpp:24:30: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
   24 | #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
      |                              ^
lozinke.cpp:49:5: note: in expansion of macro 'FOR'
   49 |     FOR(i,0,n)
      |     ^~~
lozinke.cpp:24:30: warning: unnecessary parentheses in declaration of 'j' [-Wparentheses]
   24 | #define FOR(a, b, c) for (int(a) = (b); (a) < (c); ++(a))
      |                              ^
lozinke.cpp:51:7: note: in expansion of macro 'FOR'
   51 |       FOR(j,i+1,n)
      |       ^~~
lozinke.cpp: In function 'int main()':
lozinke.cpp:73:9: warning: unused variable 'i' [-Wunused-variable]
   73 |     int i =1;
      |         ^
#Verdict Execution timeMemoryGrader output
Fetching results...