Submission #36805354


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
 
typedef long long int lli;

//lli N = 10e9+7;
//vector <vector <lli>> arr(N,);
//double eps = 1e-9;
 
void solve()
{
	lli v=0, w=0, i;
	string str;
	cin>>str;
	for(i=0;i<str.length();i++) {if(str[i]=='v')v++;else w++;}
	cout<<(v+(2*w));
}
 
void usaco()
{
	freopen("diamond.in","r",stdin);
  	freopen("diamond.out","w",stdout);
}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
}

Submission Info

Submission Time
Task A - wwwvvvvvv
User Pesto
Language C++ (GCC 9.2.1)
Score 100
Code Size 484 Byte
Status AC
Exec Time 6 ms
Memory 3624 KiB

Compile Error

./Main.cpp: In function ‘void solve()’:
./Main.cpp:15:11: warning: comparison of integer expressions of different signedness: ‘lli’ {aka ‘long long int’} and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   15 |  for(i=0;i<str.length();i++) {if(str[i]=='v')v++;else w++;}
      |          ~^~~~~~~~~~~~~
./Main.cpp: In function ‘void usaco()’:
./Main.cpp:21:9: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
   21 |  freopen("diamond.in","r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
./Main.cpp:22:11: warning: ignoring return value of ‘FILE* freopen(const char*, const char*, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
   22 |    freopen("diamond.out","w",stdout);
      |    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 10
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 02_max_00.txt, 02_max_01.txt, 02_max_02.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 6 ms 3592 KiB
00_sample_01.txt AC 1 ms 3492 KiB
00_sample_02.txt AC 1 ms 3472 KiB
01_random_00.txt AC 2 ms 3624 KiB
01_random_01.txt AC 2 ms 3592 KiB
01_random_02.txt AC 2 ms 3556 KiB
01_random_03.txt AC 2 ms 3488 KiB
02_max_00.txt AC 2 ms 3588 KiB
02_max_01.txt AC 2 ms 3468 KiB
02_max_02.txt AC 2 ms 3512 KiB