Submission #97874

#TimeUsernameProblemLanguageResultExecution timeMemory
97874AKaan37Aron (COCI17_aron)C++14
50 / 50
3 ms512 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int lo; typedef pair< int,int > PII; #define fi first #define se second #define mp make_pair #define pb push_back #define fio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL) #define FOR for(int i=1;i<=n;i++) const int inf = 1000000000; const int mod = 1000000007; const int KOK = 100000; const int li = 100005; const int LOG = 20; int n,m,cev,x,k; vector<int> v; char c; string s; int main(){ scanf("%d",&n); FOR{ char cc; scanf(" %c",&c); if(c==cc) continue; cev++; cc=c; } printf("%d\n",cev+1); return 0; }

Compilation message (stderr)

aron.cpp: In function 'int main()':
aron.cpp:27:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~
aron.cpp:30:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf(" %c",&c);
   ~~~~~^~~~~~~~~~
aron.cpp:31:3: warning: 'cc' may be used uninitialized in this function [-Wmaybe-uninitialized]
   if(c==cc) continue;
   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...