Submission #166645

#TimeUsernameProblemLanguageResultExecution timeMemory
166645ArKCaZigZag (COCI17_zigzag)C++17
80 / 80
474 ms10824 KiB
#include<bits/stdc++.h> #define ll long long #define mod 1000000007 #define pb push_back #define pob pop_back #define N 10 using namespace std; vector<string>v; vector<string>vv[50]; int k,n; char sa; string s1; int dizi[50]; int main(){ // freopen("a.gir","r",stdin); // freopen("a.cik","w",stdout); cin>>k>>n; for(int i=0;i<k;i++){ cin>>s1; v.pb(s1); // cout<<s1<<endl; } sort(v.begin(), v.end()); for(int i=0;i<k;i++){ vv[v[i][0]%32].pb(v[i]); } for(int i=0;i<n;i++){ cin>>sa; cout<<vv[sa%32][dizi[sa%32]]<<endl; dizi[sa%32]++; if(dizi[sa%32]==vv[sa%32].size())dizi[sa%32]=0; } }

Compilation message (stderr)

zigzag.cpp: In function 'int main()':
zigzag.cpp:33:17: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if(dizi[sa%32]==vv[sa%32].size())dizi[sa%32]=0;
      ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...